From: Nikita Popov Date: Fri, 14 Apr 2017 23:39:33 +0000 (+0200) Subject: Improve fix for bug #74442 X-Git-Tag: php-7.1.5RC1~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c2222796bc468cc3a1da95346e525bbfe8f6657;p=php Improve fix for bug #74442 Make the check less conservative to be consistent with the other cases. --- diff --git a/ext/opcache/Optimizer/dfa_pass.c b/ext/opcache/Optimizer/dfa_pass.c index 027814b5cd..3abf997d8d 100644 --- a/ext/opcache/Optimizer/dfa_pass.c +++ b/ext/opcache/Optimizer/dfa_pass.c @@ -366,10 +366,11 @@ static zend_bool opline_supports_assign_contraction( && (opline->op2_type != IS_CV || opline->op2.var != cv_var); } - if (opline->opcode == ZEND_CAST) { + if (opline->opcode == ZEND_CAST + && (opline->extended_value == IS_ARRAY || opline->extended_value == IS_OBJECT)) { /* CAST to array/object may initialize the result to an empty array/object before * reading the expression. */ - return opline->extended_value != IS_ARRAY && opline->extended_value != IS_OBJECT; + return opline->op1_type != IS_CV || opline->op1.var != cv_var; } return 1;