From: Jarkko Hietaniemi Date: Wed, 20 Feb 2002 15:24:19 +0000 (+0000) Subject: Integrate change #14778 from maintperl; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c13f253ac9074f84de2b3cc44ede54179a3ffbf0;p=p5sagit%2Fp5-mst-13.2.git Integrate change #14778 from maintperl; constant folding on the range operator had the effect of disabling peephole optimizations in all the siblings of the range OP; the effect of this was that barewords could escape strictures when they were hiding in such places p4raw-link: @14778 on //depot/maint-5.6/perl: 0ef6625236721d79a74c662bb0d14b11d0d775c2 p4raw-id: //depot/perl@14791 p4raw-integrated: from //depot/maint-5.6/perl@14790 'merge in' op.c (@14439..) --- diff --git a/op.c b/op.c index 759b8d7..e39850e 100644 --- a/op.c +++ b/op.c @@ -2522,6 +2522,7 @@ Perl_gen_constant_list(pTHX_ register OP *o) o->op_type = OP_RV2AV; o->op_ppaddr = PL_ppaddr[OP_RV2AV]; + o->op_seq = 0; /* needs to be revisited in peep() */ curop = ((UNOP*)o)->op_first; ((UNOP*)o)->op_first = newSVOP(OP_CONST, 0, SvREFCNT_inc(*PL_stack_sp--)); op_free(curop); diff --git a/t/lib/strict/subs b/t/lib/strict/subs index 1e8b058..88d4afc 100644 --- a/t/lib/strict/subs +++ b/t/lib/strict/subs @@ -26,6 +26,15 @@ EXPECT # strict subs - error use strict 'subs' ; +my @a = (1..2); +my $b = xyz; +EXPECT +Bareword "xyz" not allowed while "strict subs" in use at - line 5. +Execution of - aborted due to compilation errors. +######## + +# strict subs - error +use strict 'subs' ; Fred ; EXPECT Bareword "Fred" not allowed while "strict subs" in use at - line 4.