summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-02-11 05:00:55 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-02-11 05:00:55 +0000
commit0214ae4041a6e53bb2f19e015bac063436f2df70 (patch)
tree5bf848ff3cd2efe77d3a9cddf52caa86f74375ba /pp_ctl.c
parent5a929a98cca1fca196d5fd6d9350568e529e8825 (diff)
downloadperl-0214ae4041a6e53bb2f19e015bac063436f2df70.tar.gz
compatibility fix: magic non-propagation in foreach implicit localization
p4raw-id: //depot/perl@2854
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 230d94128a..e0b65e36e9 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1640,8 +1640,12 @@ PP(pp_enteriter)
SAVETMPS;
#ifdef USE_THREADS
- if (PL_op->op_flags & OPf_SPECIAL)
- svp = save_threadsv(PL_op->op_targ); /* per-thread variable */
+ if (PL_op->op_flags & OPf_SPECIAL) {
+ dTHR;
+ svp = &THREADSV(PL_op->op_targ); /* per-thread variable */
+ SAVEGENERICSV(*svp);
+ *svp = NEWSV(0,0);
+ }
else
#endif /* USE_THREADS */
if (PL_op->op_targ) {
@@ -1649,9 +1653,9 @@ PP(pp_enteriter)
SAVESPTR(*svp);
}
else {
- GV *gv = (GV*)POPs;
- (void)save_scalar(gv);
- svp = &GvSV(gv); /* symbol table variable */
+ svp = &GvSV((GV*)POPs); /* symbol table variable */
+ SAVEGENERICSV(*svp);
+ *svp = NEWSV(0,0);
}
ENTER;