Skip to content

Commit 4026dae

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
2 parents 38547b9 + d16d251 commit 4026dae

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
@@ -1793,7 +1793,7 @@ static uint32_t get_ssa_alias_types(zend_ssa_alias_kind alias) {
17931793

17941794
#define COPY_SSA_OBJ_TYPE(from_var, to_var) do { \
17951795
if ((from_var) >= 0 && (ssa_var_info[(from_var)].type & MAY_BE_OBJECT) \
1796-
&& ssa_var_info[(from_var)].ce) { \
1796+
&& ssa_var_info[(from_var)].ce && !(ssa_var_info[(to_var)].type & MAY_BE_REF)) { \
17971797
UPDATE_SSA_OBJ_TYPE(ssa_var_info[(from_var)].ce, \
17981798
ssa_var_info[(from_var)].is_instanceof, (to_var)); \
17991799
} else { \
@@ -2783,11 +2783,7 @@ static zend_always_inline int _zend_update_type_info(
27832783
tmp |= MAY_BE_DOUBLE;
27842784
}
27852785
UPDATE_SSA_TYPE(tmp, ssa_op->op1_def);
2786-
if (tmp & MAY_BE_REF) {
2787-
UPDATE_SSA_OBJ_TYPE(NULL, 0, ssa_op->op1_def);
2788-
} else {
2789-
COPY_SSA_OBJ_TYPE(ssa_op->op2_use, ssa_op->op1_def);
2790-
}
2786+
COPY_SSA_OBJ_TYPE(ssa_op->op2_use, ssa_op->op1_def);
27912787
}
27922788
if (ssa_op->result_def >= 0) {
27932789
if (tmp & MAY_BE_REF) {

0 commit comments

Comments
 (0)