Skip to content

Commit 1c68d63

Browse files
committed
Fixed bug #75255 (Request hangs and not finish)
1 parent 1981c48 commit 1c68d63

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ PHP NEWS
1919
- MySQLi:
2020
. Fixed bug #75018 (Data corruption when reading fields of bit type). (Anatol)
2121

22+
- Opcache
23+
. Fixed bug #75255 (Request hangs and not finish). (Dmitry)
24+
2225
- PDO_mysql:
2326
. Fixed bug #75177 (Type 'bit' is fetched as unexpected string). (Anatol)
2427

ext/opcache/Optimizer/zend_inference.c

+4
Original file line numberDiff line numberDiff line change
@@ -1708,6 +1708,10 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
17081708
for (j = scc_var[scc]; j >= 0; j = next_scc_var[j]) {
17091709
if (!ssa->var_info[j].has_range) {
17101710
zend_inference_init_range(op_array, ssa, j, 1, ZEND_LONG_MIN, ZEND_LONG_MAX, 1);
1711+
} else if (ssa->vars[j].definition_phi &&
1712+
ssa->vars[j].definition_phi->pi < 0) {
1713+
/* narrowing Phi functions first */
1714+
zend_ssa_range_narrowing(op_array, ssa, j, scc);
17111715
}
17121716
zend_bitset_incl(worklist, j);
17131717
}

ext/opcache/tests/bug75255.phpt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug #75255 (Request hangs and not finish)
3+
--FILE--
4+
<?php
5+
function generatePlanImage() {
6+
if ($abc > 5) {
7+
$abc = 5;
8+
}
9+
for ($row = 0; $row < $abc; $row++) {
10+
for ($col = 0; $col < $numCols; $col++) {
11+
getPossibleRatio($abc);
12+
}
13+
}
14+
}
15+
?>
16+
DONE
17+
--EXPECT--
18+
DONE

0 commit comments

Comments
 (0)