Skip to content

Commit 0391c55

Browse files
committed
Check exception before using undef_result_after_exception()
undefined_op_helper_write() can return 0 not just if an exception is thrown, so check this explicitly. This fixes an issue introduced in fe1633f.
1 parent fe1633f commit 0391c55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,9 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
684684
goto str_index;
685685
case IS_UNDEF:
686686
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
687-
undef_result_after_exception();
687+
if (EG(exception)) {
688+
undef_result_after_exception();
689+
}
688690
return NULL;
689691
}
690692
/* break missing intentionally */
@@ -769,7 +771,9 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
769771
goto str_index;
770772
case IS_UNDEF:
771773
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
772-
undef_result_after_exception();
774+
if (EG(exception)) {
775+
undef_result_after_exception();
776+
}
773777
return NULL;
774778
}
775779
/* break missing intentionally */

0 commit comments

Comments
 (0)