This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_goto: SvREFCNT_dec(oldcv) *after* undef test
authorDavid Mitchell <davem@iabyn.com>
Thu, 25 Jun 2015 15:08:02 +0000 (16:08 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:33 +0000 (08:59 +0000)
commitcd17cc2e752d3e7e4d2cbdac9869cc7de3e9b075
treeab1009eba75e9bb58a85166a2d5f50ddf8ec7777
parent88c11d84310c49339e73fcab80dad89a73d74263
pp_goto: SvREFCNT_dec(oldcv) *after* undef test

pp_goto does a LEAVE, then checks that the new CV hasn't been undefed
by the LEAVE. If it has, it croaks.

Move the decrementing of the old CV's ref count and depth to *after*
this check, since the POPSUB done during the croak unwind will do the
decrement also. Otherwise the old sub will be doubly freed.
pp_ctl.c
t/op/goto.t