diff --git a/reflect/Reader/Method.cs b/reflect/Reader/Method.cs index cf6484b5..b9a258bf 100644 --- a/reflect/Reader/Method.cs +++ b/reflect/Reader/Method.cs @@ -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.Array, null)); + } return list; }