From: Nicholas Clark Date: Thu, 27 Dec 2007 20:33:55 +0000 (+0000) Subject: Test that we can clone regexps into new threads, and fix the bug in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f708cfc10f5ba0c4e1efa412ff01f165ea63f555;p=p5sagit%2Fp5-mst-13.2.git Test that we can clone regexps into new threads, and fix the bug in change 32740 that this reveals. (Bug spotted by, and initial patch from, Jerry D. Hedden.) p4raw-id: //depot/perl@32745 --- diff --git a/sv.c b/sv.c index 7b05674..585685e 100644 --- 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**) */ diff --git a/t/op/threads.t b/t/op/threads.t index 8907d80..4679929 100644 --- a/t/op/threads.t +++ b/t/op/threads.t @@ -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