From: Dmitry Stogov Date: Thu, 17 Nov 2016 07:41:42 +0000 (+0300) Subject: VERIFY_RETURN_TYPE on references can't be eliminated X-Git-Tag: php-7.2.0alpha1~910^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8f35d0d4e297fbed763e5da8467b9cc67ebd42b;p=php VERIFY_RETURN_TYPE on references can't be eliminated --- diff --git a/ext/opcache/Optimizer/dfa_pass.c b/ext/opcache/Optimizer/dfa_pass.c index 63faaf62c3..b7a0f065f7 100644 --- a/ext/opcache/Optimizer/dfa_pass.c +++ b/ext/opcache/Optimizer/dfa_pass.c @@ -312,6 +312,10 @@ static inline zend_bool can_elide_return_type_check( zend_ssa_var_info *use_info = &ssa->var_info[ssa_op->op1_use]; zend_ssa_var_info *def_info = &ssa->var_info[ssa_op->op1_def]; + if (use_info->type & MAY_BE_REF) { + return 0; + } + /* A type is possible that is not in the allowed types */ if ((use_info->type & (MAY_BE_ANY|MAY_BE_UNDEF)) & ~(def_info->type & MAY_BE_ANY)) { return 0;