diff options
author | Zefram <zefram@fysh.org> | 2017-12-05 21:24:19 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-12-05 21:24:19 +0000 |
commit | 16ea2c1905a8b12a3ddd72561c74de0063cbcc40 (patch) | |
tree | 25c1924d4d36685e57b580211a3cfb711c390a26 /pp_ctl.c | |
parent | 40b0df696c4f45c9e0e43ec2121b53bc06a586db (diff) | |
download | perl-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.c | 27 |
1 files changed, 1 insertions, 26 deletions
@@ -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; } } |