Skip to content

Commit

Permalink
[mono] Fix crash in common_call_trampoline due to inconsistent rgctx …
Browse files Browse the repository at this point in the history
…mode (#57665)

* Assume MRGCTX mode if mini_method_is_default_method is true

* Fixes #57664
  • Loading branch information
uweigand authored Aug 19, 2021
1 parent 1eed512 commit d952d8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mono/mono/mini/mini-trampolines.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,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 d952d8d

Please sign in to comment.