com php-src: Fixed type inference: ext/opcache/Optimizer/zend _inference.c
| From: | Dmitry Stogov | Date: | Mon, 25 Sep 2017 09:03:47 +0000 |
| Subject: | com php-src: Fixed type inference: ext/opcache/Optimizer/zend _inference.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99528@lists.php.net to get a copy of this message | ||
Commit: d526ddec85cd7070a08c85cc258a55e5ee649fdd
Author: Dmitry Stogov <dmitry@zend.com> Mon, 25 Sep 2017 12:03:47 +0300
Parents: 634f79d8d85743a4b214f6dd70f7f78d214f7159
Branches: PHP-7.1 PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d526ddec85cd7070a08c85cc258a55e5ee649fdd
Log:
Fixed type inference
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 508ba6c..ecfb14c 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);