This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
call_sv(), fold_const(): different CX pop test
authorDavid Mitchell <davem@iabyn.com>
Fri, 17 Jul 2015 13:44:32 +0000 (14:44 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:37 +0000 (08:59 +0000)
commit8e90e786101d3edc1f7b5ad4b735860d4667dcd4
treeae3b2deeed0b2520048ff688e330349a3fca3abf
parent9aa350eb0f0c75e5d5ac3fbccd708064f23d6795
call_sv(), fold_const(): different CX pop test

Perl_call_sv() and S_fold_constants() both have similar code that:
pushes an EVAL context, does a JMPENV_PUSH() and CALLRUNOPS(), then
optionally pops the EVAL context.

The optionally part depends on whether what's doing the dying
has already popped the context before long-jumping. Currently the decision
on whether to pop is based on whether the scope stack has already been
popped.

This commit changes that to whether the context stack has already been
popped, since shortly we're going to change eval contexts so that the old
savestack_ix is stored in the CX struct rather than on the scope stack.

I ran this code with some asserts that the two conditions were identical,
and nothing failed.
op.c
perl.c