Skip to content

Commit d16d251

Browse files
committed
Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
ZEND_ASSIGN is not the only place where this is relevant, so handle it generically inside COPY_SSA_OBJ_TYPE instead.
1 parent 5d07257 commit d16d251

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ext/opcache/Optimizer/zend_inference.c

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

17421742
#define COPY_SSA_OBJ_TYPE(from_var, to_var) do { \
17431743
if ((from_var) >= 0 && (ssa_var_info[(from_var)].type & MAY_BE_OBJECT) \
1744-
&& ssa_var_info[(from_var)].ce) { \
1744+
&& ssa_var_info[(from_var)].ce && !(ssa_var_info[(to_var)].type & MAY_BE_REF)) { \
17451745
UPDATE_SSA_OBJ_TYPE(ssa_var_info[(from_var)].ce, \
17461746
ssa_var_info[(from_var)].is_instanceof, (to_var)); \
17471747
} else { \
@@ -2740,11 +2740,7 @@ static zend_always_inline int _zend_update_type_info(
27402740
tmp |= MAY_BE_DOUBLE;
27412741
}
27422742
UPDATE_SSA_TYPE(tmp, ssa_op->op1_def);
2743-
if (tmp & MAY_BE_REF) {
2744-
UPDATE_SSA_OBJ_TYPE(NULL, 0, ssa_op->op1_def);
2745-
} else {
2746-
COPY_SSA_OBJ_TYPE(ssa_op->op2_use, ssa_op->op1_def);
2747-
}
2743+
COPY_SSA_OBJ_TYPE(ssa_op->op2_use, ssa_op->op1_def);
27482744
}
27492745
if (ssa_op->result_def >= 0) {
27502746
if (tmp & MAY_BE_REF) {

0 commit comments

Comments
 (0)