From: Gurusamy Sarathy Date: Mon, 11 Sep 2000 14:46:30 +0000 (+0000) Subject: C<@a = @b = split(...)> optimization coredumps under ithreads X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b3f5893fbbcce239e92f954ec9e230bdf28e6e79;p=p5sagit%2Fp5-mst-13.2.git C<@a = @b = split(...)> optimization coredumps under ithreads (missed a spot when fixing up op_pmreplroot hack for ithreads) p4raw-id: //depot/perl@7051 --- diff --git a/op.c b/op.c index c31bf15..74d67e3 100644 --- a/op.c +++ b/op.c @@ -3416,7 +3416,11 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right) } else if (curop->op_type == OP_PUSHRE) { if (((PMOP*)curop)->op_pmreplroot) { +#ifdef USE_ITHREADS + GV *gv = (GV*)PL_curpad[(PADOFFSET)((PMOP*)curop)->op_pmreplroot]; +#else GV *gv = (GV*)((PMOP*)curop)->op_pmreplroot; +#endif if (gv == PL_defgv || SvCUR(gv) == PL_generation) break; SvCUR(gv) = PL_generation; diff --git a/t/op/split.t b/t/op/split.t index 78f51f5..45df76a 100755 --- a/t/op/split.t +++ b/t/op/split.t @@ -1,8 +1,6 @@ #!./perl -# $RCSfile: split.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:26 $ - -print "1..27\n"; +print "1..28\n"; $FS = ':'; @@ -118,3 +116,9 @@ print "ok 26\n"; $_ = join ':', split /^/, "ab\ncd\nef\n"; print "not " if $_ ne "ab\n:cd\n:ef\n"; print "ok 27\n"; + +# see if @a = @b = split(...) optimization works +@list1 = @list2 = split ('p',"a p b c p"); +print "not " if @list1 != @list2 or "@list1" ne "@list2" + or @list1 != 2 or "@list1" ne "a b c "; +print "ok 28\n";