summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-12-25 22:03:10 +0000
committerDavid Mitchell <davem@iabyn.com>2016-02-03 09:19:17 +0000
commitd77cab044d85b109271a8fd3f99e99ac1392a029 (patch)
tree5bd72bd08c366316584b529f0ff43bc57cb8d774 /cop.h
parentd9203e036f608afd529c54a69f854a528171f784 (diff)
downloadperl-d77cab044d85b109271a8fd3f99e99ac1392a029.tar.gz
MULTICALL should clear scope after each call
RT #116577 Lexicals etc were only being freed at the end of the MULTICALL, not after each individual call to the sub.
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/cop.h b/cop.h
index 6ffd514cc9..54a5b1cb9b 100644
--- a/cop.h
+++ b/cop.h
@@ -1327,6 +1327,7 @@ See L<perlcall/LIGHTWEIGHT CALLBACKS>.
CV *multicall_cv; \
OP *multicall_cop; \
bool multicall_oldcatch; \
+ I32 saveix_floor; \
U8 hasargs = 0 /* used by PUSHSUB */
#define PUSH_MULTICALL(the_cv) \
@@ -1347,6 +1348,7 @@ See L<perlcall/LIGHTWEIGHT CALLBACKS>.
PUSHSUB(cx); \
cx->blk_oldsaveix = PL_savestack_ix; \
SAVEVPTR(PL_op); \
+ saveix_floor = PL_savestack_ix; \
if (!(flags & CXp_SUB_RE_FAKE)) \
CvDEPTH(cv)++; \
if (CvDEPTH(cv) >= 2) { \
@@ -1363,6 +1365,8 @@ See L<perlcall/LIGHTWEIGHT CALLBACKS>.
STMT_START { \
PL_op = multicall_cop; \
CALLRUNOPS(aTHX); \
+ cx = CX_CUR(); \
+ LEAVE_SCOPE(saveix_floor); \
} STMT_END
#define POP_MULTICALL \