You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[release/7.0] [mono] Assert that we don't need to inflate types when applying DIM overrides (#74519)
* do we need to inflate here? it seems like we always get the right class
* use member access, not type punning
* Add regression test for #70190
* Assert code from #64102 is unreachable
In #64102 (comment)
we concluded that this branch is never taken.
* Assert that overrides are already inflated how we expect
* try to enable some disabled DIM tests
* remove unused var
* Don't assert - code is reachable, there's just nothing to do
* Add link to issue for failing tests
Co-authored-by: Aleksey Kliger <[email protected]>
Co-authored-by: Aleksey Kliger <[email protected]>
// there used to be code here to inflate decl if decl->is_inflated, but in https://github.com/dotnet/runtime/pull/64102#discussion_r790019545 we
1761
+
// think that this does not correspond to any real code.
1778
1762
if (!apply_override (klass, ic, vtable, decl, override, &override_map, &override_class_map, &conflict_map))
1779
1763
goto fail;
1780
1764
}
@@ -1786,6 +1770,18 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
1786
1770
MonoMethod*decl=overrides [i*2];
1787
1771
MonoMethod*override=overrides [i*2+1];
1788
1772
if (MONO_CLASS_IS_INTERFACE_INTERNAL (decl->klass)) {
1773
+
/*
1774
+
* We expect override methods that are part of a generic definition, to have
1775
+
* their parent class be the actual interface/class containing the override,
1776
+
* i.e.
1777
+
*
1778
+
* IFace<T> in:
1779
+
* class Foo<T> : IFace<T>
1780
+
*
1781
+
* This is needed so the mono_class_is_assignable_from_internal () calls in the
1782
+
* conflict resolution work.
1783
+
*/
1784
+
g_assert (override->klass==klass);
1789
1785
if (!apply_override (klass, klass, vtable, decl, override, &override_map, &override_class_map, &conflict_map))
0 commit comments