summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-05 21:24:19 +0000
committerZefram <zefram@fysh.org>2017-12-05 21:24:19 +0000
commit16ea2c1905a8b12a3ddd72561c74de0063cbcc40 (patch)
tree25c1924d4d36685e57b580211a3cfb711c390a26 /pp_ctl.c
parent40b0df696c4f45c9e0e43ec2121b53bc06a586db (diff)
downloadperl-16ea2c1905a8b12a3ddd72561c74de0063cbcc40.tar.gz
merge leavegiven op type into leaveloop
The leaveloop op type can already do the whole job, with leavegiven being a near duplicate of it. Replace all uses of leavegiven with leaveloop.
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 3239d37de8..aa8f2cfdb9 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4571,31 +4571,6 @@ PP(pp_entergiven)
RETURN;
}
-PP(pp_leavegiven)
-{
- PERL_CONTEXT *cx;
- U8 gimme;
- SV **oldsp;
- PERL_UNUSED_CONTEXT;
-
- cx = CX_CUR();
- assert(CxTYPE(cx) == CXt_LOOP_GIVEN);
- oldsp = PL_stack_base + cx->blk_oldsp;
- gimme = cx->blk_gimme;
-
- if (gimme == G_VOID)
- PL_stack_sp = oldsp;
- else
- leave_adjust_stacks(oldsp, oldsp, gimme, 1);
-
- CX_LEAVE_SCOPE(cx);
- cx_poploop(cx);
- cx_popblock(cx);
- CX_POP(cx);
-
- return NORMAL;
-}
-
PP(pp_smartmatch)
{
dSP;
@@ -4676,7 +4651,7 @@ PP(pp_leavewhen)
}
else {
PERL_ASYNC_CHECK();
- assert(cx->blk_loop.my_op->op_nextop->op_type == OP_LEAVEGIVEN);
+ assert(cx->blk_loop.my_op->op_nextop->op_type == OP_LEAVELOOP);
return cx->blk_loop.my_op->op_nextop;
}
}