This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_return(): tail call pp_leaveeval()
authorDavid Mitchell <davem@iabyn.com>
Thu, 11 Jun 2015 09:30:48 +0000 (10:30 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 19 Jun 2015 07:44:18 +0000 (08:44 +0100)
commit9c750db661e034b562ff95d055827d815c3f4cc1
treef1185358fc87810c1aaf4f42049c803536a16d88
parent4496054ce9622fa4c6c6b737432d1f1056650d01
pp_return(): tail call pp_leaveeval()

When 'return'ing from an eval STRING, rather than handling it
ourselves, fall through to pp_leaveeval(). pp_return() is now only
responsible for popping any extra contexts and junk from the stack.

This helps avoid two different blocks of code doing roughly the same
thing.

The functional changes caused by this commit signify the divergence over
time between pp_leaveeval and the try-ish parts of pp_return. After this
commit, a return will:

    * now do an PERL_ASYNC_CHECK();
    * be smarter about not unnecessarily creating mortal copies
      of returned args;
    * restore PL_curpm *before* the LEAVE() rather than after.

The first two are probably good things; I'm not sure about the latter; it
may well be a regression, but nothing tests for it. At least it's
consistent now.
pp_ctl.c