From 12163115994b9b8d0eb00103067c94f1d5e64260 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Strehovsk=C3=BD?= Date: Thu, 23 Jan 2020 20:07:36 +0100 Subject: [PATCH] Match blittability rules in crossgen2 with CoreCLR (#2072) Fixes #483. Structs with pointer-typed fields are blittable. After #1866 we no longer have to worry about the recursion because the code path that recursed into pointed-to types was deleted. --- .../src/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs b/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs index 5efeba7..3b27957 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs @@ -43,16 +43,6 @@ namespace Internal.TypeSystem.Interop continue; } -#if READYTORUN - if (!field.FieldType.IsValueType) - { - // Types with fields of non-value types cannot be blittable - // This check prevents possible infinite recursion where GetMarshallerKind would call back to IsBlittable e.g. for - // the case of classes with pointer members to the class itself. - return false; - } -#endif - MarshallerKind marshallerKind = MarshalHelpers.GetMarshallerKind( field.FieldType, field.GetMarshalAsDescriptor(), -- 2.7.4