From: Alex Vandiver Date: Sat, 7 Mar 2009 07:44:40 +0000 (-0500) Subject: Fix MULTICALL in List-Util X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1bbbfc50;p=p5sagit%2Fp5-mst-13.2.git 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. --- diff --git a/cop.h b/cop.h index 39a6b01..0c85a4b 100644 --- a/cop.h +++ b/cop.h @@ -883,6 +883,7 @@ See L. 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. LEAVESUB(multicall_cv); \ CvDEPTH(multicall_cv)--; \ POPBLOCK(cx,PL_curpm); \ + POPSTACK; \ CATCH_SET(multicall_oldcatch); \ LEAVE; \ + SPAGAIN; \ } STMT_END /*