diff options
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -271,6 +271,7 @@ Perl_op_free(pTHX_ OP *o) { register OP *kid, *nextkid; OPCODE type; + PADOFFSET refcnt; if (!o || o->op_static) return; @@ -284,11 +285,10 @@ Perl_op_free(pTHX_ OP *o) case OP_SCOPE: case OP_LEAVEWRITE: OP_REFCNT_LOCK; - if (OpREFCNT_dec(o)) { - OP_REFCNT_UNLOCK; - return; - } + refcnt = OpREFCNT_dec(o); OP_REFCNT_UNLOCK; + if (refcnt) + return; break; default: break; @@ -474,6 +474,18 @@ Perl_op_null(pTHX_ OP *o) o->op_ppaddr = PL_ppaddr[OP_NULL]; } +void +Perl_op_refcnt_lock(pTHX) +{ + OP_REFCNT_LOCK; +} + +void +Perl_op_refcnt_unlock(pTHX) +{ + OP_REFCNT_UNLOCK; +} + /* Contextualizers */ #define LINKLIST(o) ((o)->op_next ? (o)->op_next : linklist((OP*)o)) |