summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-10-19 23:13:07 +0100
committerDavid Mitchell <davem@iabyn.com>2010-10-19 23:29:25 +0100
commitf837477cd1460eda104bacd7f162d25d5254563d (patch)
treed22d9426662fc26e53a96c08a4166f1391d8b069 /cop.h
parent9c540340879062c71c21eaf596d6df60630d5bb2 (diff)
downloadperl-f837477cd1460eda104bacd7f162d25d5254563d.tar.gz
Recursive MULTICALL prematurely freed CV
See [perl #78070]. Basically, POPSUB/LEAVESUB had a mechanism to decrement the reference count of the CV only at CvDEPTH==1; POP_MULTICALL was decrementing it at all depths.
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/cop.h b/cop.h
index 4791c80071..8e77ae2946 100644
--- a/cop.h
+++ b/cop.h
@@ -928,8 +928,8 @@ See L<perlcall/Lightweight Callbacks>.
#define POP_MULTICALL \
STMT_START { \
- LEAVESUB(multicall_cv); \
- CvDEPTH(multicall_cv)--; \
+ if (! --CvDEPTH(multicall_cv)) \
+ LEAVESUB(multicall_cv); \
POPBLOCK(cx,PL_curpm); \
POPSTACK; \
CATCH_SET(multicall_oldcatch); \