From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Stoner <10732005+cston@users.noreply.github.com>
Date: Tue, 20 Sep 2022 14:44:06 -0700
Subject: [PATCH] Update compiler version
Backport: https://github.com/dotnet/runtime/pull/75935
---
eng/Versions.props | 2 +-
.../Reflection/RuntimeMethodInfo.CoreCLR.cs | 2 ++
.../System/Reflection/DynamicInvokeInfo.cs | 14 ++++++++---
.../src/System/Reflection/MethodBase.cs | 2 ++
.../Reflection/RuntimeConstructorInfo.cs | 4 ++++
.../System/Reflection/RuntimeMethodInfo.cs | 2 ++
.../src/System/Text/Json/JsonHelpers.cs | 2 +-
.../Utf8JsonWriter.WriteProperties.String.cs | 24 +++++++++++--------
8 files changed, 37 insertions(+), 15 deletions(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index fe8aac648cd..2f16902347b 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -52,7 +52,7 @@
- 4.4.0-3.22452.8
+ 4.4.0-3.22472.1
0.2.0
7.0.100-rc.1.22402.1
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs
index c55ee607da7..4e1246b481b 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs
@@ -316,7 +316,9 @@ public override MethodImplAttributes GetMethodImplementationFlags()
Span shouldCopyBackParameters = new(ref argStorage._copyBack0, 1);
StackAllocatedByRefs byrefStorage = default;
+#pragma warning disable 8500
IntPtr* pByRefStorage = (IntPtr*)&byrefStorage;
+#pragma warning restore 8500
CheckArguments(
copyOfParameters,
diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/DynamicInvokeInfo.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/DynamicInvokeInfo.cs
index 234f8a16e9c..cc3d8c74a60 100644
--- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/DynamicInvokeInfo.cs
+++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/DynamicInvokeInfo.cs
@@ -235,11 +235,15 @@ public DynamicInvokeInfo(MethodBase method, IntPtr invokeThunk)
StackAllocedArguments argStorage = default;
StackAllocatedByRefs byrefStorage = default;
+#pragma warning disable 8500
CheckArguments(ref argStorage._arg0!, (ByReference*)&byrefStorage, parameters, binderBundle);
+#pragma warning restore 8500
try
{
+#pragma warning disable 8500
ret = ref RawCalliHelper.Call(InvokeThunk, (void*)methodToCall, ref thisArg, ref ret, &byrefStorage);
+#pragma warning restore 8500
DebugAnnotations.PreviousCallContainsDebuggerStepInCode();
}
catch (Exception e) when (wrapInTargetInvocationException)
@@ -268,7 +272,9 @@ public DynamicInvokeInfo(MethodBase method, IntPtr invokeThunk)
IntPtr* pStorage = stackalloc IntPtr[2 * argCount];
NativeMemory.Clear(pStorage, (nuint)(2 * argCount) * (nuint)sizeof(IntPtr));
- ByReference* pByRefStorage = (ByReference*)(pStorage + argCount);
+#pragma warning disable 8500
+ void* pByRefStorage = (ByReference*)(pStorage + argCount);
+#pragma warning restore 8500
RuntimeImports.GCFrameRegistration regArgStorage = new(pStorage, (uint)argCount, areByRefs: false);
RuntimeImports.GCFrameRegistration regByRefStorage = new(pByRefStorage, (uint)argCount, areByRefs: true);
@@ -326,7 +332,7 @@ public DynamicInvokeInfo(MethodBase method, IntPtr invokeThunk)
private unsafe void CheckArguments(
ref object copyOfParameters,
- ByReference* byrefParameters,
+ void* byrefParameters,
object?[] parameters,
BinderBundle binderBundle)
{
@@ -398,8 +404,10 @@ public DynamicInvokeInfo(MethodBase method, IntPtr invokeThunk)
Unsafe.Add(ref copyOfParameters, i) = arg!;
- byrefParameters[i] = new ByReference(ref (argumentInfo.Transform & Transform.Reference) != 0 ?
+#pragma warning disable 8500
+ ((ByReference*)byrefParameters)[i] = new ByReference(ref (argumentInfo.Transform & Transform.Reference) != 0 ?
ref Unsafe.As