mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Fixed Bug #80959 (infinite loop in building cfg during JIT compilation)
This commit is contained in:
parent
a0893865b3
commit
a9991fbf28
2
NEWS
2
NEWS
@ -20,6 +20,8 @@ PHP NEWS
|
||||
Nikita)
|
||||
. Fixed bug #81272 (Segfault in var[] after array_slice with JIT). (Nikita)
|
||||
. Fixed Bug #81255 (Memory leak in PHPUnit with functional JIT). (Dmitry)
|
||||
. Fixed Bug #80959 (infinite loop in building cfg during JIT compilation)
|
||||
(Nikita, Dmitry)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #72146 (Integer overflow on substr_replace). (cmb)
|
||||
|
@ -890,6 +890,10 @@ int zend_cfg_identify_loops(const zend_op_array *op_array, zend_cfg *cfg) /* {{{
|
||||
j = blocks[j].loop_header;
|
||||
}
|
||||
if (j != i) {
|
||||
if (blocks[j].idom < 0 && j != 0) {
|
||||
/* Ignore blocks that are unreachable or only abnormally reachable. */
|
||||
continue;
|
||||
}
|
||||
blocks[j].loop_header = i;
|
||||
for (k = 0; k < blocks[j].predecessors_count; k++) {
|
||||
zend_worklist_push(&work, cfg->predecessors[blocks[j].predecessor_offset + k]);
|
||||
|
31
ext/opcache/tests/jit/bug80959.phpt
Normal file
31
ext/opcache/tests/jit/bug80959.phpt
Normal file
@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #80959: infinite loop in building cfg during JIT compilation
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.jit=tracing
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function test($a, $b) {
|
||||
echo "Start\n";
|
||||
$i = $j = 0;
|
||||
do {
|
||||
$i++;
|
||||
try {
|
||||
continue;
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
do {
|
||||
$j++;
|
||||
} while ($j < $b);
|
||||
} while ($i < $a);
|
||||
echo "Done $i $j\n";
|
||||
}
|
||||
test(5, 6);
|
||||
?>
|
||||
--EXPECT--
|
||||
Start
|
||||
Done 5 0
|
Loading…
Reference in New Issue
Block a user