summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2011-06-25 14:28:12 +0200
committerVincent Pit <perl@profvince.com>2011-06-26 00:07:29 +0200
commitf02ea43cac371ecb59188f9654a0d99fd54db862 (patch)
treeb54079d020f546fb03c7c680e490d848a36637c2 /pp_ctl.c
parent2b9a64577b41d2e4715e02f855894f80e1e293e8 (diff)
downloadperl-f02ea43cac371ecb59188f9654a0d99fd54db862.tar.gz
Convert pp_leave() to adjust_stack_on_leave()
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index f20c196d9a..32573f3303 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2126,32 +2126,7 @@ PP(pp_leave)
gimme = OP_GIMME(PL_op, (cxstack_ix >= 0) ? gimme : G_SCALAR);
TAINT_NOT;
- if (gimme == G_VOID)
- SP = newsp;
- else if (gimme == G_SCALAR) {
- register SV **mark;
- MARK = newsp + 1;
- if (MARK <= SP) {
- if (SvFLAGS(TOPs) & (SVs_PADTMP|SVs_TEMP))
- *MARK = TOPs;
- else
- *MARK = sv_mortalcopy(TOPs);
- } else {
- MEXTEND(mark,0);
- *MARK = &PL_sv_undef;
- }
- SP = MARK;
- }
- else if (gimme == G_ARRAY) {
- /* in case LEAVE wipes old return values */
- register SV **mark;
- for (mark = newsp + 1; mark <= SP; mark++) {
- if (!(SvFLAGS(*mark) & (SVs_PADTMP|SVs_TEMP))) {
- *mark = sv_mortalcopy(*mark);
- TAINT_NOT; /* Each item is independent */
- }
- }
- }
+ SP = adjust_stack_on_leave(newsp, SP, newsp, gimme, SVs_PADTMP|SVs_TEMP);
PL_curpm = newpm; /* Don't pop $1 et al till now */
LEAVE_with_name("block");