summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-08 18:14:03 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-08 23:13:36 -0800
commit55b5114f4ff694ab871173b736aa2d48bb095684 (patch)
tree8258cd178c80da1a45ea12f0e511f1668822e798 /pp_ctl.c
parentbbff98dc509eb269f4500b2698d1ab918152f9d2 (diff)
downloadperl-55b5114f4ff694ab871173b736aa2d48bb095684.tar.gz
[perl #92254, #92256] Fix SAVE_DEFSV to do refcounting
The current definition of SAVE_DEFSV doesn’t take reference count- ing into account. Every instance of it in the perl core is buggy as a result. Most are also followed by DEFSV_set, which is likewise buggy. This commit implements SAVE_DEFSV in terms of save_gp and SAVEGENERICSV if PERL_CORE is defined. save_gp and SAVEGENERICSV are what local(*_) = \$foo uses. Changing the definition for XS code is probably too risky this close to 5.16. It should probably be changed later, though. DEFSV_set is now changed to do reference counting too.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 8ee4d793b0..ce349bd2fe 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -5477,14 +5477,11 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
int count;
ENTER_with_name("call_filter_sub");
- save_gp(PL_defgv, 0);
- GvINTRO_off(PL_defgv);
- SAVEGENERICSV(GvSV(PL_defgv));
+ SAVE_DEFSV;
SAVETMPS;
EXTEND(SP, 2);
DEFSV_set(upstream);
- SvREFCNT_inc_simple_void_NN(upstream);
PUSHMARK(SP);
mPUSHi(0);
if (filter_state) {