summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-05-24 16:42:29 +0100
committerDavid Mitchell <davem@iabyn.com>2015-06-19 08:44:17 +0100
commit716436dc7bfe93c174394b2d148df54b22c6f1fb (patch)
tree81d807adbab38ec54610cd92d996d7d35fbad0a7
parent7aad4f31d6bf1692c7369006d44b89c69c857eef (diff)
downloadperl-716436dc7bfe93c174394b2d148df54b22c6f1fb.tar.gz
S_return_lvalues(): consistent cxstack_ix--
After merging in the functionality from pp_leavesublv and pp_return into S_return_lvalues(), there were two context stack pointer decrement conventions: before or after the POPSUB(). Both are wrong in different ways, and will be more generally fixed up in later commits. For now, standardise on a single form: that used by pp_leavesub and pp_leavesublv.
-rw-r--r--pp_ctl.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index ad65703822..5bc7f6374a 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2323,8 +2323,8 @@ S_return_lvalues(pTHX_ SV **base)
what = "undef";
}
LEAVE;
- cxstack_ix--;
POPSUB(cx,sv);
+ cxstack_ix--;
PL_curpm = newpm;
LEAVESUB(sv);
Perl_croak(aTHX_
@@ -2385,8 +2385,8 @@ S_return_lvalues(pTHX_ SV **base)
/* Might be flattened array after $#array = */
PUTBACK;
LEAVE;
- cxstack_ix--;
POPSUB(cx,sv);
+ cxstack_ix--;
PL_curpm = newpm;
LEAVESUB(sv);
/* diag_listed_as: Can't return %s from lvalue subroutine */
@@ -2404,15 +2404,8 @@ S_return_lvalues(pTHX_ SV **base)
PL_stack_sp = newsp;
LEAVE;
- /* Stack values are safe: */
- if (base) {
- cxstack_ix--;
- POPSUB(cx,sv); /* release CV and @_ ... */
- }
- else {
- POPSUB(cx,sv); /* Stack values are safe: release CV and @_ ... */
- cxstack_ix--;
- }
+ POPSUB(cx,sv); /* Stack values are safe: release CV and @_ ... */
+ cxstack_ix--;
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVESUB(sv);