com php-src: Fixed mistakes in type inference rules.: ext/opcache/Optimizer/zend_inference.c
| From: | Dmitry Stogov | Date: | Wed, 15 Jun 2016 20:04:17 +0000 |
| Subject: | com php-src: Fixed mistakes in type inference rules.: ext/opcache/Optimizer/zend_inference.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92400@lists.php.net to get a copy of this message | ||
Commit: d12987256a27369ae67d98dd65406153096339b7
Author: Dmitry Stogov <dmitry@zend.com> Wed, 15 Jun 2016 23:04:17 +0300
Parents: 22343e8a31bd8f5b480cce8b4aa7424b4bf8b0ef
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d12987256a27369ae67d98dd65406153096339b7
Log:
Fixed mistakes in type inference rules.
Changed paths:
M ext/opcache/Optimizer/zend_inference.c
Diff:
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c
index d9e1d7f..0a15e4b 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -3112,6 +3112,9 @@ static void zend_update_type_info(const zend_op_array *op_array,
tmp = MAY_BE_RCN;
}
}
+ if (opline->opcode == ZEND_FE_FETCH_R && (t2 & MAY_BE_REF)) {
+ tmp |= MAY_BE_REF;
+ }
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op2_def);
if (ssa_ops[i].result_def >= 0) {
tmp = MAY_BE_RC1;
@@ -3734,6 +3737,9 @@ void zend_init_func_return_info(const zend_op_array *op_array,
zend_ssa_range tmp_range = {0, 0, 0, 0};
ret->type = zend_fetch_arg_info(script, ret_info, &ret->ce);
+ if (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE) {
+ ret->type |= MAY_BE_REF;
+ }
ret->is_instanceof = (ret->ce) ? 1 : 0;
ret->range = tmp_range;
ret->has_range = 0;