summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2006-05-20 11:58:07 +0000
committerDave Mitchell <davem@fdisolutions.com>2006-05-20 11:58:07 +0000
commite22ae1e278fa878ce0da6700e97da49f0dacf636 (patch)
tree4dd43a78d3f3555b2c2db1e6e0e3cbc41e080d5e /pp_ctl.c
parent7b0bddfae402018e486a2f1fa0daf4581b85b65b (diff)
downloadperl-e22ae1e278fa878ce0da6700e97da49f0dacf636.tar.gz
[perl #32332] Perl segfaults; test case available
sub f { s/$var/f()/e } could free the wrong RE p4raw-id: //depot/perl@28251
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 55ffb1933b..baed3fda58 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -197,7 +197,7 @@ PP(pp_substcont)
if(old != rx) {
if(old)
ReREFCNT_dec(old);
- PM_SETRE(pm,rx);
+ PM_SETRE(pm,ReREFCNT_inc(rx));
}
rxres_restore(&cx->sb_rxres, rx);
@@ -256,7 +256,6 @@ PP(pp_substcont)
SvTAINT(targ);
LEAVE_SCOPE(cx->sb_oldsave);
- ReREFCNT_dec(rx);
POPSUBST(cx);
RETURNOP(pm->op_next);
}