1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix register allocarion for result of ASSIGN_OBJ (#17994)

This fixes few failures in Symfony unit tests with function JIT
This commit is contained in:
Dmitry Stogov
2025-03-07 19:28:51 +03:00
committed by GitHub
parent 7634484dc2
commit 1b9d659c3f

View File

@@ -14748,13 +14748,6 @@ static int zend_jit_assign_obj(zend_jit_ctx *jit,
// CACHE_PTR_EX(cache_slot + 2, NULL);
}
if (RETURN_VALUE_USED(opline) && Z_MODE(res_addr) == IS_REG) {
zend_jit_addr real_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
if (!zend_jit_load_reg(jit, real_addr, res_addr, res_info)) {
return 0;
}
}
ir_END_list(end_inputs);
ir_IF_FALSE(if_has_prop_info);
}
@@ -14820,12 +14813,6 @@ static int zend_jit_assign_obj(zend_jit_ctx *jit,
arg3,
arg4);
if (RETURN_VALUE_USED(opline) && Z_MODE(res_addr) == IS_REG) {
zend_jit_addr real_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
if (!zend_jit_load_reg(jit, real_addr, res_addr, res_info)) {
return 0;
}
}
ir_END_list(end_inputs);
}
}
@@ -14838,7 +14825,14 @@ static int zend_jit_assign_obj(zend_jit_ctx *jit,
return 0;
}
} else {
if (!zend_jit_assign_to_variable(jit, opline, prop_addr, prop_addr, -1, -1, (opline+1)->op1_type, val_addr, val_info, res_addr, 0, 0)) {
zend_jit_addr real_res_addr;
if (res_addr && Z_MODE(res_addr) == IS_REG) {
real_res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
} else {
real_res_addr = res_addr;
}
if (!zend_jit_assign_to_variable(jit, opline, prop_addr, prop_addr, -1, -1, (opline+1)->op1_type, val_addr, val_info, real_res_addr, 0, 0)) {
return 0;
}
}
@@ -14888,12 +14882,6 @@ slow_path:
ir_ADD_OFFSET(run_time_cache, opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS),
arg5);
if (RETURN_VALUE_USED(opline) && Z_MODE(res_addr) == IS_REG) {
zend_jit_addr real_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
if (!zend_jit_load_reg(jit, real_addr, res_addr, res_info)) {
return 0;
}
}
ir_END_list(end_inputs);
}
@@ -14914,6 +14902,13 @@ slow_path:
jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, opline);
}
if (RETURN_VALUE_USED(opline) && Z_MODE(res_addr) == IS_REG) {
zend_jit_addr real_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
if (!zend_jit_load_reg(jit, real_addr, res_addr, res_info)) {
return 0;
}
}
if (may_throw) {
zend_jit_check_exception(jit);
}