From: Vincent Pit Date: Sun, 11 Jan 2009 18:19:28 +0000 (+0100) Subject: In su_unwind(), get the gimme before unwinding X-Git-Tag: v0.04~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=94447dd11718ac77b9608e0528c5d3d090e63aa1 In su_unwind(), get the gimme before unwinding The gimme value is here needed for reversing the stack sanitization that happens in pp_entersub. Hence we really need the gimme value for the topmost op. --- diff --git a/Upper.xs b/Upper.xs index aad6980..f89f1dc 100644 --- a/Upper.xs +++ b/Upper.xs @@ -529,6 +529,8 @@ STATIC void su_unwind(pTHX_ void *ud_) { I32 items = ud->items - 1; I32 gimme, mark; + gimme = GIMME_V; + if (cxstack_ix > cxix) dounwind(cxix); @@ -538,7 +540,6 @@ STATIC void su_unwind(pTHX_ void *ud_) { mark = PL_markstack[cxstack[cxix].blk_oldmarksp]; - gimme = GIMME_V; if (gimme == G_SCALAR) { *PL_markstack_ptr = PL_stack_sp - PL_stack_base; PL_stack_sp += items;