From 1d72c2319a946e7363675b66bb49e0c9755169f8 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Wed, 21 Feb 2018 23:30:17 +0000 Subject: [PATCH] Remove OwnedFlagBit from TryGetOwnedMemory index --- src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.cs b/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.cs index 633f56d..7fabf1e 100644 --- a/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.cs +++ b/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.cs @@ -40,7 +40,7 @@ namespace System.Runtime.InteropServices } /// - /// Gets a from the underlying readOnlyMemory. + /// Gets an from the underlying readOnlyMemory. /// If unable to get the type, returns false. /// /// The element type of the . @@ -57,7 +57,7 @@ namespace System.Runtime.InteropServices } /// - /// Gets a and , from the underlying memory. + /// Gets an and , from the underlying memory. /// If unable to get the type, returns false. /// /// The element type of the . @@ -72,6 +72,7 @@ namespace System.Runtime.InteropServices { TOwner owner; // Use register for null comparison rather than byref ownedMemory = owner = readOnlyMemory.GetObjectStartLength(out index, out length) as TOwner; + index &= ReadOnlyMemory.RemoveOwnedFlagBitMask; return !ReferenceEquals(owner, null); } -- 2.7.4