diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-10-24 15:50:23 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-24 16:18:40 -0700 |
commit | 2acc3314e31a9342e325f35c5b592967c9850c9b (patch) | |
tree | 9fb193068226872c7947a20c114b641a422d2bb2 /pp.c | |
parent | e1be28b42dd83015ebd81dbeda258cc72f8dddf0 (diff) | |
download | perl-2acc3314e31a9342e325f35c5b592967c9850c9b.tar.gz |
[perl #77810] Scalars vs globs
Stop *{} from returning globs with the SVf_FAKE flag on.
It removes three tests from t/op/gv.t (that I added) that test buggy
edge cases that can no longer occur.
It also modifies tests in t/io/defout.t to keep them passing. I am not
sure that test script serves any purpose any more.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -213,11 +213,19 @@ PP(pp_rv2gv) } sv = MUTABLE_SV(gv_fetchsv(sv, GV_ADD, SVt_PVGV)); } + /* FAKE globs in the symbol table cause weird bugs (#77810) */ + if (sv) SvFAKE_off(sv); } } if (PL_op->op_private & OPpLVAL_INTRO) save_gp(MUTABLE_GV(sv), !(PL_op->op_flags & OPf_SPECIAL)); - SETs(sv); + if (sv && SvFAKE(sv)) { + SV *newsv = sv_newmortal(); + sv_setsv(newsv, sv); + SvFAKE_off(newsv); + SETs(newsv); + } + else SETs(sv); RETURN; } |