From 7e7e80e64b9a4d970e22e08faf2454a8c4937b68 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Fri, 22 Nov 2024 21:03:39 +0000 Subject: [PATCH] =?UTF-8?q?Re=C3=A4rrange=20code=20to=20avoid=20a=20goto?= =?UTF-8?q?=20past=20a=20variable=20initialisation,=20which=20upsets=20the?= =?UTF-8?q?=20g++=20compiler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pp_ctl.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pp_ctl.c b/pp_ctl.c index 0c5de05fc75b..bf2e288881a6 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1349,7 +1349,18 @@ PP(pp_anywhile) if(UNLIKELY(PL_stack_base + *PL_markstack_ptr > PL_stack_sp)) { /* Ran out of items */ result = (op_type == OP_ANYSTART) ? false : true; - goto leave_with_result; + +leave_with_result: + LEAVE_with_name("grep"); + (void)POPMARK; /* pop src */ + --*PL_markstack_ptr; + (void)POPMARK; /* pop dst */ + SV **base = PL_stack_base + POPMARK; /* pop original mark */ + + rpp_popfree_to_NN(base); + rpp_push_IMM(result ? &PL_sv_yes : &PL_sv_no); + + return NORMAL; } ENTER_with_name("grep_item"); @@ -1370,18 +1381,6 @@ PP(pp_anywhile) DEFSV_set(src); return cLOGOP->op_other; - -leave_with_result: - LEAVE_with_name("grep"); - (void)POPMARK; /* pop src */ - --*PL_markstack_ptr; - (void)POPMARK; /* pop dst */ - SV **base = PL_stack_base + POPMARK; /* pop original mark */ - - rpp_popfree_to_NN(base); - rpp_push_IMM(result ? &PL_sv_yes : &PL_sv_no); - - return NORMAL; } /* Range stuff. */