Bug fix. MethodInfo should return PreserveSigAttribute pseudo custom attribute if MethodImplAttributes.PreserveSig is set.

This commit is contained in:
jfrijters 2012-07-13 13:18:07 +00:00
Родитель 262a07cd5f
Коммит ca7a94e446
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -240,6 +240,13 @@ namespace IKVM.Reflection.Reader
{
CreateDllImportPseudoCustomAttribute(list);
}
if ((GetMethodImplementationFlags() & MethodImplAttributes.PreserveSig) != 0
&& (attributeType == null || attributeType.IsAssignableFrom(module.universe.System_Runtime_InteropServices_PreserveSigAttribute)))
{
Type type = module.universe.System_Runtime_InteropServices_PreserveSigAttribute;
ConstructorInfo constructor = type.GetPseudoCustomAttributeConstructor();
list.Add(new CustomAttributeData(module, constructor, Empty<object>.Array, null));
}
return list;
}