Move opnum_start for goto for clarification (#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.
This commit is contained in:
Ilija Tovilo 2023-08-09 11:38:54 +02:00 committed by GitHub
parent cb927e0fc0
commit db4dba6702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5334,11 +5334,11 @@ static void zend_compile_goto(zend_ast *ast) /* {{{ */
zend_ast *label_ast = ast->child[0];
znode label_node;
zend_op *opline;
uint32_t opnum_start = get_next_op_number();
zend_compile_expr(&label_node, label_ast);
/* Label resolution and unwinding adjustments happen in pass two. */
uint32_t opnum_start = get_next_op_number();
zend_handle_loops_and_finally(NULL);
opline = zend_emit_op(NULL, ZEND_GOTO, NULL, &label_node);
opline->op1.num = get_next_op_number() - opnum_start - 1;