Skip to content

Commit

Permalink
ToPointerFix - VS debugger needs the ToPointer() methods to inspect a…
Browse files Browse the repository at this point in the history
… pointer, marking it as DependencyReductionRoot to make sure it is not optimized away.

[tfs-changeset: 1713493]

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>


Commit migrated from dotnet/coreclr@4a5e35b
  • Loading branch information
cshung authored and jkotas committed Sep 10, 2018
1 parent a0b7373 commit 7397910
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libraries/System.Private.CoreLib/src/System/IntPtr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ public static int Size
[CLSCompliant(false)]
[Intrinsic]
[NonVersionable]
#if PROJECTN
[System.Runtime.CompilerServices.DependencyReductionRootAttribute]
#endif
public unsafe void* ToPointer()
{
return _value;
Expand Down
3 changes: 3 additions & 0 deletions src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ public static unsafe int Size

[Intrinsic]
[NonVersionable]
#if PROJECTN
[System.Runtime.CompilerServices.DependencyReductionRootAttribute]
#endif
public unsafe void* ToPointer()
{
return _value;
Expand Down

0 comments on commit 7397910

Please sign in to comment.