From f831e852ff62d0503bb2882be149dca7cedf80d1 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Wed, 29 Oct 2025 01:03:43 -0700 Subject: [PATCH 1/3] Add RequiresUnsafeAttribute and start annotating corelib --- .../System.Private.CoreLib.csproj | 1 + src/libraries/Directory.Build.props | 1 + .../System.Private.CoreLib.Shared.projitems | 1 + .../src/System/Buffers/SharedArrayPool.cs | 10 ++++-- .../src/System/Delegate.cs | 10 ++++-- .../CodeAnalysis/RequiresUnsafeAttribute.cs | 18 ++++++++++ .../src/System/Memory.cs | 12 +++++-- .../src/System/MemoryExtensions.cs | 5 ++- .../src/System/ReadOnlyMemory.cs | 21 ++++++++---- .../CompilerServices/ConditionalWeakTable.cs | 5 ++- .../System/Runtime/CompilerServices/Unsafe.cs | 1 + .../AsciiStringSearchValuesTeddyBase.cs | 33 ++++++++++++------- .../src/System/Threading/Tasks/Task.cs | 5 ++- .../src/System/Threading/Tasks/ValueTask.cs | 15 +++++++-- .../Microsoft.NET.ILLink.Analyzers.props | 1 + 15 files changed, 109 insertions(+), 30 deletions(-) create mode 100644 src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/RequiresUnsafeAttribute.cs diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj index c12d6c854ac0..d7ac59703f4b 100644 --- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -22,6 +22,7 @@ true true true + true diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 33938989e386..1c0841e0fe91 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -50,6 +50,7 @@ annotations true + true diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index d3b69efe615e..a312398fab0f 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -286,6 +286,7 @@ + diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs index ad4488005dac..da600c91337e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs @@ -60,7 +60,10 @@ public override T[] Rent(int minimumLength) SharedArrayPoolThreadLocalArray[]? tlsBuckets = t_tlsBuckets; if (tlsBuckets is not null && (uint)bucketIndex < (uint)tlsBuckets.Length) { - buffer = Unsafe.As(tlsBuckets[bucketIndex].Array); + unsafe + { + buffer = Unsafe.As(tlsBuckets[bucketIndex].Array); + } if (buffer is not null) { tlsBuckets[bucketIndex].Array = null; @@ -79,7 +82,10 @@ public override T[] Rent(int minimumLength) SharedArrayPoolPartitions? b = perCoreBuckets[bucketIndex]; if (b is not null) { - buffer = Unsafe.As(b.TryPop()); + unsafe + { + buffer = Unsafe.As(b.TryPop()); + } if (buffer is not null) { if (log.IsEnabled()) diff --git a/src/libraries/System.Private.CoreLib/src/System/Delegate.cs b/src/libraries/System.Private.CoreLib/src/System/Delegate.cs index 6efa9f48554f..6ba2252a52bf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Delegate.cs @@ -128,9 +128,15 @@ public TDelegate Current public bool MoveNext() { int index = _index + 1; - if ((_current = Unsafe.As(_delegate?.TryGetAt(index))) == null) + unsafe { - return false; + unsafe + { + if ((_current = Unsafe.As(_delegate?.TryGetAt(index))) == null) + { + return false; + } + } } _index = index; return true; diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/RequiresUnsafeAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/RequiresUnsafeAttribute.cs new file mode 100644 index 000000000000..1b30230d95c7 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/RequiresUnsafeAttribute.cs @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Diagnostics.CodeAnalysis +{ + /// + /// Indicates that the specified method requires dynamic access to code that is not referenced + /// statically, for example through . + /// + /// + /// This allows tools to understand which methods are unsafe to call when removing unreferenced + /// code from an application. + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + internal sealed class RequiresUnsafeAttribute : Attribute + { + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Memory.cs b/src/libraries/System.Private.CoreLib/src/System/Memory.cs index c8eac110cb52..b37ef4260a6b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Memory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Memory.cs @@ -284,8 +284,11 @@ public Span Span { // Special-case string since it's the most common for ROM. - refToReturn = ref Unsafe.As(ref ((string)tmpObject).GetRawStringData()); - lengthOfUnderlyingSpan = Unsafe.As(tmpObject).Length; + unsafe + { + refToReturn = ref Unsafe.As(ref ((string)tmpObject).GetRawStringData()); + lengthOfUnderlyingSpan = Unsafe.As(tmpObject).Length; + } } else if (RuntimeHelpers.ObjectHasComponentSize(tmpObject)) { @@ -379,6 +382,11 @@ public Span Span /// /// An instance with nonprimitive (non-blittable) members cannot be pinned. /// + /// + /// To use this method safely, the target must not be torn while the + /// returned is in use. + /// + [RequiresUnsafe] public unsafe MemoryHandle Pin() { // Just like the Span property getter, we have special support for a mutable Memory diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs index 9687896e6fc6..8ead6e27e160 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs @@ -5905,7 +5905,10 @@ internal SpanSplitEnumerator(ReadOnlySpan source, ReadOnlySpan separators) _source = source; if (typeof(T) == typeof(char) && separators.Length == 0) { - _searchValues = Unsafe.As>(string.SearchValuesStorage.WhiteSpaceChars); + unsafe + { + _searchValues = Unsafe.As>(string.SearchValuesStorage.WhiteSpaceChars); + } _splitMode = SpanSplitEnumeratorMode.SearchValues; } else diff --git a/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs b/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs index 85e4feace8cd..7ad6d2af92ef 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs @@ -206,8 +206,11 @@ public ReadOnlySpan Span { // Special-case string since it's the most common for ROM. - refToReturn = ref Unsafe.As(ref ((string)tmpObject).GetRawStringData()); - lengthOfUnderlyingSpan = Unsafe.As(tmpObject).Length; + unsafe + { + refToReturn = ref Unsafe.As(ref ((string)tmpObject).GetRawStringData()); + lengthOfUnderlyingSpan = Unsafe.As(tmpObject).Length; + } } else if (RuntimeHelpers.ObjectHasComponentSize(tmpObject)) { @@ -223,8 +226,11 @@ public ReadOnlySpan Span // 'tmpObject is T[]' below also handles things like int[] <-> uint[] being convertible Debug.Assert(tmpObject is T[]); - refToReturn = ref MemoryMarshal.GetArrayDataReference(Unsafe.As(tmpObject)); - lengthOfUnderlyingSpan = Unsafe.As(tmpObject).Length; + unsafe + { + refToReturn = ref MemoryMarshal.GetArrayDataReference(Unsafe.As(tmpObject)); + lengthOfUnderlyingSpan = Unsafe.As(tmpObject).Length; + } } else { @@ -235,8 +241,11 @@ public ReadOnlySpan Span // constructor or other public API which would allow such a conversion. Debug.Assert(tmpObject is MemoryManager); - Span memoryManagerSpan = Unsafe.As>(tmpObject).GetSpan(); - refToReturn = ref MemoryMarshal.GetReference(memoryManagerSpan); + unsafe + { + Span memoryManagerSpan = Unsafe.As>(tmpObject).GetSpan(); + refToReturn = ref MemoryMarshal.GetReference(memoryManagerSpan); + } lengthOfUnderlyingSpan = memoryManagerSpan.Length; } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs index bdbb94609cd6..044f8647baa6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs @@ -711,7 +711,10 @@ internal bool Remove(TKey key, [MaybeNullWhen(false)] out TValue value) if (entryIndex != -1) { RemoveIndex(entryIndex); - value = Unsafe.As(valueObject!); + unsafe + { + value = Unsafe.As(valueObject!); + } return true; } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs index 154cd64a421e..09e395994506 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs @@ -63,6 +63,7 @@ public static int SizeOf() // Mono:As [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] [return: NotNullIfNotNull(nameof(o))] public static T? As(object? o) where T : class? { diff --git a/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/AsciiStringSearchValuesTeddyBase.cs b/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/AsciiStringSearchValuesTeddyBase.cs index b764e3a22d81..2cb026919f9e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/AsciiStringSearchValuesTeddyBase.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/AsciiStringSearchValuesTeddyBase.cs @@ -560,11 +560,14 @@ private bool TryFindMatch(ReadOnlySpan span, ref char searchSpace, Vector1 object? bucket = _buckets[candidateOffset]; Debug.Assert(bucket is not null); - if (TBucketized.Value - ? StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket)) - : StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket))) + unsafe { - return true; + if (TBucketized.Value + ? StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket)) + : StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket))) + { + return true; + } } candidateMask = BitOperations.ResetLowestSetBit(candidateMask); @@ -605,11 +608,14 @@ private bool TryFindMatch(ReadOnlySpan span, ref char searchSpace, Vector2 object? bucket = _buckets[candidateOffset]; Debug.Assert(bucket is not null); - if (TBucketized.Value - ? StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket)) - : StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket))) + unsafe { - return true; + if (TBucketized.Value + ? StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket)) + : StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket))) + { + return true; + } } candidateMask = BitOperations.ResetLowestSetBit(candidateMask); @@ -650,11 +656,14 @@ private bool TryFindMatch(ReadOnlySpan span, ref char searchSpace, Vector5 object? bucket = _buckets[candidateOffset]; Debug.Assert(bucket is not null); - if (TBucketized.Value - ? StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket)) - : StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket))) + unsafe { - return true; + if (TBucketized.Value + ? StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket)) + : StartsWith(ref matchRef, lengthRemaining, Unsafe.As(bucket))) + { + return true; + } } candidateMask = BitOperations.ResetLowestSetBit(candidateMask); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs index 1cd3b2e3b540..70e778010cde 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs @@ -6743,7 +6743,10 @@ private static Task WhenAny(IEnumerable tasks) where TTask // since if argument was strongly-typed as an array, it would have bound to the array-based overload. if (tasks.GetType() == typeof(List)) { - return WhenAnyCore((ReadOnlySpan)CollectionsMarshal.AsSpan(Unsafe.As>(tasks))); + unsafe + { + return WhenAnyCore((ReadOnlySpan)CollectionsMarshal.AsSpan(Unsafe.As>(tasks))); + } } if (tasks is TTask[] tasksAsArray) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ValueTask.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ValueTask.cs index 90f86c68159c..5de25750326e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ValueTask.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ValueTask.cs @@ -762,7 +762,10 @@ public bool IsFaulted return t.IsFaulted; } - return Unsafe.As>(obj).GetStatus(_token) == ValueTaskSourceStatus.Faulted; + unsafe + { + return Unsafe.As>(obj).GetStatus(_token) == ValueTaskSourceStatus.Faulted; + } } } @@ -789,7 +792,10 @@ public bool IsCanceled return t.IsCanceled; } - return Unsafe.As>(obj).GetStatus(_token) == ValueTaskSourceStatus.Canceled; + unsafe + { + return Unsafe.As>(obj).GetStatus(_token) == ValueTaskSourceStatus.Canceled; + } } } @@ -814,7 +820,10 @@ public TResult Result return t.ResultOnSuccess; } - return Unsafe.As>(obj).GetResult(_token); + unsafe + { + return Unsafe.As>(obj).GetResult(_token); + } } } diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/build/Microsoft.NET.ILLink.Analyzers.props b/src/tools/illink/src/ILLink.RoslynAnalyzer/build/Microsoft.NET.ILLink.Analyzers.props index 18ae6cb8fd5e..e8a5e17d0c57 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/build/Microsoft.NET.ILLink.Analyzers.props +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/build/Microsoft.NET.ILLink.Analyzers.props @@ -3,6 +3,7 @@ + From 41893f5d67390527fd87788b1143326147fc3363 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Wed, 29 Oct 2025 01:08:30 -0700 Subject: [PATCH 2/3] Follow onboarding instructions --- .github/CODEOWNERS | 117 ------------------------------------------ Directory.Build.props | 2 +- eng/Versions.props | 2 +- 3 files changed, 2 insertions(+), 119 deletions(-) delete mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 9a575e240931..000000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,117 +0,0 @@ -# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths. -# See https://help.github.com/articles/about-code-owners/ - -/src/libraries/Common/src/System/Net/Http/aspnetcore/ @dotnet/http -/src/libraries/Common/tests/Tests/System/Net/aspnetcore/ @dotnet/http - -# CoreCLR Code Owners - -/src/coreclr/inc/corinfo.h @dotnet/jit-contrib -/src/coreclr/inc/corjit.h @dotnet/jit-contrib -/src/coreclr/jit/ @dotnet/jit-contrib -/src/coreclr/interpreter/ @brzvlad @janvorli @kg -/src/coreclr/vm/interpexec* @brzvlad @janvorli @kg -/src/coreclr/nativeaot @MichalStrehovsky -/src/coreclr/tools/Common @dotnet/crossgen-contrib @MichalStrehovsky -/src/coreclr/tools/aot @dotnet/crossgen-contrib -/src/coreclr/tools/aot/ILCompiler.Compiler @MichalStrehovsky -/src/coreclr/tools/aot/ILCompiler.RyuJit @MichalStrehovsky -/src/coreclr/tools/aot/ILCompiler.MetadataTransform @MichalStrehovsky - -# Mono Code Owners - -/src/mono @steveisok @vitek-karas - -/src/mono/llvm @steveisok @vitek-karas - -/src/mono/mono/arch @steveisok @vitek-karas -/src/mono/mono/eglib @steveisok @vitek-karas - -/src/mono/mono/metadata @thaystg @steveisok @vitek-karas -/src/mono/mono/metadata/*-win* @lateralusX @steveisok -/src/mono/mono/metadata/handle* @steveisok @vitek-karas -/src/mono/mono/metadata/monitor* @brzvlad @steveisok @vitek-karas -/src/mono/mono/metadata/sgen* @brzvlad @steveisok @vitek-karas -/src/mono/mono/metadata/thread* @lateralusX @steveisok @vitek-karas -/src/mono/mono/metadata/w32* @lateralusX @steveisok @vitek-karas - -/src/mono/mono/eventpipe @lateralusX @steveisok @vitek-karas - -/src/mono/mono/mini @steveisok @vitek-karas -/src/mono/mono/mini/*cfgdump* @steveisok @vitek-karas -/src/mono/mono/mini/*exceptions* @BrzVlad @steveisok @vitek-karas -/src/mono/mono/mini/*llvm* @steveisok @vitek-karas -/src/mono/mono/mini/*ppc* @steveisok @vitek-karas -/src/mono/mono/mini/*profiler* @BrzVlad @steveisok @vitek-karas -/src/mono/mono/mini/*riscv* @steveisok @vitek-karas -/src/mono/mono/mini/*type-check* @steveisok @vitek-karas -/src/mono/mono/mini/debugger-agent.c @thaystg @steveisok @vitek-karas -/src/mono/mono/mini/interp/* @BrzVlad @kotlarmilos @steveisok @vitek-karas -/src/mono/mono/mini/interp/*jiterp* @kg @steveisok @vitek-karas -/src/mono/mono/mini/*simd* @steveisok @vitek-karas - -/src/mono/mono/profiler @BrzVlad @steveisok @vitek-karas -/src/mono/mono/sgen @BrzVlad @steveisok @vitek-karas - -/src/mono/mono/utils @steveisok @vitek-karas -/src/mono/mono/utils/*-win* @lateralusX @steveisok @vitek-karas -/src/mono/mono/utils/atomic* @steveisok @vitek-karas -/src/mono/mono/utils/mono-hwcap* @steveisok @vitek-karas -/src/mono/mono/utils/mono-mem* @steveisok @vitek-karas -/src/mono/mono/utils/mono-threads* @steveisok @vitek-karas - -/src/mono/dlls @thaystg @steveisok @vitek-karas - -/src/native/public/mono @steveisok @vitek-karas -/src/native/eventpipe @noahfalk @lateralusX @mdh1418 -/src/native/external/libunwind @janvorli @AaronRobinsonMSFT @dotnet/dotnet-diag -/src/native/external/libunwind_extras @janvorli @AaronRobinsonMSFT @dotnet/dotnet-diag - -/src/libraries/sendtohelix-browser.targets @akoeplinger -/src/libraries/sendtohelix-wasm.targets @akoeplinger -/src/libraries/sendtohelix-wasi.targets @akoeplinger -/src/mono/browser @lewing @pavelsavara -/src/mono/wasi @lewing @pavelsavara -/src/mono/wasm @lewing @pavelsavara -/src/mono/browser/debugger @thaystg @ilonatommy -/src/mono/wasm/build @maraf @akoeplinger -/src/mono/wasi/build @maraf @akoeplinger -/src/mono/browser/build @maraf @akoeplinger -/src/mono/sample/wasm @lewing @pavelsavara -/src/mono/sample/wasi @lewing @pavelsavara -/src/libraries/System.Runtime.InteropServices.JavaScript @lewing @pavelsavara - -/src/mono/nuget/*WebAssembly*/ @lewing @akoeplinger -/src/mono/nuget/*MonoTargets*/ @lewing @akoeplinger -/src/mono/nuget/*BrowserDebugHost*/ @lewing @akoeplinger -/src/mono/nuget/*Workload.Mono.Toolchain*/ @lewing @akoeplinger -/src/mono/nuget/*MonoAOTCompiler*/ @lewing @akoeplinger - -/src/mono/wasm/Wasm* @maraf @ilonatommy -/src/mono/wasm/testassets @maraf @ilonatommy -/src/mono/wasi/testassets @maraf @ilonatommy -/src/tasks/WasmAppBuilder/ @maraf @akoeplinger -/src/tasks/WorkloadBuildTasks/ @akoeplinger -/src/tasks/AotCompilerTask/ @akoeplinger -/src/tasks/WasmBuildTasks/ @maraf @akoeplinger - -/eng/pipelines/**/*wasm* @akoeplinger - -# ILLink codeowners -/src/tools/illink/ @marek-safar -/src/tools/illink/src/analyzer/ @radekdoulik -/src/tools/illink/src/ILLink.Tasks/ @sbomer -/src/tools/illink/src/ILLink.RoslynAnalyzer/ @sbomer -/src/tools/illink/src/linker/ @marek-safar @mrvoorhe -/src/tools/illink/test/ @marek-safar @mrvoorhe - -# Obsoletions / Custom Diagnostics - -/docs/project/list-of-diagnostics.md @jeffhandley -/src/libraries/Common/src/System/Obsoletions.cs @jeffhandley - -# Area ownership and repo automation -/docs/area-owners.* @jeffhandley -/docs/issue*.md @jeffhandley -/.github/policies/ @jeffhandley @mkArtakMSFT -/.github/workflows/ @jeffhandley @dotnet/runtime-infrastructure diff --git a/Directory.Build.props b/Directory.Build.props index 99eee260233d..b082475fb5e8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -229,7 +229,7 @@ - runtime + runtimelab https://github.com/dotnet/$(GitHubRepositoryName) https://dot.net microsoft,dotnetframework diff --git a/eng/Versions.props b/eng/Versions.props index 28f6b0c3ea4b..cabfa3d622d2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -12,7 +12,7 @@ 8.0.$([MSBuild]::Add($([System.Version]::Parse('$(PackageVersionNet9)').Build),11)) 7.0.20 6.0.36 - rc + unsafe 1 false From 73b3389269119fe6e2d824cd6bdfff22c6c9f16a Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Wed, 29 Oct 2025 01:19:50 -0700 Subject: [PATCH 3/3] Typo --- .../System.Private.CoreLib/src/System/ReadOnlyMemory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs b/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs index 7ad6d2af92ef..abbba4c39694 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs @@ -245,8 +245,8 @@ public ReadOnlySpan Span { Span memoryManagerSpan = Unsafe.As>(tmpObject).GetSpan(); refToReturn = ref MemoryMarshal.GetReference(memoryManagerSpan); + lengthOfUnderlyingSpan = memoryManagerSpan.Length; } - lengthOfUnderlyingSpan = memoryManagerSpan.Length; } // If the Memory or ReadOnlyMemory instance is torn, this property getter has undefined behavior.