POPSUB() does:
LEAVE_SCOPE(PL_scopestack[cx->blk_oldscopesp - 1])
while pp_goto(), which manually does the relevant actions from POPSUB(),
does:
LEAVE_SCOPE(PL_scopestack[PL_scopestack_ix - 1])
For consistency, make pp_goto() use cx->blk_oldscopesp instead. In fact
at that point they should both hold the same value (and I've added an
assert to that effect), since we should have just popped any nested
scopes.
CvDEPTH(cx->blk_sub.cv) = cx->blk_sub.olddepth;
SvREFCNT_dec_NN(cx->blk_sub.cv);
}
- oldsave = PL_scopestack[PL_scopestack_ix - 1];
+ assert(PL_scopestack_ix == cx->blk_oldscopesp);
+ oldsave = PL_scopestack[cx->blk_oldscopesp - 1];
LEAVE_SCOPE(oldsave);
/* A destructor called during LEAVE_SCOPE could have undefined