From eb6f5764e7945e0fbb8d3921e9194aa594a0b856 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Fri, 29 Dec 2017 05:17:57 -0800 Subject: [PATCH] Remove reflection block on methods with MethodAttributes.RequireSecObject flag (#15663) This is not applicable for CoreCLR since CoreCLR does not have CAS, and this flag was overloaded for other purpose. Fixes #15662 --- src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs | 3 +-- src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs index e7a548e..7c1b0cf 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs @@ -41,8 +41,7 @@ namespace System.Reflection // first take care of all the NO_INVOKE cases. if (declaringType == typeof(void) || (declaringType != null && declaringType.ContainsGenericParameters) || - ((CallingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs) || - ((Attributes & MethodAttributes.RequireSecObject) == MethodAttributes.RequireSecObject)) + ((CallingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs)) { // We don't need other flags if this method cannot be invoked invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_NO_INVOKE; diff --git a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs index 1419175..505838f 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs @@ -43,8 +43,7 @@ namespace System.Reflection if (ContainsGenericParameters || ReturnType.IsByRef || (declaringType != null && declaringType.ContainsGenericParameters) || - ((CallingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs) || - ((Attributes & MethodAttributes.RequireSecObject) == MethodAttributes.RequireSecObject)) + ((CallingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs)) { // We don't need other flags if this method cannot be invoked invocationFlags = INVOCATION_FLAGS.INVOCATION_FLAGS_NO_INVOKE; -- 2.7.4