diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index 4f10b648efb549..e070b33da7ef8a 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -572,6 +572,13 @@ static BasicBlockVisit VisitEHSuccs(Compiler* comp, BasicBlock* block, TFunc fun template BasicBlockVisit BasicBlock::VisitEHSuccs(Compiler* comp, TFunc func) { + // These are "pseudo-blocks" and control never actually flows into them + // (codegen directly jumps to its successor after finally calls). + if (KindIs(BBJ_CALLFINALLYRET)) + { + return BasicBlockVisit::Continue; + } + return ::VisitEHSuccs(comp, this, func); } @@ -608,7 +615,8 @@ BasicBlockVisit BasicBlock::VisitAllSuccs(Compiler* comp, TFunc func) return ::VisitEHSuccs(comp, this, func); case BBJ_CALLFINALLYRET: - // No exceptions can occur in this paired block; skip its normal EH successors. + // These are "pseudo-blocks" and control never actually flows into them + // (codegen directly jumps to its successor after finally calls). return func(bbTarget); case BBJ_EHCATCHRET: