Skip to content
Prev Previous commit
Limit looking for ref fields to value types
  • Loading branch information
AaronRobinsonMSFT committed Feb 15, 2022
commit 14d466ded78ba8dabeb143d83e4a3778789fdde4
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/class-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ class_has_ref_fields (MonoClass *klass)
static gboolean
type_has_ref_fields (MonoType *ftype)
{
if (m_type_is_byref (ftype) || class_has_ref_fields (mono_class_from_mono_type_internal (ftype)))
if (m_type_is_byref (ftype) || (MONO_TYPE_ISSTRUCT (ftype) && class_has_ref_fields (mono_class_from_mono_type_internal (ftype))))
return TRUE;

return FALSE;
Expand Down