Fixes: https://github.com/dotnet/runtime/issues/39493
Turns out the compilation failure here wasn't caused by Managed C++,
it was due to a simple bug in the field RVA copy loop - reading
compressed 16-bit field indices as signed, not unsigned, from the
FieldRVA ECMA metadata table.
Thanks
Tomas
int currentFieldRid;
if (compressedFieldRef)
{
- currentFieldRid = metadataBlob.ReadInt16();
+ currentFieldRid = metadataBlob.ReadUInt16();
}
else
{
int fieldToken;
if (compressedFieldRef)
{
- fieldToken = reader.ReadInt16();
+ fieldToken = reader.ReadUInt16();
}
else
{