summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toke.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index d42f6530a7..0570a15732 100644
--- a/toke.c
+++ b/toke.c
@@ -9190,8 +9190,10 @@ S_scan_pat(pTHX_ char *start, I32 type)
* 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] == '{')))
{
@@ -9199,6 +9201,7 @@ S_scan_pat(pTHX_ char *start, I32 type)
break;
}
}
+ pm->op_pmflags |= PMf_IS_QR;
}
while (*s && S_pmflag(aTHX_ valid_flags, &(pm->op_pmflags), &s, &charset)) {};