com php-src: Fixed type-infer on ZEND_FETCH_DIM_FUNC_AR G: ext/opcache/Optimizer/zend_inference.c
| From: | Xinchen Hui | Date: | Thu, 17 Aug 2017 13:57:28 +0000 |
| Subject: | com php-src: Fixed type-infer on ZEND_FETCH_DIM_FUNC_AR G: ext/opcache/Optimizer/zend_inference.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99073@lists.php.net to get a copy of this message | ||
Commit: 30fb70dd25cb2db805fa1f97b1293b34409f402a
Author: Xinchen Hui <laruence@gmail.com> Thu, 17 Aug 2017 21:57:28 +0800
Parents: 4e03ebc04a644378ed20de25cbfb1cb9bf6346cb
Branches: PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=30fb70dd25cb2db805fa1f97b1293b34409f402a
Log:
Fixed type-infer on ZEND_FETCH_DIM_FUNC_ARG
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 26ab08f..6457c93 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -2978,9 +2978,15 @@ static int zend_update_type_info(const zend_op_array *op_array,
}
tmp |= MAY_BE_ARRAY | MAY_BE_RC1;
}
- if (t1 & (MAY_BE_STRING|MAY_BE_ARRAY)) {
+ if (t1 & MAY_BE_STRING) {
tmp |= MAY_BE_RC1;
}
+ if (t1 & MAY_BE_ARRAY) {
+ tmp |= MAY_BE_RC1;
+ if (opline->opcode == ZEND_FETCH_DIM_FUNC_ARG) {
+ tmp |= MAY_BE_RCN;
+ }
+ }
if (t1 & (MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
tmp |= t1 & (MAY_BE_RC1|MAY_BE_RCN);
}