diff options
author | David Mitchell <davem@iabyn.com> | 2015-05-24 16:42:29 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2015-06-19 08:44:17 +0100 |
commit | 716436dc7bfe93c174394b2d148df54b22c6f1fb (patch) | |
tree | 81d807adbab38ec54610cd92d996d7d35fbad0a7 | |
parent | 7aad4f31d6bf1692c7369006d44b89c69c857eef (diff) | |
download | perl-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.c | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -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); |