From 3866c1699e5d4acdbd2f580b0d3d93dc4f2efa1a Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 17 Aug 2017 20:03:12 +0300 Subject: [PATCH] More accurate reference counting inference --- ext/opcache/Optimizer/zend_inference.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 6457c93177..9d5d6cfea5 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -2978,13 +2978,10 @@ static int zend_update_type_info(const zend_op_array *op_array, } tmp |= MAY_BE_ARRAY | MAY_BE_RC1; } - if (t1 & MAY_BE_STRING) { - tmp |= MAY_BE_RC1; - } - if (t1 & MAY_BE_ARRAY) { + if (t1 & (MAY_BE_STRING|MAY_BE_ARRAY)) { tmp |= MAY_BE_RC1; if (opline->opcode == ZEND_FETCH_DIM_FUNC_ARG) { - tmp |= MAY_BE_RCN; + tmp |= t1 & MAY_BE_RCN; } } if (t1 & (MAY_BE_OBJECT|MAY_BE_RESOURCE)) { -- 2.50.1