com php-src: Fixed bug #75255 (Request hangs and not finish): NEWS ext/opcache/Optimizer/zend_inference.c ext/opcache/tests/ bug75255.phpt
| From: | Dmitry Stogov | Date: | Wed, 27 Sep 2017 14:16:24 +0000 |
| Subject: | com php-src: Fixed bug #75255 (Request hangs and not finish): NEWS ext/opcache/Optimizer/zend_inference.c ext/opcache/tests/ bug75255.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99564@lists.php.net to get a copy of this message | ||
Commit: 1c68d63f35aecc2aa602ffc429688ed43ffb92b6
Author: Dmitry Stogov <dmitry@zend.com> Wed, 27 Sep 2017 17:16:24 +0300
Parents: 1981c48e60b6398f145f075eddb121efe6eaeea1
Branches: PHP-7.1 PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1c68d63f35aecc2aa602ffc429688ed43ffb92b6
Log:
Fixed bug #75255 (Request hangs and not finish)
Bugs:
https://bugs.php.net/75255
Changed paths:
M NEWS
M ext/opcache/Optimizer/zend_inference.c
A ext/opcache/tests/bug75255.phpt
Diff:
diff --git a/NEWS b/NEWS
index cf5a185..6d541d4 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,9 @@ PHP NEWS
- MySQLi:
. Fixed bug #75018 (Data corruption when reading fields of bit type). (Anatol)
+- Opcache
+ . Fixed bug #75255 (Request hangs and not finish). (Dmitry)
+
- PDO_mysql:
. Fixed bug #75177 (Type 'bit' is fetched as unexpected string). (Anatol)
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c
index fecd68f..6e0d0cb 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -1708,6 +1708,10 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /*
{{
for (j = scc_var[scc]; j >= 0; j = next_scc_var[j]) {
if (!ssa->var_info[j].has_range) {
zend_inference_init_range(op_array, ssa, j, 1, ZEND_LONG_MIN, ZEND_LONG_MAX, 1);
+ } else if (ssa->vars[j].definition_phi &&
+ ssa->vars[j].definition_phi->pi < 0) {
+ /* narrowing Phi functions first */
+ zend_ssa_range_narrowing(op_array, ssa, j, scc);
}
zend_bitset_incl(worklist, j);
}
diff --git a/ext/opcache/tests/bug75255.phpt b/ext/opcache/tests/bug75255.phpt
new file mode 100644
index 0000000..6d843da
--- /dev/null
+++ b/ext/opcache/tests/bug75255.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #75255 (Request hangs and not finish)
+--FILE--
+<?php
+function generatePlanImage() {
+ if ($abc > 5) {
+ $abc = 5;
+ }
+ for ($row = 0; $row < $abc; $row++) {
+ for ($col = 0; $col < $numCols; $col++) {
+ getPossibleRatio($abc);
+ }
+ }
+}
+?>
+DONE
+--EXPECT--
+DONE