diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-10-28 10:44:31 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-10-28 10:44:31 +0100 |
commit | 28c5b5bcd7f52e6b2219508a1066cd0ccc8dd19a (patch) | |
tree | 47b207d9b199dfb965aefa23fa423b49e213788b /op.c | |
parent | 02d85cc37a4acecafdc2f0b45640b03cd1f4ac71 (diff) | |
download | perl-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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: |