Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonojenkins <jo.shields+jenkins@xamarin.com>2022-02-08 00:30:19 +0300
committerGitHub <noreply@github.com>2022-02-08 00:30:19 +0300
commit7b8551f81ed91bd9220bd8935772a4586c8be016 (patch)
treefd60310323700f72bbe9ab7e5999b8feb3c7fcb1
parente3c2771b7004661afb04d568b6e8ae1d2f397a3c (diff)
vtable setup fix for generic default interface methods in mono runtime (#21421)
When processing the overrides from interface default methods we should check if the interface class is a generic type definition first and inflate with the interface class context. Fixes dotnet/runtime#61244 Co-authored-by: bholmes <bholmes@users.noreply.github.com>
-rw-r--r--mono/metadata/class-setup-vtable.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mono/metadata/class-setup-vtable.c b/mono/metadata/class-setup-vtable.c
index 4017e73fea6..685abadeb3d 100644
--- a/mono/metadata/class-setup-vtable.c
+++ b/mono/metadata/class-setup-vtable.c
@@ -1702,11 +1702,11 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
for (int i = 0; i < iface_onum; i++) {
MonoMethod *decl = iface_overrides [i*2];
MonoMethod *override = iface_overrides [i*2 + 1];
- if (decl->is_inflated) {
+ if (mono_class_is_gtd (override->klass)) {
+ override = mono_class_inflate_generic_method_full_checked (override, ic, mono_class_get_context (ic), error);
+ } else if (decl->is_inflated) {
override = mono_class_inflate_generic_method_checked (override, mono_method_get_context (decl), error);
mono_error_assert_ok (error);
- } else if (mono_class_is_gtd (override->klass)) {
- override = mono_class_inflate_generic_method_full_checked (override, ic, mono_class_get_context (ic), error);
}
if (!apply_override (klass, ic, vtable, decl, override, &override_map, &override_class_map, &conflict_map))
goto fail;