Skip to content

Commit 0cd887c

Browse files
[mono] Avoid a JIT assert. (#58127)
Workaround for #57560. Co-authored-by: Zoltan Varga <[email protected]>
1 parent 16e9d33 commit 0cd887c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/mono/mono/mini/method-to-ir.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5324,20 +5324,20 @@ handle_call_res_devirt (MonoCompile *cfg, MonoMethod *cmethod, MonoInst *call_re
53245324
MonoClass *gcomparer = mono_class_get_geqcomparer_class ();
53255325
g_assert (gcomparer);
53265326
gcomparer_inst = mono_class_inflate_generic_class_checked (gcomparer, &ctx, error);
5327-
mono_error_assert_ok (error);
5327+
if (is_ok (error)) {
5328+
MONO_INST_NEW (cfg, typed_objref, OP_TYPED_OBJREF);
5329+
typed_objref->type = STACK_OBJ;
5330+
typed_objref->dreg = alloc_ireg_ref (cfg);
5331+
typed_objref->sreg1 = call_res->dreg;
5332+
typed_objref->klass = gcomparer_inst;
5333+
MONO_ADD_INS (cfg->cbb, typed_objref);
53285334

5329-
MONO_INST_NEW (cfg, typed_objref, OP_TYPED_OBJREF);
5330-
typed_objref->type = STACK_OBJ;
5331-
typed_objref->dreg = alloc_ireg_ref (cfg);
5332-
typed_objref->sreg1 = call_res->dreg;
5333-
typed_objref->klass = gcomparer_inst;
5334-
MONO_ADD_INS (cfg->cbb, typed_objref);
5335+
call_res = typed_objref;
53355336

5336-
call_res = typed_objref;
5337-
5338-
/* Force decompose */
5339-
cfg->flags |= MONO_CFG_NEEDS_DECOMPOSE;
5340-
cfg->cbb->needs_decompose = TRUE;
5337+
/* Force decompose */
5338+
cfg->flags |= MONO_CFG_NEEDS_DECOMPOSE;
5339+
cfg->cbb->needs_decompose = TRUE;
5340+
}
53415341
}
53425342
}
53435343

0 commit comments

Comments
 (0)