@@ -5574,7 +5574,8 @@ static int zend_jit_simple_assign(dasm_State **Dst,
5574
5574
uint32_t val_info,
5575
5575
zend_jit_addr res_addr,
5576
5576
int in_cold,
5577
- int save_r1)
5577
+ int save_r1,
5578
+ bool check_exception)
5578
5579
/* Labels: 1,2,3 */
5579
5580
{
5580
5581
zend_reg tmp_reg;
@@ -5624,7 +5625,9 @@ static int zend_jit_simple_assign(dasm_State **Dst,
5624
5625
ZEND_ASSERT(Z_MODE(val_addr) == IS_MEM_ZVAL && Z_REG(val_addr) == ZREG_FP);
5625
5626
| LOAD_32BIT_VAL FCARG1w, Z_OFFSET(val_addr)
5626
5627
| EXT_CALL zend_jit_undefined_op_helper, REG0
5627
- | cbz RETVALx, ->exception_handler_undef
5628
+ if (check_exception) {
5629
+ | cbz RETVALx, ->exception_handler_undef
5630
+ }
5628
5631
if (save_r1) {
5629
5632
| ldr FCARG1x, T1 // restore
5630
5633
}
@@ -5933,15 +5936,15 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
5933
5936
if (!keep_gc) {
5934
5937
| str Rx(tmp_reg), T1 // save
5935
5938
}
5936
- 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)) {
5939
+ 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 )) {
5937
5940
return 0;
5938
5941
}
5939
5942
if (!keep_gc) {
5940
5943
| ldr FCARG1x, T1 // restore
5941
5944
}
5942
5945
} else {
5943
5946
| GET_ZVAL_PTR FCARG1x, var_use_addr, TMP1
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, 1)) {
5947
+ 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 )) {
5945
5948
return 0;
5946
5949
}
5947
5950
}
@@ -5953,7 +5956,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
5953
5956
}
5954
5957
| ZVAL_DTOR_FUNC var_info, opline, TMP1
5955
5958
if (in_cold || (RC_MAY_BE_N(var_info) && (var_info & (MAY_BE_ARRAY|MAY_BE_OBJECT)) != 0)) {
5956
- if (check_exception) {
5959
+ if (check_exception && !(val_info & MAY_BE_UNDEF) ) {
5957
5960
| MEM_LOAD_64_ZTS ldr, REG0, executor_globals, exception, TMP1
5958
5961
| cbz REG0, >8
5959
5962
| b ->exception_handler
@@ -5969,6 +5972,12 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
5969
5972
| b >8
5970
5973
}
5971
5974
}
5975
+ if (check_exception && (val_info & MAY_BE_UNDEF)) {
5976
+ |8:
5977
+ | MEM_LOAD_64_ZTS ldr, REG0, executor_globals, exception, TMP1
5978
+ | cbz REG0, >8
5979
+ | b ->exception_handler
5980
+ }
5972
5981
if (in_cold) {
5973
5982
|.code
5974
5983
} else {
@@ -5997,7 +6006,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
5997
6006
}
5998
6007
}
5999
6008
6000
- 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)) {
6009
+ 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 )) {
6001
6010
return 0;
6002
6011
}
6003
6012
@@ -6097,7 +6106,7 @@ static int zend_jit_assign_dim(dasm_State **Dst, const zend_op *opline, uint32_t
6097
6106
| b >9
6098
6107
|.code
6099
6108
6100
- if (!zend_jit_simple_assign(Dst, opline, var_addr, var_info, -1, (opline+1)->op1_type, op3_addr, val_info, res_addr, 0, 0)) {
6109
+ 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 )) {
6101
6110
return 0;
6102
6111
}
6103
6112
} else {
@@ -8351,7 +8360,7 @@ static int zend_jit_qm_assign(dasm_State **Dst, const zend_op *opline, uint32_t
8351
8360
}
8352
8361
}
8353
8362
8354
- if (!zend_jit_simple_assign(Dst, opline, res_addr, res_use_info, res_info, opline->op1_type, op1_addr, op1_info, 0, 0, 0)) {
8363
+ 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 )) {
8355
8364
return 0;
8356
8365
}
8357
8366
if (!zend_jit_store_var_if_necessary(Dst, opline->result.var, res_addr, res_info)) {
0 commit comments