diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs index d849a0d58c75ed..f4cb2d077e132a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs @@ -474,7 +474,7 @@ public static unsafe T Read(ReadOnlySpan source) } if (sizeof(T) > source.Length) { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.length); + ThrowHelper.ThrowArgumentOutOfRangeException(); } return Unsafe.ReadUnaligned(ref GetReference(source)); } @@ -513,7 +513,7 @@ public static unsafe void Write(Span destination, in T value) } if ((uint)sizeof(T) > (uint)destination.Length) { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.length); + ThrowHelper.ThrowArgumentOutOfRangeException(); } Unsafe.WriteUnaligned(ref GetReference(destination), value); } @@ -555,7 +555,7 @@ public static unsafe ref T AsRef(Span span) } if (sizeof(T) > (uint)span.Length) { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.length); + ThrowHelper.ThrowArgumentOutOfRangeException(); } return ref Unsafe.As(ref GetReference(span)); } @@ -577,7 +577,7 @@ public static unsafe ref readonly T AsRef(ReadOnlySpan span) } if (sizeof(T) > (uint)span.Length) { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.length); + ThrowHelper.ThrowArgumentOutOfRangeException(); } return ref Unsafe.As(ref GetReference(span)); }