com php-src: Fixed type ingference: ext/opcache/Optimizer/zend _inference.c
| From: | Dmitry Stogov | Date: | Wed, 16 Nov 2016 17:49:00 +0000 |
| Subject: | com php-src: Fixed type ingference: ext/opcache/Optimizer/zend _inference.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95795@lists.php.net to get a copy of this message | ||
Commit: a04d9e0f1be00b1ef0b008b72b71ffc306819a4e
Author: Dmitry Stogov <dmitry@zend.com> Wed, 16 Nov 2016 20:49:00 +0300
Parents: 1f3a5b45019d318179113b79d2b92fcb367c1ab7
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a04d9e0f1be00b1ef0b008b72b71ffc306819a4e
Log:
Fixed type ingference
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 a25a0ce..4c41e21 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -3474,12 +3474,15 @@ static void zend_update_type_info(const zend_op_array *op_array,
UPDATE_SSA_TYPE(MAY_BE_FALSE|MAY_BE_TRUE, ssa_ops[i].result_def);
break;
case ZEND_VERIFY_RETURN_TYPE:
- {
- zend_arg_info *ret_info = op_array->arg_info - 1;
+ if (t1 & MAY_BE_REF) {
+ tmp = t1;
+ } else {
+ zend_arg_info *ret_info = op_array->arg_info - 1;
- tmp = zend_fetch_arg_info(script, ret_info, &ce);
- if (tmp & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
- tmp |= MAY_BE_RC1 | MAY_BE_RCN;
+ tmp = zend_fetch_arg_info(script, ret_info, &ce);
+ if (tmp & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
+ tmp |= MAY_BE_RC1 | MAY_BE_RCN;
+ }
}
if (opline->op1_type & (IS_TMP_VAR|IS_VAR|IS_CV)) {
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
@@ -3497,7 +3500,6 @@ static void zend_update_type_info(const zend_op_array *op_array,
}
}
break;
- }
case ZEND_CATCH:
case ZEND_INCLUDE_OR_EVAL:
/* Forbidden opcodes */