Skip to content

Commit 0bb8df7

Browse files
authored
[mono][tests] Fix FullAOT runtime generic methods test (#77079)
* get vtable method slot by using its declaring
1 parent afdd009 commit 0bb8df7

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/mono/mono/mini/mini-generic-sharing.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,12 @@ instantiate_info (MonoMemoryManager *mem_manager, MonoRuntimeGenericContextInfoT
22792279
} else {
22802280
ioffset = 0;
22812281
}
2282-
slot = mono_method_get_vtable_slot (info->method);
2282+
2283+
if (info->method->is_generic == 0 && mono_class_is_ginst (info->method->klass)) {
2284+
slot = mono_method_get_vtable_slot (((MonoMethodInflated*)(info->method))->declaring);
2285+
} else {
2286+
slot = mono_method_get_vtable_slot (info->method);
2287+
}
22832288
g_assert (slot != -1);
22842289
g_assert (m_class_get_vtable (info->klass));
22852290
method = m_class_get_vtable (info->klass) [ioffset + slot];
@@ -2329,7 +2334,11 @@ instantiate_info (MonoMemoryManager *mem_manager, MonoRuntimeGenericContextInfoT
23292334
} else {
23302335
ioffset = 0;
23312336
}
2332-
slot = mono_method_get_vtable_slot (info->method);
2337+
if (info->method->is_generic == 0 && mono_class_is_ginst (info->method->klass)) {
2338+
slot = mono_method_get_vtable_slot (((MonoMethodInflated*)(info->method))->declaring);
2339+
} else {
2340+
slot = mono_method_get_vtable_slot (info->method);
2341+
}
23332342
g_assert (slot != -1);
23342343
g_assert (m_class_get_vtable (info->klass));
23352344
method = m_class_get_vtable (info->klass) [ioffset + slot];

src/tests/issues.targets

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,10 +3068,6 @@
30683068
<Issue>https://github.com/dotnet/runtime/issues/57352</Issue>
30693069
</ExcludeList>
30703070

3071-
<ExcludeList Include = "$(XunitTestBinBase)/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained2_gm/**">
3072-
<Issue>https://github.com/dotnet/runtime/issues/57512</Issue>
3073-
</ExcludeList>
3074-
30753071
<ExcludeList Include="$(XunitTestBinBase)/Interop/DisabledRuntimeMarshalling/DisabledRuntimeMarshalling_Disabled_NativeAssemblyEnabled/**">
30763072
<Issue>This test includes an intentionally-invalid UnmanagedCallersOnly method. Invalid UnmanagedCallersOnly methods cause failures at AOT-time.</Issue>
30773073
</ExcludeList>

0 commit comments

Comments
 (0)