diff options
author | Doug MacEachern <dougm@covalent.net> | 2001-08-03 11:17:41 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-08-04 14:08:19 +0000 |
commit | 9b978d731dbdb96e716e0b0959a0135ca6805247 (patch) | |
tree | aed45875cb072e5ad6c4f5716a4708674f9014db /regcomp.c | |
parent | 35061a7e2b3411cdebe03b5b73528a18647b44f9 (diff) | |
download | perl-9b978d731dbdb96e716e0b0959a0135ca6805247.tar.gz |
[patch] refcount re ops
Message-ID: <Pine.LNX.4.21.0108031814240.23972-100000@mako.covalent.net>
p4raw-id: //depot/perl@11568
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -2138,6 +2138,9 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp) ENTER; Perl_save_re_context(aTHX); rop = sv_compile_2op(sv, &sop, "re", &av); + sop->op_private |= OPpREFCOUNTED; + /* re_dup will OpREFCNT_inc */ + OpREFCNT_set(sop, 1); LEAVE; n = add_data(pRExC_state, 3, "nop"); @@ -4609,7 +4612,11 @@ Perl_pregfree(pTHX_ struct regexp *r) } else PL_curpad = NULL; - op_free((OP_4tree*)r->data->data[n]); + + if (!OpREFCNT_dec((OP_4tree*)r->data->data[n])) { + op_free((OP_4tree*)r->data->data[n]); + } + PL_comppad = old_comppad; PL_curpad = old_curpad; SvREFCNT_dec((SV*)new_comppad); |