Skip to content

Commit

Permalink
[mono] Fix type lookup failure in mono_class_is_subclass_of_internal (d…
Browse files Browse the repository at this point in the history
…otnet#54817)

* Only call mono_class_init_internal if check_interfaces is true.

* Fixes dotnet#54816
  • Loading branch information
uweigand authored Jul 2, 2021
1 parent b862155 commit 5b337cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mono/mono/metadata/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -3523,8 +3523,10 @@ mono_class_is_subclass_of_internal (MonoClass *klass, MonoClass *klassc,
{
MONO_REQ_GC_UNSAFE_MODE;
/* FIXME test for interfaces with variant generic arguments */
mono_class_init_internal (klass);
mono_class_init_internal (klassc);
if (check_interfaces) {
mono_class_init_internal (klass);
mono_class_init_internal (klassc);
}

if (check_interfaces && MONO_CLASS_IS_INTERFACE_INTERNAL (klassc) && !MONO_CLASS_IS_INTERFACE_INTERNAL (klass)) {
if (MONO_CLASS_IMPLEMENTS_INTERFACE (klass, m_class_get_interface_id (klassc)))
Expand Down

0 comments on commit 5b337cb

Please sign in to comment.