mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fix pi node removal when removing predecessor
This commit is contained in:
commit
c088a9369f
2 changed files with 15 additions and 1 deletions
14
Zend/tests/remove_predecessor_of_pi_node.phpt
Normal file
14
Zend/tests/remove_predecessor_of_pi_node.phpt
Normal file
|
@ -0,0 +1,14 @@
|
|||
--TEST--
|
||||
Regression test for incorrect update of pi node users when removing a predecessor block
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
for (; $n--; )
|
||||
C;
|
||||
}
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Undefined variable $n in %s on line %d
|
|
@ -1409,7 +1409,7 @@ void zend_ssa_remove_predecessor(zend_ssa *ssa, int from, int to) /* {{{ */
|
|||
for (phi = next_ssa_block->phis; phi; phi = phi->next) {
|
||||
if (phi->pi >= 0) {
|
||||
if (phi->pi == from) {
|
||||
zend_ssa_remove_uses_of_var(ssa, phi->ssa_var);
|
||||
zend_ssa_rename_var_uses(ssa, phi->ssa_var, phi->sources[0], /* update_types */ 0);
|
||||
zend_ssa_remove_phi(ssa, phi);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue