com php-src: Special handling for $php_errormsg and $ http_response_header.: ext/opcache/Optimizer/zend_i nference.c

From: Date: Thu, 29 Sep 2016 23:41:08 +0000
Subject: com php-src: Special handling for $php_errormsg and $ http_response_header.: ext/opcache/Optimizer/zend_i nference.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-94786@lists.php.net to get a copy of this message
Commit: c218c4f01eccc39bea20d5e18eac04dd6bb562f3 Author: Dmitry Stogov <dmitry@zend.com> Thu, 15 Sep 2016 03:07:31 +0300 Parents: 0edb16e768b45cfb9d1abdf962f0581102a1ef2c Branches: PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c218c4f01eccc39bea20d5e18eac04dd6bb562f3 Log: Special handling for $php_errormsg and $http_response_header. 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 5abab01..f9fd267 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -4063,13 +4063,19 @@ static int zend_infer_types(const zend_op_array *op_array, const zend_script *sc zend_type_narrowing(op_array, script, ssa); for (j = 0; j < op_array->last_var; j++) { + /* $php_errormsg and $http_response_header may be updated indirectly */ if (zend_string_equals_literal(op_array->vars[j], "php_errormsg")) { - /* Mark all SSA vars for $php_errormsg as references, - * to make sure we don't optimize it. */ int i; for (i = 0; i < ssa_vars_count; i++) { if (ssa->vars[i].var == j) { - ssa_var_info[i]..type |= MAY_BE_REF | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; + ssa_var_info[i].type |= MAY_BE_STRING | MAY_BE_RC1 | MAY_BE_RCN; + } + } + } else if (zend_string_equals_literal(op_array->vars[j], "http_response_header")) { + int i; + for (i = 0; i < ssa_vars_count; i++) { + if (ssa->vars[i].var == j) { + ssa_var_info[i].type |= MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_RC1 | MAY_BE_RCN; } } }

« previous php.cvs (#94786) next »