This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
33e0807
)
make POPSUBST re-entrant safe
author
David Mitchell
<davem@iabyn.com>
Mon, 19 Oct 2015 16:21:58 +0000
(17:21 +0100)
committer
David Mitchell
<davem@iabyn.com>
Wed, 3 Feb 2016 09:18:31 +0000
(09:18 +0000)
cop.h
patch
|
blob
|
blame
|
history
diff --git
a/cop.h
b/cop.h
index
d95c799
..
4eefc4c
100644
(file)
--- a/
cop.h
+++ b/
cop.h
@@
-1026,9
+1026,14
@@
struct subst {
SvREFCNT_inc_void_NN(targ)
# define POPSUBST(cx) \
+ STMT_START { \
+ REGEXP *re; \
rxres_free(&cx->sb_rxres); \
- ReREFCNT_dec(cx->sb_rx); \
- SvREFCNT_dec_NN(cx->sb_targ)
+ re = cx->sb_rx; \
+ cx->sb_rx = NULL; \
+ ReREFCNT_dec(re); \
+ SvREFCNT_dec_NN(cx->sb_targ); \
+ } STMT_END
#endif
#define CxONCE(cx) ((cx)->cx_type & CXp_ONCE)