From 95a9026f15b6b965ae0e1ff2c4fb5c562aa1ab5e Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Fri, 22 Nov 2024 11:33:42 +0200 Subject: [PATCH] [mono][aot] Mark clauses as dead when replacing method code with exception throw In the final stages of method compilation, when trying to compute clause ranges, we were asserting because the clause bblocks haven't been reached for compilation. --- src/mono/mono/mini/method-to-ir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mono/mono/mini/method-to-ir.c b/src/mono/mono/mini/method-to-ir.c index c874b2179da4e..651ef6e8988c3 100644 --- a/src/mono/mono/mini/method-to-ir.c +++ b/src/mono/mono/mini/method-to-ir.c @@ -6263,6 +6263,9 @@ method_make_alwaysthrow_typeloadfailure (MonoCompile* cfg, MonoClass* klass) mono_link_bblock (cfg, bb, cfg->bb_exit); cfg->disable_inline = TRUE; + + for (guint i = 0; i < cfg->header->num_clauses; i++) + cfg->clause_is_dead [i] = TRUE; } typedef union _MonoOpcodeParameter {