summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-02-18 22:11:20 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-02-18 22:11:20 +0000
commit3baa4c62cda542368be1e7e1f7af8bd8257c2ff4 (patch)
tree36c534fdd1b4be5046f1c67dcdf0be0722f4dc97 /regcomp.c
parent5da9da9e9f46681684e0c487fd55df8db6f9de67 (diff)
downloadperl-3baa4c62cda542368be1e7e1f7af8bd8257c2ff4.tar.gz
Misapplied regex optimizations when \C is present.
Fixes 20001230.002. What still remains broken is that the submatches that have \C in them get their UTF8 flag on because their parent SV has it on. This will result in malformed UTF8 if a \C happened to match a non-ASCII byte. p4raw-id: //depot/perl@8836
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 547f756a30..69d114e9e9 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1930,6 +1930,8 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
r->reganch |= ROPT_LOOKBEHIND_SEEN;
if (RExC_seen & REG_SEEN_EVAL)
r->reganch |= ROPT_EVAL_SEEN;
+ if (RExC_seen & REG_SEEN_SANY)
+ r->reganch |= ROPT_SANY_SEEN;
Newz(1002, r->startp, RExC_npar, I32);
Newz(1002, r->endp, RExC_npar, I32);
PL_regdata = r->data; /* for regprop() */
@@ -2638,6 +2640,7 @@ tryagain:
break;
case 'C':
ret = reg_node(pRExC_state, SANY);
+ RExC_seen |= REG_SEEN_SANY;
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
break;