Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Avoid assert if there's SafeArray marshalling #27036

Merged
merged 1 commit into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 18 additions & 0 deletions src/tools/crossgen2/Common/TypeSystem/Ecma/EcmaSignatureParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace Internal.TypeSystem
{
[Flags]
public enum NativeTypeKind : byte
{
Boolean = 0x2,
Expand All @@ -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,
Expand Down