Change 32932 by [EMAIL PROTECTED] on 2008/01/09 23:26:14

        Fix the bug introduced by the bug fix of change 30755.
        (Certain regexps could SEGV if cloned).

Affected files ...

... //depot/perl/regcomp.c#646 edit
... //depot/perl/t/op/pat.t#303 edit

Differences ...

==== //depot/perl/regcomp.c#646 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#645~32880~   2008-01-06 12:33:48.000000000 -0800
+++ perl/regcomp.c      2008-01-09 15:26:14.000000000 -0800
@@ -9409,7 +9409,9 @@
        /* 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 @@
                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;
+           }
        }
     }
 

==== //depot/perl/t/op/pat.t#303 (xtext) ====
Index: perl/t/op/pat.t
--- perl/t/op/pat.t#302~32931~  2008-01-09 14:42:04.000000000 -0800
+++ perl/t/op/pat.t     2008-01-09 15:26:14.000000000 -0800
@@ -1297,10 +1297,7 @@
 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;
End of Patch.

Reply via email to