summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorAlex Vandiver <alexmv@mit.edu>2009-03-07 02:44:40 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-03-07 23:39:11 +0100
commit1bbbfc5065f1f4b15e64694ca559c8dbefbb69d2 (patch)
tree1d4ce54d1f18a189ef8fd2330f216c4cc52fd6b1 /cop.h
parent96ccaf5388a125cc826380e910941c3b2f6310e1 (diff)
downloadperl-1bbbfc5065f1f4b15e64694ca559c8dbefbb69d2.tar.gz
Fix MULTICALL in List-Util
Add a new stack frame; the MULTICALL code in pp_return assumes there is a clean stack, and blindly changes the top-most stack value. This change brings cop.h more in line with the "poor-man's MULTICALL" provided in ext/List-Util/multicall.h, which also always pushes a new stack.
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cop.h b/cop.h
index 39a6b01484..0c85a4b876 100644
--- a/cop.h
+++ b/cop.h
@@ -883,6 +883,7 @@ See L<perlcall/Lightweight Callbacks>.
multicall_oldcatch = CATCH_GET; \
SAVETMPS; SAVEVPTR(PL_op); \
CATCH_SET(TRUE); \
+ PUSHSTACKi(PERLSI_SORT); \
PUSHBLOCK(cx, CXt_SUB|CXp_MULTICALL, PL_stack_sp); \
PUSHSUB(cx); \
if (++CvDEPTH(cv) >= 2) { \
@@ -906,8 +907,10 @@ See L<perlcall/Lightweight Callbacks>.
LEAVESUB(multicall_cv); \
CvDEPTH(multicall_cv)--; \
POPBLOCK(cx,PL_curpm); \
+ POPSTACK; \
CATCH_SET(multicall_oldcatch); \
LEAVE; \
+ SPAGAIN; \
} STMT_END
/*