Skip to content

Commit db4dba6

Browse files
authored
Move opnum_start for goto for clarification (php#11911)
opnum_start denotes the start of the ZEND_FREE block of skipped consuming opcodes. Storing the number before zend_compile_expr(..., label_ast) makes it seem like it denotes the start of the label block. However, label_ast must only be a zval string AST, and as such never results in an actual opcode.
1 parent cb927e0 commit db4dba6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5334,11 +5334,11 @@ static void zend_compile_goto(zend_ast *ast) /* {{{ */
53345334
zend_ast *label_ast = ast->child[0];
53355335
znode label_node;
53365336
zend_op *opline;
5337-
uint32_t opnum_start = get_next_op_number();
53385337

53395338
zend_compile_expr(&label_node, label_ast);
53405339

53415340
/* Label resolution and unwinding adjustments happen in pass two. */
5341+
uint32_t opnum_start = get_next_op_number();
53425342
zend_handle_loops_and_finally(NULL);
53435343
opline = zend_emit_op(NULL, ZEND_GOTO, NULL, &label_node);
53445344
opline->op1.num = get_next_op_number() - opnum_start - 1;

0 commit comments

Comments
 (0)