diff options
author | Aleksey Kliger (λgeek) <alklig@microsoft.com> | 2022-02-08 00:30:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-08 00:30:32 +0300 |
commit | 6171c871809181c4e161ed0c27acfff218b2da3c (patch) | |
tree | 9884fef412b974f7878e2a1b54898dc543cd8c54 | |
parent | 148f536b0b463a111a021b960ee3aeaed0cf203b (diff) |
vtable setup fix for generic default interface methods in mono runtime (#21422)mono-6.12.0.170
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-init.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mono/metadata/class-init.c b/mono/metadata/class-init.c index 6c3664f2c8c..ca6da9536e9 100644 --- a/mono/metadata/class-init.c +++ b/mono/metadata/class-init.c @@ -3033,11 +3033,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; |