@@ -5579,7 +5579,8 @@ static int zend_jit_simple_assign(dasm_State **Dst,
55795579 uint32_t val_info,
55805580 zend_jit_addr res_addr,
55815581 int in_cold,
5582- int save_r1)
5582+ int save_r1,
5583+ bool check_exception)
55835584/* Labels: 1,2,3 */
55845585{
55855586 zend_reg tmp_reg;
@@ -5629,7 +5630,9 @@ static int zend_jit_simple_assign(dasm_State **Dst,
56295630 ZEND_ASSERT(Z_MODE(val_addr) == IS_MEM_ZVAL && Z_REG(val_addr) == ZREG_FP);
56305631 | LOAD_32BIT_VAL FCARG1w, Z_OFFSET(val_addr)
56315632 | EXT_CALL zend_jit_undefined_op_helper, REG0
5632- | cbz RETVALx, ->exception_handler_undef
5633+ if (check_exception) {
5634+ | cbz RETVALx, ->exception_handler_undef
5635+ }
56335636 if (save_r1) {
56345637 | ldr FCARG1x, T1 // restore
56355638 }
@@ -5938,15 +5941,15 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
59385941 if (!keep_gc) {
59395942 | str Rx(tmp_reg), T1 // save
59405943 }
5941- if (!zend_jit_simple_assign(Dst, opline, var_addr, var_info, var_def_info, val_type, val_addr, val_info, res_addr, in_cold, 0)) {
5944+ if (!zend_jit_simple_assign(Dst, opline, var_addr, var_info, var_def_info, val_type, val_addr, val_info, res_addr, in_cold, 0, 0 )) {
59425945 return 0;
59435946 }
59445947 if (!keep_gc) {
59455948 | ldr FCARG1x, T1 // restore
59465949 }
59475950 } else {
59485951 | GET_ZVAL_PTR FCARG1x, var_use_addr, TMP1
5949- if (!zend_jit_simple_assign(Dst, opline, var_addr, var_info, var_def_info, val_type, val_addr, val_info, res_addr, in_cold, 1)) {
5952+ if (!zend_jit_simple_assign(Dst, opline, var_addr, var_info, var_def_info, val_type, val_addr, val_info, res_addr, in_cold, 1, 0 )) {
59505953 return 0;
59515954 }
59525955 }
@@ -5958,7 +5961,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
59585961 }
59595962 | ZVAL_DTOR_FUNC var_info, opline, TMP1
59605963 if (in_cold || (RC_MAY_BE_N(var_info) && (var_info & (MAY_BE_ARRAY|MAY_BE_OBJECT)) != 0)) {
5961- if (check_exception) {
5964+ if (check_exception && !(val_info & MAY_BE_UNDEF) ) {
59625965 | MEM_LOAD_64_ZTS ldr, REG0, executor_globals, exception, TMP1
59635966 | cbz REG0, >8
59645967 | b ->exception_handler
@@ -5974,6 +5977,12 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
59745977 | b >8
59755978 }
59765979 }
5980+ if (check_exception && (val_info & MAY_BE_UNDEF)) {
5981+ |8:
5982+ | MEM_LOAD_64_ZTS ldr, REG0, executor_globals, exception, TMP1
5983+ | cbz REG0, >8
5984+ | b ->exception_handler
5985+ }
59775986 if (in_cold) {
59785987 |.code
59795988 } else {
@@ -6002,7 +6011,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
60026011 }
60036012 }
60046013
6005- if (!done && !zend_jit_simple_assign(Dst, opline, var_addr, var_info, var_def_info, val_type, val_addr, val_info, res_addr, 0, 0)) {
6014+ if (!done && !zend_jit_simple_assign(Dst, opline, var_addr, var_info, var_def_info, val_type, val_addr, val_info, res_addr, 0, 0, check_exception )) {
60066015 return 0;
60076016 }
60086017
@@ -6102,7 +6111,7 @@ static int zend_jit_assign_dim(dasm_State **Dst, const zend_op *opline, uint32_t
61026111 | b >9
61036112 |.code
61046113
6105- if (!zend_jit_simple_assign(Dst, opline, var_addr, var_info, -1, (opline+1)->op1_type, op3_addr, val_info, res_addr, 0, 0)) {
6114+ if (!zend_jit_simple_assign(Dst, opline, var_addr, var_info, -1, (opline+1)->op1_type, op3_addr, val_info, res_addr, 0, 0, 0 )) {
61066115 return 0;
61076116 }
61086117 } else {
@@ -8453,7 +8462,7 @@ static int zend_jit_qm_assign(dasm_State **Dst, const zend_op *opline, uint32_t
84538462 }
84548463 }
84558464
8456- if (!zend_jit_simple_assign(Dst, opline, res_addr, res_use_info, res_info, opline->op1_type, op1_addr, op1_info, 0, 0, 0)) {
8465+ if (!zend_jit_simple_assign(Dst, opline, res_addr, res_use_info, res_info, opline->op1_type, op1_addr, op1_info, 0, 0, 0, 1 )) {
84578466 return 0;
84588467 }
84598468 if (!zend_jit_store_var_if_necessary(Dst, opline->result.var, res_addr, res_info)) {
0 commit comments