diff options
author | David Mitchell <davem@iabyn.com> | 2015-10-19 17:21:58 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-02-03 09:18:31 +0000 |
commit | 77189b8c243837b664cb444e867999e67e87ca44 (patch) | |
tree | 5aba360c9e0b0187c08706766d1cc72bfef434f1 /cop.h | |
parent | 33e0807aaf1fafae141d37e3b88af556c8b25c44 (diff) | |
download | perl-77189b8c243837b664cb444e867999e67e87ca44.tar.gz |
make POPSUBST re-entrant safe
Diffstat (limited to 'cop.h')
-rw-r--r-- | cop.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) |