php-src/Zend/tests/unreachable_phi_cycle.phpt
Nikita Popov ddf8910237 Fix DCE of unreachable phi in cycle
We can't remove a trivial phi of the form x = phi(x), because we
don't have a replacement value. We could drop the whole block
though. SCCP would normally do this, but in this particular case
we only determine non-reachability based on type information.

Fixes oss-fuzz #39316.
2021-09-27 11:26:31 +02:00

16 lines
314 B
PHP

--TEST--
Unreachable phi cycle
--FILE--
<?php
// The inner loop is dead, but SCCP reachability analysis doesn't realize this,
// as this is determined based on type information.
function test() {
for (; $i--;) {
for(; x;);
}
}
test();
?>
--EXPECTF--
Warning: Undefined variable $i in %s on line %d