From 5afb3cad3a5d842b24b8065a0a83c20493a17fdb Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 1 Jul 2019 21:12:06 -0400 Subject: [PATCH] [netcore] Remove IsByRef check on Reflection.Emit.DynamicMethod Fixes https://github.com/mono/mono/issues/15324 Removed check on the return type being by ref. Commit migrated from https://github.com/mono/mono/commit/d39c84d45f20fac4884ca5e4a3074f1518e8ca8b --- src/mono/netcore/CoreFX.issues.rsp | 6 ------ .../src/System.Reflection.Emit/DynamicMethod.cs | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/mono/netcore/CoreFX.issues.rsp b/src/mono/netcore/CoreFX.issues.rsp index 73eb994..a4155b2 100644 --- a/src/mono/netcore/CoreFX.issues.rsp +++ b/src/mono/netcore/CoreFX.issues.rsp @@ -1121,12 +1121,6 @@ # https://github.com/mono/mono/issues/15323 -nomethod System.Reflection.Emit.Tests.DynamicMethodToString.ToStringTest -# System.ArgumentException : Return type can't be a byref type -# https://github.com/mono/mono/issues/15324 --nomethod System.Reflection.Emit.Tests.DynamicMethodctor1.ByRefReturnType_DoesNotThrow - - - # Expected: typeof(System.ArgumentOutOfRangeException) # Actual: typeof(System.OverflowException): Arithmetic operation resulted in an overflow. # https://github.com/mono/mono/issues/15334 diff --git a/src/mono/netcore/System.Private.CoreLib/src/System.Reflection.Emit/DynamicMethod.cs b/src/mono/netcore/System.Private.CoreLib/src/System.Reflection.Emit/DynamicMethod.cs index e5579b3..e351fa6 100644 --- a/src/mono/netcore/System.Private.CoreLib/src/System.Reflection.Emit/DynamicMethod.cs +++ b/src/mono/netcore/System.Private.CoreLib/src/System.Reflection.Emit/DynamicMethod.cs @@ -109,9 +109,7 @@ namespace System.Reflection.Emit { if (owner == null && typeOwner) throw new ArgumentNullException (nameof (owner)); if ((m == null) && !anonHosted) - throw new ArgumentNullException ("m"); - if (returnType.IsByRef) - throw new ArgumentException ("Return type can't be a byref type", "returnType"); + throw new ArgumentNullException ("m"); if (parameterTypes != null) { for (int i = 0; i < parameterTypes.Length; ++i) if (parameterTypes [i] == null) -- 2.7.4