Browse Source

Add finish support for MarshalInfo in MetadataLoader

pull/1198/head
Siegfried Pammer 8 years ago
parent
commit
5864016e98
  1. 11
      ICSharpCode.Decompiler/TypeSystem/MetadataLoader.cs

11
ICSharpCode.Decompiler/TypeSystem/MetadataLoader.cs

@ -613,7 +613,7 @@ namespace ICSharpCode.Decompiler.TypeSystem
void AddMarshalInfo(BlobHandle marshalInfo, IList<IUnresolvedAttribute> target) void AddMarshalInfo(BlobHandle marshalInfo, IList<IUnresolvedAttribute> target)
{ {
if (marshalInfo.IsNil) return; if (marshalInfo.IsNil) return;
target.Add(ConvertMarshalInfo(currentMetadata.GetBlobReader(marshalInfo)));
} }
IUnresolvedAttribute ConvertMarshalInfo(System.Reflection.Metadata.BlobReader marshalInfo) IUnresolvedAttribute ConvertMarshalInfo(System.Reflection.Metadata.BlobReader marshalInfo)
@ -627,9 +627,12 @@ namespace ICSharpCode.Decompiler.TypeSystem
case 0x1e: // FixedArray case 0x1e: // FixedArray
if (!marshalInfo.TryReadCompressedInteger(out size)) if (!marshalInfo.TryReadCompressedInteger(out size))
size = 0; size = 0;
type = marshalInfo.ReadByte(); attr.AddNamedFieldArgument("SizeConst", CreateSimpleConstantValue(KnownTypeReference.Int32, size));
if (type != 0x66) // None if (marshalInfo.RemainingBytes > 0) {
attr.AddNamedFieldArgument("ArraySubType", CreateSimpleConstantValue(unmanagedTypeTypeRef, type)); type = marshalInfo.ReadByte();
if (type != 0x66) // None
attr.AddNamedFieldArgument("ArraySubType", CreateSimpleConstantValue(unmanagedTypeTypeRef, type));
}
break; break;
case 0x1d: // SafeArray case 0x1d: // SafeArray
if (marshalInfo.RemainingBytes > 0) { if (marshalInfo.RemainingBytes > 0) {

Loading…
Cancel
Save