summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-06-09 10:59:52 +0100
committerDavid Mitchell <davem@iabyn.com>2015-06-19 08:44:18 +0100
commit31ccb4f524a46aa0f0d2009d0dab57added88402 (patch)
treeaf9e6d189f3f5091f44abeae013167e65e8f8f6c /pp_ctl.c
parent85ecf1471c158cb93666daeb06af5b417d8e0c6e (diff)
downloadperl-31ccb4f524a46aa0f0d2009d0dab57added88402.tar.gz
eliminate S_return_lvalues()
After the previous commit, pp_leavesublv was just an empty wrapper around S_return_lvalues() (which is also called from pp_return). So just rename S_return_lvalues to pp_leavesublv, and make pp_return call pp_leavesublv directly.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 326861c331..756c076d8f 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2279,12 +2279,16 @@ PP(pp_leaveloop)
return NORMAL;
}
-/* handle most of the activity of returning from an lvalue sub.
- * Called by pp_leavesublv and pp_return.
+
+/* This duplicates most of pp_leavesub, but with additional code to handle
+ * return args in lvalue context. It was forked from pp_leavesub to
+ * avoid slowing down that function any further.
+ *
+ * Any changes made to this function may need to be copied to pp_leavesub
+ * and vice-versa.
*/
-STATIC OP*
-S_return_lvalues(pTHX)
+PP(pp_leavesublv)
{
dSP;
SV **newsp;
@@ -2477,7 +2481,7 @@ PP(pp_return)
}
/* fall through to a normal sub exit */
return CvLVALUE(cx->blk_sub.cv)
- ? S_return_lvalues(aTHX)
+ ? Perl_pp_leavesublv(aTHX)
: Perl_pp_leavesub(aTHX);
}
@@ -2530,14 +2534,6 @@ PP(pp_return)
return retop;
}
-/* This duplicates parts of pp_leavesub, so that it can share code with
- * pp_return */
-PP(pp_leavesublv)
-{
- return S_return_lvalues(aTHX);
-
-
-}
static I32
S_unwind_loop(pTHX_ const char * const opname)