Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address PR feedback
  • Loading branch information
kg committed Jul 10, 2024
commit ff1138cf746f20b60c7cc86bf7318fcaefea5f73
6 changes: 3 additions & 3 deletions src/mono/mono/metadata/class-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -4255,9 +4255,9 @@ build_variance_search_table_inner (MonoClass *klass, MonoClass **buf, int buf_si
static void
build_variance_search_table (MonoClass *klass) {
// FIXME: Is there a way to deterministically compute the right capacity?
int buf_size = 512, buf_count = 0;
MonoClass **buf = g_alloca (buf_size * sizeof(MonoClass *)),
**result = NULL;
int buf_size = m_class_get_interface_offsets_count (klass), buf_count = 0;
MonoClass **buf = g_alloca (buf_size * sizeof(MonoClass *));
MonoClass **result = NULL;
memset (buf, 0, buf_size * sizeof(MonoClass *));
build_variance_search_table_inner (klass, buf, buf_size, &buf_count, klass);

Expand Down
3 changes: 3 additions & 0 deletions src/mono/mono/metadata/class-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,9 @@ mono_class_has_default_constructor (MonoClass *klass, gboolean public_only);
gboolean
mono_method_has_unmanaged_callers_only_attribute (MonoMethod *method);

void
mono_class_get_variance_search_table (MonoClass *klass, MonoClass ***table, int *table_size);

// There are many ways to do on-demand initialization.
// Some allow multiple concurrent initializations. Some do not.
// Some allow multiple concurrent writes to the global. Some do not.
Expand Down
2 changes: 0 additions & 2 deletions src/native/public/mono/metadata/details/class-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_delegate, (Mono

MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_implements_interface, (MonoClass* klass, MonoClass* iface))

MONO_API_FUNCTION(void, mono_class_get_variance_search_table, (MonoClass *klass, MonoClass ***table, int *table_size));

/* MonoClassField accessors */
MONO_API_FUNCTION(const char*, mono_field_get_name, (MonoClassField *field))

Expand Down
2 changes: 1 addition & 1 deletion src/tests/Regressions/coreclr/103365/103365.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/*
https://github.com/dotnet/runtime/issues/103365
When using an interface with a generic out type, an explicit implementation, and a derived class, the base classes implementation is called instead of the derived class when running on Android. Running on Windows yields the expected behavior.
When using an interface with a generic out type, an explicit implementation, and a derived class, the base classes implementation is called instead of the derived class when running on Mono; CoreCLR has the expected behavior.
*/

using System;
Expand Down