This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_return: simplify arg handling code
authorDavid Mitchell <davem@iabyn.com>
Mon, 8 Jun 2015 17:46:50 +0000 (18:46 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 19 Jun 2015 07:44:17 +0000 (08:44 +0100)
commit988f25b6b104e36f72d842293f189b1317528547
treeb211ca6644588302fa712f668403a5c94afac2b6
parent334112121fd381e21666f72ab06d79ef94f3f6a6
pp_return: simplify arg handling code

pp_return() only needs to do the extra arg handling associated
with the args not being at the base of the stack frame. For example

    for (1,2) { return 3,4 }

has to cope with 1,2,3,4 being on the stack.
Apart from handling junk, everything else  - in particular pushing
&PL_sv_undef in scalar context if there are no return args - is already
done by Perl_pp_leavesub, which pp_return tail calls.

So reduce what pp_return does to the bare minimum. This makes one less
conditional branch in a few cases.
pp_ctl.c