From 82e2055300b400c7e1bafed5f20f6e45ec439a2f Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Thu, 15 Jan 2026 17:45:26 +0100 Subject: [PATCH] Regenerate VM after merge Signed-off-by: Bob Weinand --- Zend/zend_vm_execute.h | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 0ec56ca6f93..2545ea7f872 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -59033,24 +59033,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_HANDLE_EXCEPTION_S && throw_op->extended_value & ZEND_FREE_ON_RETURN) { /* exceptions thrown because of loop var destruction on return/break/... * are logically thrown at the end of the foreach loop, so adjust the - * throw_op_num. + * throw_op_num to the final loop variable FREE. */ - const zend_live_range *range = find_live_range( - &EX(func)->op_array, throw_op_num, throw_op->op1.var); - /* free op1 of the corresponding RETURN */ - for (i = throw_op_num; i < range->end; i++) { - if (EX(func)->op_array.opcodes[i].opcode == ZEND_FREE - || EX(func)->op_array.opcodes[i].opcode == ZEND_FE_FREE) { - /* pass */ - } else { - if (EX(func)->op_array.opcodes[i].opcode == ZEND_RETURN - && (EX(func)->op_array.opcodes[i].op1_type & (IS_VAR|IS_TMP_VAR))) { - zval_ptr_dtor(EX_VAR(EX(func)->op_array.opcodes[i].op1.var)); - } - break; - } - } - throw_op_num = range->end; + uint32_t new_throw_op_num = throw_op_num + throw_op->op2.opline_num; + cleanup_live_vars(execute_data, throw_op_num, new_throw_op_num); + throw_op_num = new_throw_op_num; } /* Find the innermost try/catch/finally the exception was thrown in */