Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Drop pi nodes for both old/new pred in replace_predecessor
This commit is contained in:
Nikita Popov 2021-11-08 14:57:16 +01:00
commit e5c2ad45dd
2 changed files with 6 additions and 1 deletions

View File

@ -607,7 +607,7 @@ static void replace_predecessor(zend_ssa *ssa, int block_id, int old_pred, int n
/* Also remove the corresponding phi node entries */
for (phi = ssa->blocks[block_id].phis; phi; phi = phi->next) {
if (phi->pi >= 0) {
if (phi->pi == old_pred) {
if (phi->pi == old_pred || phi->pi == new_pred) {
zend_ssa_rename_var_uses(
ssa, phi->ssa_var, phi->sources[0], /* update_types */ 0);
zend_ssa_remove_phi(ssa, phi);

View File

@ -7,6 +7,11 @@ function test(bool $a, bool $b) {
if ($a && $byte > 0 && $b) {}
unknown($byte);
}
function test2() {
foreach (0 as $v) {
$v ??= 0;
}
}
?>
===DONE===
--EXPECT--