Skip to content

Commit

Permalink
[mini] Don't add unbox tramopline on generic DIM calls (mono#21208)
Browse files Browse the repository at this point in the history
Don't unbox a valuetype `this` if the generic method is a DIM

Fixes dotnet/runtime#58394

Co-authored-by: lambdageek <[email protected]>
  • Loading branch information
2 people authored and schoudhary-rythmos committed Mar 4, 2022
1 parent fabce0e commit 728fd9b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mono/mini/mini-trampolines.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,13 @@ common_call_trampoline (host_mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVTa
return NULL;

if (generic_virtual || variant_iface) {
if (m_class_is_valuetype (vt->klass)) /*FIXME is this required variant iface?*/
if (m_class_is_valuetype (vt->klass) && !mini_method_is_default_method (m)) /*FIXME is this required variant iface?*/
need_unbox_tramp = TRUE;
} else if (orig_vtable_slot) {
if (m_class_is_valuetype (m->klass))
if (m_class_is_valuetype (m->klass)) {
g_assert (!mini_method_is_default_method (m));
need_unbox_tramp = TRUE;
}
}

addr = mini_add_method_trampoline (m, compiled_method, need_rgctx_tramp, need_unbox_tramp);
Expand Down

0 comments on commit 728fd9b

Please sign in to comment.