JIT: fix issue with partial comp pred list maintenance (#81605)
authorAndy Ayers <andya@microsoft.com>
Mon, 6 Feb 2023 02:52:08 +0000 (18:52 -0800)
committerGitHub <noreply@github.com>
Mon, 6 Feb 2023 02:52:08 +0000 (18:52 -0800)
We may have degenerate flow out of a partial compilation block, so make
sure to fully remove the block from all successor pred lists.

Fixes issue seen in #80635.

src/coreclr/jit/importer.cpp

index 53e5104..e474a32 100644 (file)
@@ -6369,7 +6369,8 @@ void Compiler::impImportBlockCode(BasicBlock* block)
             //
             for (BasicBlock* const succ : block->Succs())
             {
-                fgRemoveRefPred(succ, block);
+                // We may have degenerate flow, make sure to fully remove
+                fgRemoveAllRefPreds(succ, block);
             }
 
             // Change block to BBJ_THROW so we won't trigger importation of successors.