Skip to content

Commit

Permalink
[mono][aot] Fix stack state when emitting type load throw
Browse files Browse the repository at this point in the history
Method compilation was continuing and we ended up failing with invalid IL.
  • Loading branch information
BrzVlad committed Nov 29, 2024
1 parent b0f058b commit a9f7461
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/mono/mono/mini/method-to-ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -12112,13 +12112,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);
Expand Down

0 comments on commit a9f7461

Please sign in to comment.