Skip to content

Commit

Permalink
Fix crash in common_call_trampoline due to inconsistent rgctx mode
Browse files Browse the repository at this point in the history
* Assume MRGCTX mode if mini_method_is_default_method is true

* Fixes dotnet/runtime#57664

* Backport of https://github.com/dotnet/runtime/pull/57665`
  • Loading branch information
bholmes committed Oct 15, 2021
1 parent 8266c56 commit 58edb21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mono/mini/mini-trampolines.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ common_call_trampoline (host_mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVTa
/*
* The caller is gshared code, compute the actual method to call from M and this/rgctx.
*/
if (m->is_inflated && mono_method_get_context (m)->method_inst) {
if (m->is_inflated && (mono_method_get_context (m)->method_inst || mini_method_is_default_method (m))) {
MonoMethodRuntimeGenericContext *mrgctx = (MonoMethodRuntimeGenericContext*)mono_arch_find_static_call_vtable (regs, code);

klass = mrgctx->class_vtable->klass;
Expand Down

0 comments on commit 58edb21

Please sign in to comment.