Test that we can clone regexps into new threads, and fix the bug in
authorNicholas Clark <nick@ccl4.org>
Thu, 27 Dec 2007 20:33:55 +0000 (20:33 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 27 Dec 2007 20:33:55 +0000 (20:33 +0000)
change 32740 that this reveals. (Bug spotted by, and initial patch
from, Jerry D. Hedden.)

p4raw-id: //depot/perl@32745

sv.c
t/op/threads.t

diff --git a/sv.c b/sv.c
index 7b05674..585685e 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10121,6 +10121,7 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param)
            case SVt_PVAV:
            case SVt_PVCV:
            case SVt_PVLV:
+           case SVt_ORANGE:
            case SVt_PVMG:
            case SVt_PVNV:
            case SVt_PVIV:
@@ -10175,6 +10176,8 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param)
                break;
            case SVt_PVMG:
                break;
+           case SVt_ORANGE:
+               break;
            case SVt_PVLV:
                /* XXX LvTARGOFF sometimes holds PMOP* when DEBUGGING */
                if (LvTYPE(dstr) == 't') /* for tie: unrefcnted fake (SV**) */
index 8907d80..4679929 100644 (file)
@@ -16,7 +16,7 @@ BEGIN {
        exit 0;
      }
 
-     plan(10);
+     plan(12);
 }
 
 use strict;
@@ -159,4 +159,14 @@ EOI
     ok(1, '[perl #45053]');
 }
 
+sub matchit {
+    is (ref $_[1], "Regexp");
+    like ($_[0], $_[1]);
+}
+
+threads->new(\&matchit, "Pie", qr/pie/i)->join();
+
+# tests in threads don't get counted, so
+curr_test(curr_test() + 2);
+
 # EOF