diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index be0a82964be7..e5890ab52167 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,51 +1,51 @@ - + https://github.com/dotnet/windowsdesktop - a057fddda78b344697d430c536b1457566a4d06f + ae2bcebe032a50af14ac0b05efcaa8477b049834 - + https://github.com/dotnet/windowsdesktop - a057fddda78b344697d430c536b1457566a4d06f + ae2bcebe032a50af14ac0b05efcaa8477b049834 - + https://github.com/dotnet/windowsdesktop - a057fddda78b344697d430c536b1457566a4d06f + ae2bcebe032a50af14ac0b05efcaa8477b049834 - + https://github.com/dotnet/windowsdesktop - a057fddda78b344697d430c536b1457566a4d06f + ae2bcebe032a50af14ac0b05efcaa8477b049834 https://github.com/dotnet/llvm-project 78c9eaec7cec210dfaee9a0443d5816b59683697 - + https://github.com/dotnet/runtime - 915dc2723565b176dfec058665c5f8ecc250479a + 3fed4a3cf41d85d012b1886b0bb7f7be9543a044 - + https://github.com/dotnet/runtime - 915dc2723565b176dfec058665c5f8ecc250479a + 3fed4a3cf41d85d012b1886b0bb7f7be9543a044 - + https://github.com/dotnet/runtime - 915dc2723565b176dfec058665c5f8ecc250479a + 3fed4a3cf41d85d012b1886b0bb7f7be9543a044 - + https://github.com/dotnet/runtime - 915dc2723565b176dfec058665c5f8ecc250479a + 3fed4a3cf41d85d012b1886b0bb7f7be9543a044 - + https://github.com/dotnet/runtime - 915dc2723565b176dfec058665c5f8ecc250479a + 3fed4a3cf41d85d012b1886b0bb7f7be9543a044 - + https://github.com/dotnet/runtime - 915dc2723565b176dfec058665c5f8ecc250479a + 3fed4a3cf41d85d012b1886b0bb7f7be9543a044 @@ -53,38 +53,38 @@ https://github.com/dotnet/core-setup 7d57652f33493fa022125b7f63aad0d70c52d810 - + https://github.com/dotnet/runtime - 915dc2723565b176dfec058665c5f8ecc250479a + 3fed4a3cf41d85d012b1886b0bb7f7be9543a044 - + https://github.com/dotnet/aspnetcore - 931abe3925027a098bddb6174e05e1d9ea6322a4 + 02d62cfea1eaf37670d6f2f4bbceac3c24a357d0 - + https://github.com/dotnet/aspnetcore - 931abe3925027a098bddb6174e05e1d9ea6322a4 + 02d62cfea1eaf37670d6f2f4bbceac3c24a357d0 - + https://github.com/dotnet/aspnetcore - 931abe3925027a098bddb6174e05e1d9ea6322a4 + 02d62cfea1eaf37670d6f2f4bbceac3c24a357d0 - + https://github.com/dotnet/aspnetcore - 931abe3925027a098bddb6174e05e1d9ea6322a4 + 02d62cfea1eaf37670d6f2f4bbceac3c24a357d0 - + https://github.com/dotnet/aspnetcore - 931abe3925027a098bddb6174e05e1d9ea6322a4 + 02d62cfea1eaf37670d6f2f4bbceac3c24a357d0 - + https://github.com/dotnet/aspnetcore - 931abe3925027a098bddb6174e05e1d9ea6322a4 + 02d62cfea1eaf37670d6f2f4bbceac3c24a357d0 - + https://github.com/dotnet/aspnetcore - 931abe3925027a098bddb6174e05e1d9ea6322a4 + 02d62cfea1eaf37670d6f2f4bbceac3c24a357d0 https://github.com/dotnet/test-templates @@ -103,22 +103,22 @@ 4ee20b0c989f7838ecb718621796f3782d922e6e - + https://github.com/dotnet/sdk - 08f335f210068211942c683dc16f31aaea4028d1 + da2c8643020e2bd9f151bef4eb178c59c4052dfc - + https://github.com/dotnet/sdk - 08f335f210068211942c683dc16f31aaea4028d1 + da2c8643020e2bd9f151bef4eb178c59c4052dfc - + https://github.com/dotnet/sdk - 08f335f210068211942c683dc16f31aaea4028d1 + da2c8643020e2bd9f151bef4eb178c59c4052dfc - + https://github.com/dotnet/sdk - 08f335f210068211942c683dc16f31aaea4028d1 + da2c8643020e2bd9f151bef4eb178c59c4052dfc @@ -149,14 +149,14 @@ linker - + https://github.com/dotnet/roslyn - 91902d4dd2c07549fb64357ed5c3a0ee9d7c3610 + 933b669cbcdef04b7350cfb368a95e27ff8eeebb - + https://github.com/dotnet/msbuild - fcc47893800b67cb43c1bd53771426e701505abf + 88f89b1058d1967b7c401c099f4ca550c9d51750 diff --git a/eng/Versions.props b/eng/Versions.props index 7b3bb9a42f7b..9956418c9efa 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,46 +50,46 @@ - 7.0.0-rtm.22477.1 - 7.0.0-rtm.22477.1 - 7.0.0-rtm.22477.1 - 7.0.0-rtm.22477.1 - 7.0.0-rtm.22477.1 - 7.0.0-rtm.22477.1 - 7.0.0-rtm.22477.1 + 7.0.0-rtm.22479.3 + 7.0.0-rtm.22479.3 + 7.0.0-rtm.22479.3 + 7.0.0-rtm.22479.3 + 7.0.0-rtm.22479.3 + 7.0.0-rtm.22479.3 + 7.0.0-rtm.22479.3 0.2.0 - 7.0.100-rtm.22478.5 - 7.0.100-rtm.22478.5 - 7.0.100-rtm.22478.5 + 7.0.100-rtm.22479.10 + 7.0.100-rtm.22479.10 + 7.0.100-rtm.22479.10 $(MicrosoftNETSdkPackageVersion) $(MicrosoftNETSdkPackageVersion) $(MicrosoftNETSdkPackageVersion) - 7.0.0-rtm.22476.12 + 7.0.0-rtm.22478.9 - 7.0.0-rtm.22476.12 - 7.0.0-rtm.22476.12 - 7.0.0-rtm.22476.12 - 7.0.0-rtm.22476.12 - 7.0.0-rtm.22476.12 - 7.0.0-rtm.22476.12 + 7.0.0-rtm.22478.9 + 7.0.0-rtm.22478.9 + 7.0.0-rtm.22478.9 + 7.0.0-rtm.22478.9 + 7.0.0-rtm.22478.9 + 7.0.0-rtm.22478.9 2.1.0 - 7.0.0-rtm.22476.10 - 7.0.0-rtm.22476.10 - 7.0.0-rtm.22476.10 - 7.0.0-rtm.22476.10 + 7.0.0-rtm.22478.5 + 7.0.0-rtm.22478.5 + 7.0.0-rtm.22478.5 + 7.0.0-rtm.22478.5 diff --git a/src/SourceBuild/tarball/patches/msbuild/0001-Updates-to-build-w-latest-roslyn.patch b/src/SourceBuild/tarball/patches/msbuild/0001-Updates-to-build-w-latest-roslyn.patch new file mode 100644 index 000000000000..0869831f0c03 --- /dev/null +++ b/src/SourceBuild/tarball/patches/msbuild/0001-Updates-to-build-w-latest-roslyn.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MichaelSimons +Date: Thu, 29 Sep 2022 19:04:13 +0000 +Subject: [PATCH] Updates to build w/latest roslyn + +Backport: https://github.com/dotnet/installer/pull/14616 +--- + src/StringTools/InternableString.cs | 2 +- + src/StringTools/StringTools.csproj | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/StringTools/InternableString.cs b/src/StringTools/InternableString.cs +index f04d2a9e9..6a2bbcc34 100644 +--- a/src/StringTools/InternableString.cs ++++ b/src/StringTools/InternableString.cs +@@ -33,7 +33,7 @@ namespace Microsoft.NET.StringTools + /// + private int _charIndex; + +- internal Enumerator(ref InternableString str) ++ internal Enumerator(scoped ref InternableString str) + { + _string = str; + _spanIndex = -1; +diff --git a/src/StringTools/StringTools.csproj b/src/StringTools/StringTools.csproj +index fb76d6108..e44f8b3b6 100644 +--- a/src/StringTools/StringTools.csproj ++++ b/src/StringTools/StringTools.csproj +@@ -6,7 +6,6 @@ + true + true + true +- 8.0 + Microsoft.NET.StringTools + true + diff --git a/src/SourceBuild/tarball/patches/roslyn/0002-Lift-System.Memory-version.patch b/src/SourceBuild/tarball/patches/roslyn/0002-Lift-System.Memory-version.patch deleted file mode 100644 index 0614d4884629..000000000000 --- a/src/SourceBuild/tarball/patches/roslyn/0002-Lift-System.Memory-version.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MichaelSimons -Date: Wed, 24 Aug 2022 12:21:13 +0000 -Subject: [PATCH] Lift System.Memory version - -System.Memory version needs to align with the runtime since System.Collections.Immutable is lifted in order to prevent the following situation: -error NU1605: Detected package downgrade: System.Memory from 4.5.5 to 4.5.4. Reference the package directly from the project to select a different version. [/repos/tarball-rc1/src/razor-compiler/artifacts/source-build/self/src/razor-compiler.sln] -error NU1605: Microsoft.CodeAnalysis.Razor -> Microsoft.CodeAnalysis.CSharp 4.4.0 -> Microsoft.CodeAnalysis.Common 4.4.0 -> System.Collections.Immutable 7.0.0-rc.1.22422.23 -> System.Memory (>= 4.5.5) [/repos/tarball-rc1/src/razor-compiler/artifacts/source-build/self/src/razor-compiler.sln] -error NU1605: Microsoft.CodeAnalysis.Razor -> Microsoft.CodeAnalysis.CSharp 4.4.0 -> Microsoft.CodeAnalysis.Common 4.4.0 -> System.Memory (>= 4.5.4) [/repos/tarball-rc1/src/razor-compiler/artifacts/source-build/self/src/razor-compiler.sln] - -Requires https://github.com/dotnet/source-build/issues/2482 in order to eliminate this patch ---- - eng/Versions.props | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/eng/Versions.props b/eng/Versions.props -index 627f9c46824..711593e2a1e 100644 ---- a/eng/Versions.props -+++ b/eng/Versions.props -@@ -214,7 +214,7 @@ - 5.0.0 - 6.0.3 - 5.0.0-preview.8.20407.11 -- 4.5.4 -+ 4.5.5 - 6.0.0 - 6.0.0 - 6.0.1 diff --git a/src/SourceBuild/tarball/patches/runtime/0001-Temporarily-patch-out-native-sourcelink-file-check-i.patch b/src/SourceBuild/tarball/patches/runtime/0001-Temporarily-patch-out-native-sourcelink-file-check-i.patch deleted file mode 100644 index 3d7ba1e1f48a..000000000000 --- a/src/SourceBuild/tarball/patches/runtime/0001-Temporarily-patch-out-native-sourcelink-file-check-i.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Chris Rummel -Date: Wed, 1 Jun 2022 10:10:01 -0500 -Subject: [PATCH 1/5] Temporarily patch out native sourcelink file check in - source-build. This returns source-build to its old behavior. - -Backport: https://github.com/dotnet/source-build/issues/2883 ---- - src/coreclr/runtime-prereqs.proj | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/coreclr/runtime-prereqs.proj b/src/coreclr/runtime-prereqs.proj -index 5d660044a09..b2abc4415a6 100644 ---- a/src/coreclr/runtime-prereqs.proj -+++ b/src/coreclr/runtime-prereqs.proj -@@ -6,7 +6,7 @@ - $(ArtifactsObjDir)runtime_version.h - $(ArtifactsObjDir)native.sourcelink.json - false -- true -+ true - .NET Runtime - - diff --git a/src/SourceBuild/tarball/patches/runtime/0003-Update-compiler-version.patch b/src/SourceBuild/tarball/patches/runtime/0003-Update-compiler-version.patch new file mode 100644 index 000000000000..e26213b6bbbb --- /dev/null +++ b/src/SourceBuild/tarball/patches/runtime/0003-Update-compiler-version.patch @@ -0,0 +1,311 @@ +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(ref Unsafe.Add(ref copyOfParameters, i)) : ref arg.GetRawData()); ++#pragma warning restore 8500 + } + } + +diff --git a/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBase.cs b/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBase.cs +index 13ff9e34df9..98069a70ef5 100644 +--- a/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBase.cs ++++ b/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBase.cs +@@ -236,6 +236,7 @@ BindingFlags invokeAttr + shouldCopyBack[i] = copyBackArg; + copyOfParameters[i] = arg; + ++#pragma warning disable 8500 + if (isValueType) + { + #if !MONO // Temporary until Mono is updated. +@@ -254,6 +255,7 @@ BindingFlags invokeAttr + ByReference objRef = ByReference.Create(ref copyOfParameters[i]); + *(ByReference*)(byrefParameters + i) = objRef; + } ++#pragma warning restore 8500 + } + } + +diff --git a/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.cs +index b1f3222736a..1fd9c177ddb 100644 +--- a/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.cs ++++ b/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.cs +@@ -146,7 +146,9 @@ internal void ThrowNoInvokeException() + Span shouldCopyBackParameters = new(ref argStorage._copyBack0, argCount); + + StackAllocatedByRefs byrefStorage = default; ++#pragma warning disable 8500 + IntPtr* pByRefStorage = (IntPtr*)&byrefStorage; ++#pragma warning restore 8500 + + CheckArguments( + copyOfParameters, +@@ -299,7 +301,9 @@ public override object Invoke(BindingFlags invokeAttr, Binder? binder, object?[] + Span shouldCopyBackParameters = new(ref argStorage._copyBack0, argCount); + + StackAllocatedByRefs byrefStorage = default; ++#pragma warning disable 8500 + IntPtr* pByRefStorage = (IntPtr*)&byrefStorage; ++#pragma warning restore 8500 + + CheckArguments( + copyOfParameters, +diff --git a/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs +index 770a59d40eb..bf534c58e70 100644 +--- a/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs ++++ b/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs +@@ -143,7 +143,9 @@ private void ThrowNoInvokeException() + Span shouldCopyBackParameters = new(ref argStorage._copyBack0, argCount); + + StackAllocatedByRefs byrefStorage = default; ++#pragma warning disable 8500 + IntPtr* pByRefStorage = (IntPtr*)&byrefStorage; ++#pragma warning restore 8500 + + CheckArguments( + copyOfParameters, +diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.cs +index 9e9adcd0a52..4706b64753c 100644 +--- a/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.cs ++++ b/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.cs +@@ -15,7 +15,7 @@ internal static partial class JsonHelpers + /// Returns the span for the given reader. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] +- public static ReadOnlySpan GetSpan(this ref Utf8JsonReader reader) ++ public static ReadOnlySpan GetSpan(this scoped ref Utf8JsonReader reader) + { + return reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan; + } +diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.String.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.String.cs +index 65c6fd303c1..7cd0e3b45a4 100644 +--- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.String.cs ++++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.String.cs +@@ -112,12 +112,12 @@ private void WriteStringEscapeProperty(scoped ReadOnlySpan propertyName, i + Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); + + char[]? propertyArray = null; ++ scoped Span escapedPropertyName; + + if (firstEscapeIndexProp != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndexProp); + +- scoped Span escapedPropertyName; + if (length > JsonConstants.StackallocCharThreshold) + { + propertyArray = ArrayPool.Shared.Rent(length); +@@ -269,12 +269,12 @@ private void WriteStringEscapeProperty(scoped ReadOnlySpan utf8PropertyNam + Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); + + byte[]? propertyArray = null; ++ scoped Span escapedPropertyName; + + if (firstEscapeIndexProp != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(utf8PropertyName.Length, firstEscapeIndexProp); + +- scoped Span escapedPropertyName; + if (length > JsonConstants.StackallocByteThreshold) + { + propertyArray = ArrayPool.Shared.Rent(length); +@@ -1076,12 +1076,12 @@ private void WriteStringEscapePropertyOrValue(scoped ReadOnlySpan property + + char[]? valueArray = null; + char[]? propertyArray = null; ++ scoped Span escapedValue; + + if (firstEscapeIndexVal != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(value.Length, firstEscapeIndexVal); + +- scoped Span escapedValue; + if (length > JsonConstants.StackallocCharThreshold) + { + valueArray = ArrayPool.Shared.Rent(length); +@@ -1096,11 +1096,12 @@ private void WriteStringEscapePropertyOrValue(scoped ReadOnlySpan property + value = escapedValue.Slice(0, written); + } + ++ scoped Span escapedPropertyName; ++ + if (firstEscapeIndexProp != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndexProp); + +- scoped Span escapedPropertyName; + if (length > JsonConstants.StackallocCharThreshold) + { + propertyArray = ArrayPool.Shared.Rent(length); +@@ -1135,12 +1136,12 @@ private void WriteStringEscapePropertyOrValue(scoped ReadOnlySpan utf8Prop + + byte[]? valueArray = null; + byte[]? propertyArray = null; ++ scoped Span escapedValue; + + if (firstEscapeIndexVal != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(utf8Value.Length, firstEscapeIndexVal); + +- scoped Span escapedValue; + if (length > JsonConstants.StackallocByteThreshold) + { + valueArray = ArrayPool.Shared.Rent(length); +@@ -1155,11 +1156,12 @@ private void WriteStringEscapePropertyOrValue(scoped ReadOnlySpan utf8Prop + utf8Value = escapedValue.Slice(0, written); + } + ++ scoped Span escapedPropertyName; ++ + if (firstEscapeIndexProp != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(utf8PropertyName.Length, firstEscapeIndexProp); + +- scoped Span escapedPropertyName; + if (length > JsonConstants.StackallocByteThreshold) + { + propertyArray = ArrayPool.Shared.Rent(length); +@@ -1194,12 +1196,12 @@ private void WriteStringEscapePropertyOrValue(scoped ReadOnlySpan property + + byte[]? valueArray = null; + char[]? propertyArray = null; ++ scoped Span escapedValue; + + if (firstEscapeIndexVal != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(utf8Value.Length, firstEscapeIndexVal); + +- scoped Span escapedValue; + if (length > JsonConstants.StackallocByteThreshold) + { + valueArray = ArrayPool.Shared.Rent(length); +@@ -1214,11 +1216,12 @@ private void WriteStringEscapePropertyOrValue(scoped ReadOnlySpan property + utf8Value = escapedValue.Slice(0, written); + } + ++ scoped Span escapedPropertyName; ++ + if (firstEscapeIndexProp != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndexProp); + +- scoped Span escapedPropertyName; + if (length > JsonConstants.StackallocCharThreshold) + { + propertyArray = ArrayPool.Shared.Rent(length); +@@ -1253,12 +1256,12 @@ private void WriteStringEscapePropertyOrValue(scoped ReadOnlySpan utf8Prop + + char[]? valueArray = null; + byte[]? propertyArray = null; ++ scoped Span escapedValue; + + if (firstEscapeIndexVal != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(value.Length, firstEscapeIndexVal); + +- scoped Span escapedValue; + if (length > JsonConstants.StackallocCharThreshold) + { + valueArray = ArrayPool.Shared.Rent(length); +@@ -1273,11 +1276,12 @@ private void WriteStringEscapePropertyOrValue(scoped ReadOnlySpan utf8Prop + value = escapedValue.Slice(0, written); + } + ++ scoped Span escapedPropertyName; ++ + if (firstEscapeIndexProp != -1) + { + int length = JsonWriterHelper.GetMaxEscapedLength(utf8PropertyName.Length, firstEscapeIndexProp); + +- scoped Span escapedPropertyName; + if (length > JsonConstants.StackallocByteThreshold) + { + propertyArray = ArrayPool.Shared.Rent(length);