diff options
author | Dmitry Stogov <dmitry@zend.com> | 2016-11-16 20:49:00 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2016-11-16 20:49:00 +0300 |
commit | a04d9e0f1be00b1ef0b008b72b71ffc306819a4e (patch) | |
tree | 875e58d127cb710f650515fc293f814251a067b0 | |
parent | 1f3a5b45019d318179113b79d2b92fcb367c1ab7 (diff) | |
download | php-git-a04d9e0f1be00b1ef0b008b72b71ffc306819a4e.tar.gz |
Fixed type ingference
-rw-r--r-- | ext/opcache/Optimizer/zend_inference.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index a25a0cef76..4c41e2196b 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 */ |