summaryrefslogtreecommitdiff
path: root/cop.h
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 /cop.h
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 'cop.h')
-rw-r--r--cop.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/cop.h b/cop.h
index 749b128870..b1273ac2ff 100644
--- a/cop.h
+++ b/cop.h
@@ -576,10 +576,12 @@ struct subst {
cx->sb_rxres = NULL, \
cx->sb_rx = rx, \
cx->cx_type = CXt_SUBST; \
- rxres_save(&cx->sb_rxres, rx)
+ rxres_save(&cx->sb_rxres, rx); \
+ ReREFCNT_inc(rx)
#define POPSUBST(cx) cx = &cxstack[cxstack_ix--]; \
- rxres_free(&cx->sb_rxres)
+ rxres_free(&cx->sb_rxres); \
+ ReREFCNT_dec(cx->sb_rx)
struct context {
U32 cx_type; /* what kind of context this is */