Imported Upstream version 5.8.0.22

Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-10-19 20:04:20 +00:00
parent 5f4a27cc8a
commit 7d05485754
5020 changed files with 114082 additions and 186061 deletions

View File

@ -257,6 +257,9 @@ namespace System.Reflection.Emit
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void basic_init (AssemblyBuilder ab);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
static extern void UpdateNativeCustomAttributes (AssemblyBuilder ab);
/* Keep this in sync with codegen.cs in mcs */
private const AssemblyBuilderAccess COMPILER_ACCESS = (AssemblyBuilderAccess) 0x800;
@ -949,6 +952,12 @@ namespace System.Reflection.Emit
cattrs = new CustomAttributeBuilder [1];
cattrs [0] = customBuilder;
}
/*
Only update the native list of custom attributes if we're adding one that is known to change dynamic execution behavior.
*/
if (customBuilder.Ctor != null && customBuilder.Ctor.DeclaringType == typeof (System.Runtime.CompilerServices.RuntimeCompatibilityAttribute))
UpdateNativeCustomAttributes (this);
}
[ComVisible (true)]