diff --git a/src/mono/mono/mini/method-to-ir.c b/src/mono/mono/mini/method-to-ir.c index b3df7ddac3d31..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 { @@ -12112,13 +12115,12 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b break; case MONO_CEE_INITOBJ: klass = mini_get_class (method, token, generic_context); + --sp; if (CLASS_HAS_FAILURE (klass)) { HANDLE_TYPELOAD_ERROR (cfg, klass); inline_costs += 10; break; // reached only in AOT } - - --sp; if (mini_class_is_reference (klass)) MONO_EMIT_NEW_STORE_MEMBASE_IMM (cfg, OP_STORE_MEMBASE_IMM, sp [0]->dreg, 0, 0);