This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
die_unwind(): mortalise, not mortalcopy the err SV
authorDavid Mitchell <davem@iabyn.com>
Thu, 30 Jun 2016 09:12:06 +0000 (10:12 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 1 Jul 2016 08:35:14 +0000 (09:35 +0100)
commit8c86f0238ecb5f32c2e7fba36e3edfdb54069068
tree3174d5aeb604bc4585057ec303dc370b5cb8cb11
parent2a1e0dfedad09204e5328c32f1fcf915153a191c
die_unwind(): mortalise, not mortalcopy the err SV

The error string needs to be preserved while unwinding the stacks,
but doing a simple sv_2mortal() and bumping the reference count seems
sufficient, rather than making a complete copy.

Also, avoid the mortalised SV's buffer from being stolen by using the
SV_NOSTEAL flag rather than unsetting SvTEMP.

Finally, add some basic comments above Perl_die_unwind() explaining what
it's for.
pp_ctl.c