This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_leaveeval: reset stack in VOID context
$ perl -Dst -e'eval"1"'
Gives:
....
((eval 1):1) leaveeval
=> (FREED)
Change it so that like all the other pp_leavefoo() functions, it does
if (gimme == G_VOID)
PL_stack_sp = newsp;
I can't think of any (non-debugging) perl-level badness the old behaviour
can be shown to demonstrate, but best not to have freed values left
dangling.
This also allows pp_leaveeval() to (like the other pp_leavefoo functions)
avoid doing a dSP with the associated unnecessary PUTBACKs and SPAGAINs.
Finally, the code to detect a false require is moved to earlier in the
function where it's in the same place as the rest of the stack arg
processing code.