diff options
author | Alex Vandiver <alexmv@mit.edu> | 2009-03-07 02:44:40 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-03-07 23:39:11 +0100 |
commit | 1bbbfc5065f1f4b15e64694ca559c8dbefbb69d2 (patch) | |
tree | 1d4ce54d1f18a189ef8fd2330f216c4cc52fd6b1 /cop.h | |
parent | 96ccaf5388a125cc826380e910941c3b2f6310e1 (diff) | |
download | perl-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.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 /* |