summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgs@consttype.org>2009-10-28 10:44:31 +0100
committerRafael Garcia-Suarez <rgs@consttype.org>2009-10-28 10:44:31 +0100
commit28c5b5bcd7f52e6b2219508a1066cd0ccc8dd19a (patch)
tree47b207d9b199dfb965aefa23fa423b49e213788b /op.c
parent02d85cc37a4acecafdc2f0b45640b03cd1f4ac71 (diff)
downloadperl-28c5b5bcd7f52e6b2219508a1066cd0ccc8dd19a.tar.gz
$#array should be accepted as a lvalue sub return value.
The OPpMAYBE_LVSUB flag wasn't set for OP_AV2ARYLEN, but the new implementation of pp_av2arylen introduced by the previous patch was relying on it. So, now, set this flag. Also add tests for STORESIZE.
Diffstat (limited to 'op.c')
-rw-r--r--op.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/op.c b/op.c
index 87413375e4..d7a523473b 100644
--- a/op.c
+++ b/op.c
@@ -1540,12 +1540,17 @@ Perl_mod(pTHX_ OP *o, I32 type)
case OP_DBSTATE:
PL_modcount = RETURN_UNLIMITED_NUMBER;
break;
+ case OP_AV2ARYLEN:
+ PL_hints |= HINT_BLOCK_SCOPE;
+ if (type == OP_LEAVESUBLV)
+ o->op_private |= OPpMAYBE_LVSUB;
+ PL_modcount++;
+ break;
case OP_RV2SV:
ref(cUNOPo->op_first, o->op_type);
localize = 1;
/* FALL THROUGH */
case OP_GV:
- case OP_AV2ARYLEN:
PL_hints |= HINT_BLOCK_SCOPE;
case OP_SASSIGN:
case OP_ANDASSIGN: