/* *These* symbols are masked to allow static link. */
# define Perl_pregfree my_regfree
# define Perl_regnext my_regnext
+# define save_re_context my_save_re_context
#endif
/*SUPPRESS 112*/
? (flags & ~SCF_DO_SUBSTR) : flags);
if (!scan) /* It was not CURLYX, but CURLY. */
scan = next;
- if (PL_dowarn && (minnext + deltanext == 0)
+ if (ckWARN(WARN_UNSAFE) && (minnext + deltanext == 0)
&& !(data->flags & (SF_HAS_PAR|SF_IN_PAR))
&& maxcount <= 10000) /* Complement check for big count */
- warn("Strange *+?{} on zero-length expression");
+ warner(WARN_UNSAFE, "Strange *+?{} on zero-length expression");
min += minnext * mincount;
is_inf |= (maxcount == REG_INFTY && (minnext + deltanext) > 0
|| deltanext == I32_MAX);
goto do_curly;
}
nest_check:
- if (PL_dowarn && !SIZE_ONLY && !(flags&HASWIDTH) && max > 10000) {
- warn("%.*s matches null string many times",
+ if (ckWARN(WARN_UNSAFE) && !SIZE_ONLY && !(flags&HASWIDTH) && max > 10000) {
+ warner(WARN_UNSAFE, "%.*s matches null string many times",
PL_regcomp_parse - origparse, origparse);
}
*flagp |= HASWIDTH;
nextchar();
if (UTF && !PL_utf8_mark)
- is_utf8_mark("~"); /* preload table */
+ is_utf8_mark((U8*)"~"); /* preload table */
break;
case 'w':
ret = reg_node(
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_alnum)
- is_utf8_alnum("a"); /* preload table */
+ is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 'W':
ret = reg_node(
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_alnum)
- is_utf8_alnum("a"); /* preload table */
+ is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 'b':
PL_seen_zerolen++;
*flagp |= SIMPLE;
nextchar();
if (UTF && !PL_utf8_alnum)
- is_utf8_alnum("a"); /* preload table */
+ is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 'B':
PL_seen_zerolen++;
*flagp |= SIMPLE;
nextchar();
if (UTF && !PL_utf8_alnum)
- is_utf8_alnum("a"); /* preload table */
+ is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 's':
ret = reg_node(
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_space)
- is_utf8_space(" "); /* preload table */
+ is_utf8_space((U8*)" "); /* preload table */
break;
case 'S':
ret = reg_node(
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_space)
- is_utf8_space(" "); /* preload table */
+ is_utf8_space((U8*)" "); /* preload table */
break;
case 'd':
ret = reg_node(UTF ? DIGITUTF8 : DIGIT);
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_digit)
- is_utf8_digit("1"); /* preload table */
+ is_utf8_digit((U8*)"1"); /* preload table */
break;
case 'D':
ret = reg_node(UTF ? NDIGITUTF8 : NDIGIT);
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_digit)
- is_utf8_digit("1"); /* preload table */
+ is_utf8_digit((U8*)"1"); /* preload table */
break;
case 'p':
case 'P':
default:
normal_default:
if ((*p & 0xc0) == 0xc0 && UTF) {
- ender = utf8_to_uv(p, &numlen);
+ ender = utf8_to_uv((U8*)p, &numlen);
p += numlen;
}
else
* (POSIX Extended Character Classes, that is)
* The text between e.g. [: and :] would start
* at posixccs + 1 and stop at regcomp_parse - 2. */
- if (dowarn && !SIZE_ONLY)
- warn("Character class syntax [%c %c] is reserved for future extensions", posixccc, posixccc);
+ if (ckWARN(WARN_UNSAFE) && !SIZE_ONLY)
+ warner(WARN_UNSAFE,
+ "Character class syntax [%c %c] is reserved for future extensions", posixccc, posixccc);
PL_regcomp_parse++; /* skip over the ending ] */
}
}
while (PL_regcomp_parse < PL_regxend && *PL_regcomp_parse != ']') {
skipcond:
- value = utf8_to_uv(PL_regcomp_parse, &numlen);
+ value = utf8_to_uv((U8*)PL_regcomp_parse, &numlen);
PL_regcomp_parse += numlen;
if (value == '[' && PL_regcomp_parse + 1 < PL_regxend &&
* (POSIX Extended Character Classes, that is)
* The text between e.g. [: and :] would start
* at posixccs + 1 and stop at regcomp_parse - 2. */
- if (dowarn && !SIZE_ONLY)
- warn("Character class syntax [%c %c] is reserved for future extensions", posixccc, posixccc);
+ if (ckWARN(WARN_UNSAFE) && !SIZE_ONLY)
+ warner(WARN_UNSAFE,
+ "Character class syntax [%c %c] is reserved for future extensions", posixccc, posixccc);
PL_regcomp_parse++; /* skip over the ending ] */
}
}
}
if (value == '\\') {
- value = utf8_to_uv(PL_regcomp_parse, &numlen);
+ value = utf8_to_uv((U8*)PL_regcomp_parse, &numlen);
PL_regcomp_parse += numlen;
switch (value) {
case 'w':
flags |= ANYOF_SPACEL;
sv_catpvf(listsv, "+utf8::IsSpace\n");
if (!PL_utf8_space)
- is_utf8_space(" ");
+ is_utf8_space((U8*)" ");
}
lastvalue = 123456;
continue;
sv_catpvf(listsv,
"!utf8::IsSpace\n");
if (!PL_utf8_space)
- is_utf8_space(" ");
+ is_utf8_space((U8*)" ");
}
lastvalue = 123456;
continue;
{
dTHR;
if (SIZE_ONLY) {
- char tmpbuf[10];
+ U8 tmpbuf[10];
*lenp = uv_to_utf8(tmpbuf, uv) - tmpbuf;
}
else
- *lenp = uv_to_utf8(s, uv) - s;
+ *lenp = uv_to_utf8((U8*)s, uv) - (U8*)s;
}