summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 0f4a69326e..c0c6fe888b 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1222,7 +1222,7 @@ PP(pp_match)
TARG = DEFSV;
EXTEND(SP,1);
}
- PL_reg_sv = TARG;
+ PL_reg_sv = SvREFCNT_inc(TARG);
PUTBACK; /* EVAL blocks need stack_sp. */
s = SvPV(TARG, len);
strend = s + len;
@@ -1909,7 +1909,7 @@ PP(pp_subst)
TARG = DEFSV;
EXTEND(SP,1);
}
- PL_reg_sv = TARG;
+ PL_reg_sv = SvREFCNT_inc(TARG);
do_utf8 = DO_UTF8(PL_reg_sv);
if (SvFAKE(TARG) && SvREADONLY(TARG))
sv_force_normal(TARG);