Created
October 22, 2021 22:57
-
-
Save vargaz/2ded43b6598b9e2e117325eeed4cf6f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/mono/mono/mini/mini-exceptions.c b/src/mono/mono/mini/mini-exceptions.c | |
index fa139ec6668..20347c62dd2 100644 | |
--- a/src/mono/mono/mini/mini-exceptions.c | |
+++ b/src/mono/mono/mini/mini-exceptions.c | |
@@ -840,12 +840,13 @@ mono_get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_inf | |
method = jinfo_get_method (ji); | |
g_assert (method->is_inflated); | |
- if (mono_method_get_context (method)->method_inst) { | |
+ if (mono_method_get_context (method)->method_inst || mini_method_is_default_method (method)) { | |
MonoMethodRuntimeGenericContext *mrgctx = (MonoMethodRuntimeGenericContext *)generic_info; | |
klass = mrgctx->class_vtable->klass; | |
context.method_inst = mrgctx->method_inst; | |
- g_assert (context.method_inst); | |
+ if (!mini_method_is_default_method (method)) | |
+ g_assert (context.method_inst); | |
} else { | |
MonoVTable *vtable = (MonoVTable *)generic_info; | |
@@ -858,6 +859,12 @@ mono_get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_inf | |
else | |
method_container_class = method->klass; | |
+ if (mini_method_is_default_method (method)) { | |
+ if (mono_class_is_ginst (klass) || mono_class_is_gtd (klass)) | |
+ context.class_inst = mini_class_get_context (klass)->class_inst; | |
+ return context; | |
+ } | |
+ | |
/* class might refer to a subclass of method's class */ | |
while (!(klass == method->klass || (mono_class_is_ginst (klass) && mono_class_get_generic_class (klass)->container_class == method_container_class))) { | |
klass = m_class_get_parent (klass); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment