This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
move multicall check to S_return_lvalues
authorDavid Mitchell <davem@iabyn.com>
Tue, 9 Jun 2015 09:51:15 +0000 (10:51 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 19 Jun 2015 07:44:17 +0000 (08:44 +0100)
Currently pp_leavesublv has a check at the top:

    if (CxMULTICALL(&cxstack[cxstack_ix]))
       return 0;

Move this instead into S_return_lvalues(), which pp_leavesublv immediately
calls. This has no effect on the pp_leavesublv code path, and also
has no effect on the pp_return code path, because although pp_return
calls S_return_lvalues, it doesn't in the case of MULTICALL, which it has
already checked for earlier.

So it shouldn't change anything functionally.

This will allow us to eliminate S_return_lvalues in the next commit.

pp_ctl.c

index 58dc717..326861c 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2296,6 +2296,9 @@ S_return_lvalues(pTHX)
     bool ref;
     const char *what = NULL;
 
+    if (CxMULTICALL(&cxstack[cxstack_ix]))
+       return 0;
+
     POPBLOCK(cx,newpm);
     cxstack_ix++; /* preserve cx entry on stack for use by POPSUB */
     TAINT_NOT;
@@ -2531,8 +2534,6 @@ PP(pp_return)
  * pp_return */
 PP(pp_leavesublv)
 {
-    if (CxMULTICALL(&cxstack[cxstack_ix]))
-       return 0;
     return S_return_lvalues(aTHX);