Skip to content

Commit 7408da7

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
2 parents 01996d1 + 4026dae commit 7408da7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@ static uint32_t get_ssa_alias_types(zend_ssa_alias_kind alias) {
17871787

17881788
#define COPY_SSA_OBJ_TYPE(from_var, to_var) do { \
17891789
if ((from_var) >= 0 && (ssa_var_info[(from_var)].type & MAY_BE_OBJECT) \
1790-
&& ssa_var_info[(from_var)].ce) { \
1790+
&& ssa_var_info[(from_var)].ce && !(ssa_var_info[(to_var)].type & MAY_BE_REF)) { \
17911791
UPDATE_SSA_OBJ_TYPE(ssa_var_info[(from_var)].ce, \
17921792
ssa_var_info[(from_var)].is_instanceof, (to_var)); \
17931793
} else { \
@@ -2809,11 +2809,7 @@ static zend_always_inline zend_result _zend_update_type_info(
28092809
tmp |= MAY_BE_DOUBLE;
28102810
}
28112811
UPDATE_SSA_TYPE(tmp, ssa_op->op1_def);
2812-
if (tmp & MAY_BE_REF) {
2813-
UPDATE_SSA_OBJ_TYPE(NULL, 0, ssa_op->op1_def);
2814-
} else {
2815-
COPY_SSA_OBJ_TYPE(ssa_op->op2_use, ssa_op->op1_def);
2816-
}
2812+
COPY_SSA_OBJ_TYPE(ssa_op->op2_use, ssa_op->op1_def);
28172813
}
28182814
if (ssa_op->result_def >= 0) {
28192815
if (tmp & MAY_BE_REF) {

0 commit comments

Comments
 (0)