@@ -5579,7 +5579,8 @@ static int zend_jit_simple_assign(dasm_State **Dst,
5579
5579
uint32_t val_info,
5580
5580
zend_jit_addr res_addr,
5581
5581
int in_cold,
5582
- int save_r1)
5582
+ int save_r1,
5583
+ bool check_exception)
5583
5584
/* Labels: 1,2,3 */
5584
5585
{
5585
5586
zend_reg tmp_reg;
@@ -5629,7 +5630,9 @@ static int zend_jit_simple_assign(dasm_State **Dst,
5629
5630
ZEND_ASSERT(Z_MODE(val_addr) == IS_MEM_ZVAL && Z_REG(val_addr) == ZREG_FP);
5630
5631
| LOAD_32BIT_VAL FCARG1w, Z_OFFSET(val_addr)
5631
5632
| 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
+ }
5633
5636
if (save_r1) {
5634
5637
| ldr FCARG1x, T1 // restore
5635
5638
}
@@ -5938,15 +5941,15 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
5938
5941
if (!keep_gc) {
5939
5942
| str Rx(tmp_reg), T1 // save
5940
5943
}
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 )) {
5942
5945
return 0;
5943
5946
}
5944
5947
if (!keep_gc) {
5945
5948
| ldr FCARG1x, T1 // restore
5946
5949
}
5947
5950
} else {
5948
5951
| 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 )) {
5950
5953
return 0;
5951
5954
}
5952
5955
}
@@ -5958,7 +5961,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
5958
5961
}
5959
5962
| ZVAL_DTOR_FUNC var_info, opline, TMP1
5960
5963
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) ) {
5962
5965
| MEM_LOAD_64_ZTS ldr, REG0, executor_globals, exception, TMP1
5963
5966
| cbz REG0, >8
5964
5967
| b ->exception_handler
@@ -5974,6 +5977,12 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
5974
5977
| b >8
5975
5978
}
5976
5979
}
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
+ }
5977
5986
if (in_cold) {
5978
5987
|.code
5979
5988
} else {
@@ -6002,7 +6011,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst,
6002
6011
}
6003
6012
}
6004
6013
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 )) {
6006
6015
return 0;
6007
6016
}
6008
6017
@@ -6102,7 +6111,7 @@ static int zend_jit_assign_dim(dasm_State **Dst, const zend_op *opline, uint32_t
6102
6111
| b >9
6103
6112
|.code
6104
6113
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 )) {
6106
6115
return 0;
6107
6116
}
6108
6117
} else {
@@ -8453,7 +8462,7 @@ static int zend_jit_qm_assign(dasm_State **Dst, const zend_op *opline, uint32_t
8453
8462
}
8454
8463
}
8455
8464
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 )) {
8457
8466
return 0;
8458
8467
}
8459
8468
if (!zend_jit_store_var_if_necessary(Dst, opline->result.var, res_addr, res_info)) {
0 commit comments