This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
cx_popeval(): don't mortalise blk_eval.old_namesv
authorDavid Mitchell <davem@iabyn.com>
Wed, 29 Jun 2016 08:16:51 +0000 (09:16 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 1 Jul 2016 08:35:14 +0000 (09:35 +0100)
commit2a1e0dfedad09204e5328c32f1fcf915153a191c
treef58a6439b2bd9f3c0382a792699666a9e521cae2
parent06a7bc17ca999c04cd2c36ca6162417b9bc32959
cx_popeval(): don't mortalise blk_eval.old_namesv

Currently whenever we pop an eval context used for a require, rather than
freeing the SV holding the name of the require, we just mortalise it,
since some callers of cx_popeval() need the SV to remain long enough to
use it to "undo" %INC and to croak with a message such as ""$name did not
return a true value".

Now that all those usages have been gathered into one place
(S_pop_eval_context_maybe_croak), make that function responsible for
mortalising when there's a require error, and make the general-case case
of cx_popeval() just decrement the reference count.
inline.h
pp_ctl.c