diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-09 23:26:14 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-09 23:26:14 +0000 |
commit | 66b1de870892b142348d95c3a6c21c7ff7269508 (patch) | |
tree | c1626f30a9a8878212490da14ee0ae282b45e172 /regcomp.c | |
parent | e3faa678eb30e1e08116ca1bd086624974e5e5aa (diff) | |
download | perl-66b1de870892b142348d95c3a6c21c7ff7269508.tar.gz |
Fix the bug introduced by the bug fix of change 30755.
(Certain regexps could SEGV if cloned).
p4raw-id: //depot/perl@32932
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -9409,7 +9409,9 @@ Perl_re_dup_guts(pTHX_ const REGEXP *sstr, REGEXP *dstr, CLONE_PARAMS *param) /* Do it this way to avoid reading from *r after the StructCopy(). That way, if any of the sv_dup_inc()s dislodge *r from the L1 cache, it doesn't matter. */ - const bool anchored = r->check_substr == r->anchored_substr; + const bool anchored = r->check_substr + ? r->check_substr == r->anchored_substr + : r->check_utf8 == r->anchored_utf8; Newx(ret->substrs, 1, struct reg_substr_data); StructCopy(r->substrs, ret->substrs, struct reg_substr_data); @@ -9432,6 +9434,12 @@ Perl_re_dup_guts(pTHX_ const REGEXP *sstr, REGEXP *dstr, CLONE_PARAMS *param) ret->check_substr = ret->float_substr; ret->check_utf8 = ret->float_utf8; } + } else if (ret->check_utf8) { + if (anchored) { + ret->check_utf8 = ret->anchored_utf8; + } else { + ret->check_utf8 = ret->float_utf8; + } } } |