The toke code that scanned a pattern string to see if it looked like it
had any code blocks in it, used the wrong pointers. This then failed if
the pattern spread over multiple lines and buffers got reassigned.
* anon CV. False positives like qr/[(?{]/ are harmless */
if (type == OP_QR) {
- char *p;
- for (p = start; p < s; p++) {
+ STRLEN len;
+ char *e, *p = SvPV(PL_lex_stuff, len);
+ e = p + len;
+ for (; p < e; p++) {
if (p[0] == '(' && p[1] == '?'
&& (p[2] == '{' || (p[2] == '?' && p[3] == '{')))
{
break;
}
}
+ pm->op_pmflags |= PMf_IS_QR;
}
while (*s && S_pmflag(aTHX_ valid_flags, &(pm->op_pmflags), &s, &charset)) {};