From: Xinchen Hui Date: Thu, 17 Aug 2017 13:57:28 +0000 (+0800) Subject: Fixed type-infer on ZEND_FETCH_DIM_FUNC_ARG X-Git-Tag: php-7.2.0RC1~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30fb70dd25cb2db805fa1f97b1293b34409f402a;p=php Fixed type-infer on ZEND_FETCH_DIM_FUNC_ARG --- diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 26ab08faeb..6457c93177 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); }