Change 14778 by gsar@rake on 2002/02/20 04:17:22

        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

Affected files ...

.... //depot/maint-5.6/perl/op.c#56 edit
.... //depot/maint-5.6/perl/t/pragma/strict-subs#2 edit

Differences ...

==== //depot/maint-5.6/perl/op.c#56 (text) ====
Index: perl/op.c
--- perl/op.c.~1~       Tue Feb 19 21:30:05 2002
+++ perl/op.c   Tue Feb 19 21:30:05 2002
@@ -2352,6 +2352,7 @@
 
     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);

==== //depot/maint-5.6/perl/t/pragma/strict-subs#2 (text) ====
Index: perl/t/pragma/strict-subs
--- perl/t/pragma/strict-subs.~1~       Tue Feb 19 21:30:05 2002
+++ perl/t/pragma/strict-subs   Tue Feb 19 21:30:05 2002
@@ -51,6 +51,15 @@
 ########
 
 # 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 ;
 Fred ;
 EXPECT
End of Patch.

Reply via email to