From 878be8e120fba51f1a1f4d49b83aff6a1c4e0c79 Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Fri, 7 Sep 2018 16:52:42 -0700 Subject: ToPointerFix - VS debugger needs the ToPointer() methods to inspect a pointer, marking it as DependencyReductionRoot to make sure it is not optimized away. [tfs-changeset: 1713493] --- src/System.Private.CoreLib/shared/System/IntPtr.cs | 3 +++ src/System.Private.CoreLib/shared/System/UIntPtr.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/System.Private.CoreLib/shared/System/IntPtr.cs b/src/System.Private.CoreLib/shared/System/IntPtr.cs index f79334a96..d23742fa7 100644 --- a/src/System.Private.CoreLib/shared/System/IntPtr.cs +++ b/src/System.Private.CoreLib/shared/System/IntPtr.cs @@ -217,6 +217,9 @@ namespace System [CLSCompliant(false)] [Intrinsic] [NonVersionable] +#if PROJECTN + [System.Runtime.CompilerServices.DependencyReductionRootAttribute] +#endif public unsafe void* ToPointer() { return _value; diff --git a/src/System.Private.CoreLib/shared/System/UIntPtr.cs b/src/System.Private.CoreLib/shared/System/UIntPtr.cs index 9534f4f87..c57dd86a7 100644 --- a/src/System.Private.CoreLib/shared/System/UIntPtr.cs +++ b/src/System.Private.CoreLib/shared/System/UIntPtr.cs @@ -208,6 +208,9 @@ namespace System [Intrinsic] [NonVersionable] +#if PROJECTN + [System.Runtime.CompilerServices.DependencyReductionRootAttribute] +#endif public unsafe void* ToPointer() { return _value; -- cgit v1.2.3