From a04d9e0f1be00b1ef0b008b72b71ffc306819a4e Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 16 Nov 2016 20:49:00 +0300 Subject: [PATCH] Fixed type ingference --- ext/opcache/Optimizer/zend_inference.c | 14 ++++++++------ 1 file 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 */ -- 2.50.1