diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-11-20 09:33:44 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-20 18:15:16 -0800 |
commit | d8906c052fcf764bce3ec89556a62718884c9ac4 (patch) | |
tree | 1b7da28cf328da3f05d9e03417a14e5d8f64bf93 /pp.c | |
parent | 265d2e8e39f42f720939f85c9ddd11ac402bf79b (diff) | |
download | perl-d8906c052fcf764bce3ec89556a62718884c9ac4.tar.gz |
[perl #77926] Glob reification during localisation
This was supposed to have been fixed by 2acc3314e31a9, but the code it
added was in the wrong spot. (This is the code that makes *{} return a
new glob if its argument is FAKE.)
Consequently, local *$foo was localising $foo, not *$foo.
This changes the order of the statements and adds a test.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -218,15 +218,15 @@ PP(pp_rv2gv) if (sv) SvFAKE_off(sv); } } - if (PL_op->op_private & OPpLVAL_INTRO) - save_gp(MUTABLE_GV(sv), !(PL_op->op_flags & OPf_SPECIAL)); if (sv && SvFAKE(sv)) { SV *newsv = sv_newmortal(); sv_setsv_flags(newsv, sv, 0); SvFAKE_off(newsv); - SETs(newsv); + sv = newsv; } - else SETs(sv); + if (PL_op->op_private & OPpLVAL_INTRO) + save_gp(MUTABLE_GV(sv), !(PL_op->op_flags & OPf_SPECIAL)); + SETs(sv); RETURN; } |