From: Dmitry Stogov Date: Mon, 25 Sep 2017 09:03:47 +0000 (+0300) Subject: Fixed type inference X-Git-Tag: php-7.2.0RC3~6^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d526ddec85cd7070a08c85cc258a55e5ee649fdd;p=php Fixed type inference --- diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 508ba6c3a1..ecfb14ca37 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -2331,12 +2331,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);