@@ -3838,7 +3838,7 @@ static int zend_jit_load_var(dasm_State **Dst, uint32_t info, int var, zend_reg
3838
3838
return zend_jit_load_reg(Dst, src, dst, info);
3839
3839
}
3840
3840
3841
- static int zend_jit_update_regs(dasm_State **Dst, zend_jit_addr src, zend_jit_addr dst, uint32_t info)
3841
+ static int zend_jit_update_regs(dasm_State **Dst, uint32_t var, zend_jit_addr src, zend_jit_addr dst, uint32_t info)
3842
3842
{
3843
3843
if (!zend_jit_same_addr(src, dst)) {
3844
3844
if (Z_MODE(src) == IS_REG) {
@@ -3852,7 +3852,12 @@ static int zend_jit_update_regs(dasm_State **Dst, zend_jit_addr src, zend_jit_ad
3852
3852
}
3853
3853
} else if (Z_MODE(dst) == IS_MEM_ZVAL) {
3854
3854
if (!Z_LOAD(src) && !Z_STORE(src)) {
3855
- if (!zend_jit_spill_store(Dst, src, dst, info, 1)) {
3855
+ if (!zend_jit_spill_store(Dst, src, dst, info,
3856
+ JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE ||
3857
+ JIT_G(current_frame) == NULL ||
3858
+ STACK_MEM_TYPE(JIT_G(current_frame)->stack, EX_VAR_TO_NUM(var)) == IS_UNKNOWN ||
3859
+ (1 << STACK_MEM_TYPE(JIT_G(current_frame)->stack, EX_VAR_TO_NUM(var))) != (info & MAY_BE_ANY)
3860
+ )) {
3856
3861
return 0;
3857
3862
}
3858
3863
}
@@ -3959,7 +3964,7 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, uint32_t op
3959
3964
if (opline->opcode == ZEND_POST_INC || opline->opcode == ZEND_POST_DEC) {
3960
3965
| ZVAL_COPY_VALUE res_addr, res_use_info, op1_addr, MAY_BE_LONG, ZREG_R0, ZREG_R1
3961
3966
}
3962
- if (!zend_jit_update_regs(Dst, op1_addr, op1_def_addr, MAY_BE_LONG)) {
3967
+ if (!zend_jit_update_regs(Dst, opline->op1.var, op1_addr, op1_def_addr, MAY_BE_LONG)) {
3963
3968
return 0;
3964
3969
}
3965
3970
if (opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_POST_INC) {
@@ -8561,7 +8566,7 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
8561
8566
static int zend_jit_qm_assign(dasm_State **Dst, const zend_op *opline, uint32_t op1_info, zend_jit_addr op1_addr, zend_jit_addr op1_def_addr, uint32_t res_use_info, uint32_t res_info, zend_jit_addr res_addr)
8562
8567
{
8563
8568
if (op1_addr != op1_def_addr) {
8564
- if (!zend_jit_update_regs(Dst, op1_addr, op1_def_addr, op1_info)) {
8569
+ if (!zend_jit_update_regs(Dst, opline->op1.var, op1_addr, op1_def_addr, op1_info)) {
8565
8570
return 0;
8566
8571
}
8567
8572
if (Z_MODE(op1_def_addr) == IS_REG && Z_MODE(op1_addr) != IS_REG) {
@@ -8583,7 +8588,7 @@ static int zend_jit_assign(dasm_State **Dst, const zend_op *opline, uint32_t op1
8583
8588
ZEND_ASSERT(opline->op1_type == IS_CV);
8584
8589
8585
8590
if (op2_addr != op2_def_addr) {
8586
- if (!zend_jit_update_regs(Dst, op2_addr, op2_def_addr, op2_info)) {
8591
+ if (!zend_jit_update_regs(Dst, opline->op2.var, op2_addr, op2_def_addr, op2_info)) {
8587
8592
return 0;
8588
8593
}
8589
8594
if (Z_MODE(op2_def_addr) == IS_REG && Z_MODE(op2_addr) != IS_REG) {
@@ -10515,7 +10520,7 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend
10515
10520
}
10516
10521
} else {
10517
10522
if (op1_addr != op1_def_addr) {
10518
- if (!zend_jit_update_regs(Dst, op1_addr, op1_def_addr, op1_info)) {
10523
+ if (!zend_jit_update_regs(Dst, opline->op1.var, op1_addr, op1_def_addr, op1_info)) {
10519
10524
return 0;
10520
10525
}
10521
10526
if (Z_MODE(op1_def_addr) == IS_REG && Z_MODE(op1_addr) != IS_REG) {
0 commit comments