From c23a79d1cf59344900edb2567bf7f6a0ae49aa18 Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Sun, 13 Jul 2025 17:07:23 +0300 Subject: [PATCH 1/2] refactor: clean zend_get_brk_cont_target arguments and sync var types --- Zend/zend_opcode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 6e7d31e15a40f..ec1bc319bbf1f 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -709,9 +709,9 @@ static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num } } -static uint32_t zend_get_brk_cont_target(const zend_op_array *op_array, const zend_op *opline) { - int nest_levels = opline->op2.num; - int array_offset = opline->op1.num; +static uint32_t zend_get_brk_cont_target(const zend_op *opline) { + uint32_t nest_levels = opline->op2.num; + uint32_t array_offset = opline->op1.num; zend_brk_cont_element *jmp_to; do { jmp_to = &CG(context).brk_cont_array[array_offset]; @@ -1120,7 +1120,7 @@ ZEND_API void pass_two(zend_op_array *op_array) case ZEND_BRK: case ZEND_CONT: { - uint32_t jmp_target = zend_get_brk_cont_target(op_array, opline); + uint32_t jmp_target = zend_get_brk_cont_target(opline); if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) { zend_check_finally_breakout(op_array, opline - op_array->opcodes, jmp_target); From d3ce9ec310dee5b9a5ce522d88325de77c6531ee Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Tue, 15 Jul 2025 14:04:30 +0300 Subject: [PATCH 2/2] revert types --- Zend/zend_opcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index ec1bc319bbf1f..01f6d924d28f6 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -710,8 +710,8 @@ static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num } static uint32_t zend_get_brk_cont_target(const zend_op *opline) { - uint32_t nest_levels = opline->op2.num; - uint32_t array_offset = opline->op1.num; + int nest_levels = opline->op2.num; + int array_offset = opline->op1.num; zend_brk_cont_element *jmp_to; do { jmp_to = &CG(context).brk_cont_array[array_offset];