summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 6568ca1a17..fce942bd53 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -240,13 +240,21 @@ PP(pp_cond_expr)
PP(pp_unstack)
{
+ PERL_CONTEXT *cx;
PERL_ASYNC_CHECK();
TAINT_NOT; /* Each statement is presumed innocent */
- PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp;
+ cx = &cxstack[cxstack_ix];
+ PL_stack_sp = PL_stack_base + cx->blk_oldsp;
FREETMPS;
if (!(PL_op->op_flags & OPf_SPECIAL)) {
- I32 oldsave = PL_scopestack[PL_scopestack_ix - 1];
- LEAVE_SCOPE(oldsave);
+ assert(
+ CxTYPE(cx) == CXt_BLOCK
+ || CxTYPE(cx) == CXt_LOOP_FOR
+ || CxTYPE(cx) == CXt_LOOP_PLAIN
+ || CxTYPE(cx) == CXt_LOOP_LAZYSV
+ || CxTYPE(cx) == CXt_LOOP_LAZYIV
+ );
+ LEAVE_SCOPE(cx->cx_u.cx_blk.blku_old_savestack_ix);
}
return NORMAL;
}