Skip to content

Commit

Permalink
Check exception before using undef_result_after_exception()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikic committed Sep 28, 2021
1 parent fe1633f commit 0391c55
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ext/opcache/jit/zend_jit_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,9 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
goto str_index;
case IS_UNDEF:
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
undef_result_after_exception();
if (EG(exception)) {
undef_result_after_exception();
}
return NULL;
}
/* break missing intentionally */
Expand Down Expand Up @@ -769,7 +771,9 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
goto str_index;
case IS_UNDEF:
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
undef_result_after_exception();
if (EG(exception)) {
undef_result_after_exception();
}
return NULL;
}
/* break missing intentionally */
Expand Down

0 comments on commit 0391c55

Please sign in to comment.