diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-10-23 20:21:04 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-10-23 20:21:04 -0700 |
commit | 2ec7f6f24289a5b511edf35181d0178b1e94b0f3 (patch) | |
tree | 432c4b46efdac9dd1f93ae3da73041d503df79f6 /symbian | |
parent | 4c3ed7418bcf4eae5235fb7bcae842820725bea8 (diff) | |
download | perl-2ec7f6f24289a5b511edf35181d0178b1e94b0f3.tar.gz |
[perl #119797] Fix if/else in lvalue sub
When if/else/unless is the last thing in an lvalue sub, the lvalue
context is not always propagated properly and scope exit tries to
copy things, including arrays, resulting in ‘Bizarre copy of ARRAY’.
This commit fixes the bizarre copy by flagging any leave op that is
part of an lvalue sub’s return sequence, using the OPpLEAVE flag added
for this purpose in the previous commit. Then pp_leave uses that flag
to avoid copying return values, but protects them via the mortals
stack just like pp_leavesublv (actually pp_ctl.c:S_return_lvalues).
For ‘if’ and ‘unless’ without ‘else’, the lvalue context was not being
propagated, resulting in arrays’ getting flattened despite the lvalue
context. op_lvalue_flags in op.c needed to handle AND and OR ops,
which ‘if’ and ‘unless’ compile to, to make this work.
Diffstat (limited to 'symbian')
0 files changed, 0 insertions, 0 deletions