Skip to content

Commit aab8f46

Browse files
committed
Reärrange code to avoid a goto past a variable initialisation, which upsets the g++ compiler
1 parent cb50cab commit aab8f46

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

pp_ctl.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,18 @@ PP(pp_anywhile)
13491349
if(UNLIKELY(PL_stack_base + *PL_markstack_ptr > PL_stack_sp)) {
13501350
/* Ran out of items */
13511351
result = (op_type == OP_ANYSTART) ? false : true;
1352-
goto leave_with_result;
1352+
1353+
leave_with_result:
1354+
LEAVE_with_name("grep");
1355+
(void)POPMARK; /* pop src */
1356+
--*PL_markstack_ptr;
1357+
(void)POPMARK; /* pop dst */
1358+
SV **base = PL_stack_base + POPMARK; /* pop original mark */
1359+
1360+
rpp_popfree_to_NN(base);
1361+
rpp_push_IMM(result ? &PL_sv_yes : &PL_sv_no);
1362+
1363+
return NORMAL;
13531364
}
13541365

13551366
ENTER_with_name("grep_item");
@@ -1370,18 +1381,6 @@ PP(pp_anywhile)
13701381
DEFSV_set(src);
13711382

13721383
return cLOGOP->op_other;
1373-
1374-
leave_with_result:
1375-
LEAVE_with_name("grep");
1376-
(void)POPMARK; /* pop src */
1377-
--*PL_markstack_ptr;
1378-
(void)POPMARK; /* pop dst */
1379-
SV **base = PL_stack_base + POPMARK; /* pop original mark */
1380-
1381-
rpp_popfree_to_NN(base);
1382-
rpp_push_IMM(result ? &PL_sv_yes : &PL_sv_no);
1383-
1384-
return NORMAL;
13851384
}
13861385

13871386
/* Range stuff. */

0 commit comments

Comments
 (0)