From: Nicholas Clark Date: Wed, 9 Jan 2008 23:26:14 +0000 (+0000) Subject: Fix the bug introduced by the bug fix of change 30755. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66b1de870892b142348d95c3a6c21c7ff7269508;p=p5sagit%2Fp5-mst-13.2.git Fix the bug introduced by the bug fix of change 30755. (Certain regexps could SEGV if cloned). p4raw-id: //depot/perl@32932 --- diff --git a/regcomp.c b/regcomp.c index fa8e0f1..03d1112 100644 --- a/regcomp.c +++ b/regcomp.c @@ -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; + } } } diff --git a/t/op/pat.t b/t/op/pat.t index 2ccc07c..b6e8b68 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -1297,10 +1297,7 @@ print "ok 246\n"; print "not " unless "\x{abcd}" =~ /\x{abcd}/; print "ok 247\n"; -if ($::running_as_thread) { - print "not ok 248 # TODO & SKIP: SEGVs in 5.10 when threaded\n"; - print "not ok 249 # TODO & SKIP: SEGVs in 5.10 when threaded\n"; -} else { +{ # bug id 20001008.001 $test = 248;