summaryrefslogtreecommitdiff
path: root/ext/opcache/Optimizer/zend_inference.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/Optimizer/zend_inference.c')
-rw-r--r--ext/opcache/Optimizer/zend_inference.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c
index ef4c41b6e2..b897b42a2b 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -2330,12 +2330,14 @@ static int zend_update_type_info(const zend_op_array *op_array,
}
} else if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (opline->op1_type == IS_CV) {
- if (orig & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
- orig &= (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);
- orig |= MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN;
- }
- if (orig & MAY_BE_OBJECT) {
- orig |= (MAY_BE_RC1|MAY_BE_RCN);
+ if (!(orig & MAY_BE_REF)) {
+ if (orig & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
+ orig &= (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);
+ orig |= MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN;
+ }
+ if (orig & MAY_BE_OBJECT) {
+ orig |= (MAY_BE_RC1|MAY_BE_RCN);
+ }
}
UPDATE_SSA_TYPE(orig, ssa_ops[i].op1_def);
COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);