From edc1022c30c10447dd7bd0e7c68e255b348c67ac Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Fri, 19 Jan 2024 19:02:09 -0800 Subject: [PATCH] Add additional assert for throw helper blocks --- src/coreclr/jit/fgdiagnostic.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/coreclr/jit/fgdiagnostic.cpp b/src/coreclr/jit/fgdiagnostic.cpp index 1b8ed455ae5a67..0cf403abd8aa91 100644 --- a/src/coreclr/jit/fgdiagnostic.cpp +++ b/src/coreclr/jit/fgdiagnostic.cpp @@ -3195,6 +3195,15 @@ void Compiler::fgDebugCheckBBlist(bool checkBBNum /* = false */, bool checkBBRef assert(genReturnBB->KindIs(BBJ_RETURN)); } + // Ensure that all throw helper blocks are currently in the block list. + for (Compiler::AddCodeDsc* add = fgAddCodeList; add != nullptr; add = add->acdNext) + { + if (add->acdUsed) + { + assert(add->acdDstBlk->bbTraversalStamp == curTraversalStamp); + } + } + // If this is an inlinee, we're done checking. if (compIsForInlining()) {