diff options
author | David Mitchell <davem@iabyn.com> | 2011-09-06 12:16:23 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-09-06 12:21:21 +0100 |
commit | 87e4a53a894984d98bc11df391f89db73212de5e (patch) | |
tree | 9e5b6b48af12325ae3c37f035c35f24438d8c2a0 /pp_ctl.c | |
parent | f5f19483eb9a5629cd2db0902731ca0b471e0adc (diff) | |
download | perl-87e4a53a894984d98bc11df391f89db73212de5e.tar.gz |
RT #4682: given() didn't scope $_ correctly
given(expr) {...} behaves similarly to { my $_ = expr; ...},
except that, prior to this commit, it wasn't doing the SAVECLEARSV()
that pp_padsv would do. This meant that $_ was still marked as stale
while in scope, and wasn't getting cleared at the end of scope.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -4367,6 +4367,7 @@ PP(pp_entergiven) ENTER_with_name("given"); SAVETMPS; + SAVECLEARSV(PAD_SVl(PL_op->op_targ)); sv_setsv_mg(PAD_SV(PL_op->op_targ), POPs); PUSHBLOCK(cx, CXt_GIVEN, SP); |