Skip to content

Commit 1187032

Browse files
committed
Fix JIT to check for exceptions
1 parent bd37701 commit 1187032

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3883,6 +3883,8 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, uint32_t op
38833883
| // zend_error(E_WARNING, "Undefined variable $%s", ZSTR_VAL(CV_DEF_OF(EX_VAR_TO_NUM(opline->op1.var))));
38843884
| LOAD_32BIT_VAL FCARG1w, opline->op1.var
38853885
| EXT_CALL zend_jit_undefined_op_helper, REG0
3886+
| // Check if undefined error was converted to exception and abort
3887+
| cbz RETVALx, ->exception_handler_undef
38863888
| SET_ZVAL_TYPE_INFO op1_addr, IS_NULL, TMP1w, TMP2
38873889
op1_info |= MAY_BE_NULL;
38883890
}

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4264,6 +4264,9 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, uint32_t op
42644264
| mov FCARG1d, opline->op1.var
42654265
| EXT_CALL zend_jit_undefined_op_helper, r0
42664266
| SET_ZVAL_TYPE_INFO op1_addr, IS_NULL
4267+
| // Check if undefined error was converted to exception and abort
4268+
| test r0, r0
4269+
| jz ->exception_handler_undef
42674270
op1_info |= MAY_BE_NULL;
42684271
}
42694272
|2:

0 commit comments

Comments
 (0)