diff --git a/src/tools/crossgen2/Common/TypeSystem/Ecma/EcmaSignatureParser.cs b/src/tools/crossgen2/Common/TypeSystem/Ecma/EcmaSignatureParser.cs index 74d604347924..7c8964275a5f 100644 --- a/src/tools/crossgen2/Common/TypeSystem/Ecma/EcmaSignatureParser.cs +++ b/src/tools/crossgen2/Common/TypeSystem/Ecma/EcmaSignatureParser.cs @@ -349,6 +349,24 @@ public MarshalAsDescriptor ParseMarshalAsDescriptor() } } break; + case NativeTypeKind.SafeArray: + { + // There's nobody to consume SafeArrays, so let's just parse the data + // to avoid asserting later. + + // Get optional VARTYPE for the element + if (_reader.RemainingBytes != 0) + { + _reader.ReadCompressedInteger(); + } + + // VARTYPE can be followed by optional type name + if (_reader.RemainingBytes != 0) + { + _reader.ReadSerializedString(); + } + } + break; default: break; } diff --git a/src/tools/crossgen2/Common/TypeSystem/Interop/MarshalAsDescriptor.cs b/src/tools/crossgen2/Common/TypeSystem/Interop/MarshalAsDescriptor.cs index 1e96f56f6cdc..9d5510b17651 100644 --- a/src/tools/crossgen2/Common/TypeSystem/Interop/MarshalAsDescriptor.cs +++ b/src/tools/crossgen2/Common/TypeSystem/Interop/MarshalAsDescriptor.cs @@ -7,7 +7,6 @@ namespace Internal.TypeSystem { - [Flags] public enum NativeTypeKind : byte { Boolean = 0x2, @@ -26,6 +25,7 @@ public enum NativeTypeKind : byte LPTStr = 0x16, // Ptr to OS preferred (SBCS/Unicode) string ByValTStr = 0x17, // OS preferred (SBCS/Unicode) inline string (only valid in structs) Struct = 0x1b, + SafeArray = 0x1d, ByValArray = 0x1e, SysInt = 0x1f, SysUInt = 0x20,