summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-10-02 12:44:19 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-10-02 14:40:21 -0700
commitc997e36218768fb357b1f3d160131f259311e3a3 (patch)
tree75b702930bf19281553b8ddac1eaea9268cdc054 /pp_ctl.c
parentfda8e777fa2df245de209839b8b21252b2f12c47 (diff)
downloadperl-c997e36218768fb357b1f3d160131f259311e3a3.tar.gz
Make list assignment respect foreach aliasing
See ff2a62e0c8 for the explanation. The bug fix in that commit did not apply to foreach’s aliasing. In short, ($a,$b)=($c,$d) needs to account for whether two of those variable names could be referring to the same variable. This commit causes the test suite to exercise a code path in scope.c added by ff2a62e0c8, which turned out to be buggy. (I forgot to test it at the time.)
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index d72ec1c2f4..3d02f3a96a 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2118,6 +2118,7 @@ PP(pp_enteriter)
save_pushptrptr(gv, SvREFCNT_inc(*svp), SAVEt_GVSV);
*svp = newSV(0);
itervar = (void *)gv;
+ save_aliased_sv(gv);
}
if (PL_op->op_private & OPpITER_DEF)