summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-03-14 17:01:34 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-03-14 17:01:34 +0000
commitaf5acbb47cec8f9dd3c4a2594507c21a7f1ce63b (patch)
treee4cac932e91c1a4047ab665bccda4e8828f3d825 /op.c
parentdfd914092bc0efff7a5ad67a7b5cadfabbc009a6 (diff)
downloadperl-af5acbb47cec8f9dd3c4a2594507c21a7f1ce63b.tar.gz
[perl #27628] strict 'subs' didn't warn on bareword array index
p4raw-id: //depot/perl@22499
Diffstat (limited to 'op.c')
-rw-r--r--op.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/op.c b/op.c
index b695a63553..d9dcd420b7 100644
--- a/op.c
+++ b/op.c
@@ -6405,7 +6405,7 @@ Perl_peep(pTHX_ register OP *o)
o->op_next : o->op_next->op_next;
IV i;
if (pop && pop->op_type == OP_CONST &&
- (PL_op = pop->op_next) &&
+ ((PL_op = pop->op_next)) &&
pop->op_next->op_type == OP_AELEM &&
!(pop->op_next->op_private &
(OPpLVAL_INTRO|OPpLVAL_DEFER|OPpDEREF|OPpMAYBE_LVSUB)) &&
@@ -6414,6 +6414,8 @@ Perl_peep(pTHX_ register OP *o)
i >= 0)
{
GV *gv;
+ if (cSVOPx(pop)->op_private & OPpCONST_STRICT)
+ no_bareword_allowed(pop);
if (o->op_type == OP_GV)
op_null(o->op_next);
op_null(pop->op_next);