com php-src: Fixed referencecounter inference rules: ext/opcache/Optimizer/zend_inference.c

From: Date: Thu, 13 Oct 2016 23:24:46 +0000
Subject: com php-src: Fixed referencecounter inference rules: ext/opcache/Optimizer/zend_inference.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95072@lists.php.net to get a copy of this message
Commit: e92a18dcd5c7da93a412630e74baa7099e9dcc0f Author: Dmitry Stogov <dmitry@zend.com> Tue, 11 Oct 2016 15:43:23 +0300 Committer: Anatol Belski <ab@php.net> Fri, 14 Oct 2016 01:24:46 +0200 Parents: 233992409bae1b467e5ba2af3319dc291e2bf03e Branches: PHP-7.1 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e92a18dcd5c7da93a412630e74baa7099e9dcc0f Log: Fixed referencecounter inference rules (cherry picked from commit 6046a99b97b5abab2e75d73bc9d73062f1943126) 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 d6724d3..36bad72 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -2584,28 +2584,33 @@ static void zend_update_type_info(const zend_op_array *op_array, case ZEND_ASSIGN_BW_XOR: case ZEND_ASSIGN_CONCAT: orig = 0; + tmp = 0; if (opline->extended_value == ZEND_ASSIGN_OBJ) { - tmp = MAY_BE_RC1; + tmp |= MAY_BE_REF; orig = t1; t1 = MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; t2 = OP1_DATA_INFO(); } else if (opline->extended_value == ZEND_ASSIGN_DIM) { - tmp = MAY_BE_RC1; + if (t1 & MAY_BE_ARRAY_OF_REF) { + tmp |= MAY_BE_REF; + } orig = t1; t1 = zend_array_element_type(t1, 1, 0); t2 = OP1_DATA_INFO(); } else { - tmp = 0; - if (t1 & (MAY_BE_RC1|MAY_BE_RCN)) { - tmp |= MAY_BE_RC1 | MAY_BE_RCN; - } if (t1 & MAY_BE_REF) { - tmp |= MAY_BE_REF; + tmp |= MAY_BE_REF; } } tmp |= binary_op_result_type( ssa, get_compound_assign_op(opline->opcode), t1, t2, ssa_ops[i].op1_def); + if (tmp & (MAY_BE_STRING|MAY_BE_ARRAY)) { + tmp |= MAY_BE_RC1; + } + if (tmp & (MAY_BE_OBJECT|MAY_BE_RESOURCE)) { + tmp |= MAY_BE_RC1 | MAY_BE_RCN; + } if (opline->extended_value == ZEND_ASSIGN_DIM) { if (opline->op1_type == IS_CV) {

« previous php.cvs (#95072) next »