From: EgorBo Date: Wed, 11 Sep 2019 23:03:01 +0000 (+0300) Subject: Fix DynamicMethodToString.ToStringTest X-Git-Tag: submit/tizen/20210909.063632~10331^2~5^2~523 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72318bee60876802b634def97a057aa00038e219;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix DynamicMethodToString.ToStringTest Commit migrated from https://github.com/mono/mono/commit/1d324e617acf855f97c191fb9ae31605e36f68b7 --- diff --git a/src/mono/netcore/CoreFX.issues.rsp b/src/mono/netcore/CoreFX.issues.rsp index 902729e..d18b0f4 100644 --- a/src/mono/netcore/CoreFX.issues.rsp +++ b/src/mono/netcore/CoreFX.issues.rsp @@ -866,10 +866,6 @@ -nomethod System.Reflection.Emit.Tests.DynamicILInfoTests.SetX_NullInput_ThrowsArgumentNullException -nomethod System.Reflection.Emit.Tests.DynamicMethodctor1.InvalidOwner_ThrowsArgumentException -# Exception string is different (Expect System.String vs actual String) -# https://github.com/mono/mono/issues/15323 --nomethod System.Reflection.Emit.Tests.DynamicMethodToString.ToStringTest - # 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/CoreFX.issues_windows.rsp b/src/mono/netcore/CoreFX.issues_windows.rsp index a8696da..d9e7365 100644 --- a/src/mono/netcore/CoreFX.issues_windows.rsp +++ b/src/mono/netcore/CoreFX.issues_windows.rsp @@ -67,4 +67,7 @@ -nomethod System.Xml.Tests.CTransformResolverTest.TC_AbsolutePath_Transform -nomethod System.Tests.StringTests.NormalizationTest -nomethod System.Globalization.Tests.StringNormalizationAllTests.Normalize --nomethod System.Globalization.Tests.StringNormalizationTests.IsNormalized \ No newline at end of file +-nomethod System.Globalization.Tests.StringNormalizationTests.IsNormalized + +# * Assertion at method-to-ir.c:12425, condition `var->opcode == OP_REGOFFSET' not met +-nomethod System.Runtime.Tests.NullableMetadataTests.ShimsHaveOnlyTypeForwards \ No newline at end of file diff --git a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj index d8e6eb5f..474ccc5 100644 --- a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -247,6 +247,7 @@ + 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 cf7fe2b..13589e2 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 @@ -36,6 +36,7 @@ #if MONO_FEATURE_SRE using System; +using System.Text; using System.Reflection; using System.Reflection.Emit; using System.Globalization; @@ -319,14 +320,14 @@ namespace System.Reflection.Emit { } public override string ToString () { - string parms = String.Empty; - ParameterInfo[] p = GetParametersInternal (); - for (int i = 0; i < p.Length; ++i) { - if (i > 0) - parms = parms + ", "; - parms = parms + p [i].ParameterType.Name; - } - return ReturnType.Name+" "+Name+"("+parms+")"; + var sbName = new ValueStringBuilder (MethodNameBufferSize); + sbName.Append (ReturnType.FormatTypeName ()); + sbName.Append (' '); + sbName.Append (Name); + sbName.Append ('('); + AppendParameters (ref sbName, parameters ?? Array.Empty (), CallingConvention); + sbName.Append (')'); + return sbName.ToString (); } public override MethodAttributes Attributes { diff --git a/src/mono/netcore/System.Private.CoreLib/src/System.Runtime.InteropServices/SafeHandle.cs b/src/mono/netcore/System.Private.CoreLib/src/System.Runtime.InteropServices/SafeHandle.cs new file mode 100644 index 0000000..c9910f9 --- /dev/null +++ b/src/mono/netcore/System.Private.CoreLib/src/System.Runtime.InteropServices/SafeHandle.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices +{ + // Mono runtime relies on exact layout + [StructLayout (LayoutKind.Sequential)] + public abstract partial class SafeHandle + { + } +}