Repository navigation
Simplify sample profiler native pointer conversion - #136444
Merged
Merged
Conversation
Apply jkotas feedback on the backport of #136433. IntPtr and nint are the same type, and the test project uses unchecked arithmetic by default. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
jkotas
approved these changes
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apply Jan's review feedback on the backport of #136433: use
IntPtr stack = (nint)address;, sinceIntPtrandnintare the same type.This is a one-line, test-only syntax cleanup. The existing sign-extension comment,
ulongaddress representation, and stack-reading logic are unchanged. The project uses unchecked arithmetic by default, so the truncating native-width conversion is preserved. The crash fix is already in #136433; this follow-up does not independently fix it.The same correction has been pushed to the existing release/11.0 backport #136440 (
14b7ddd4f5ba5d5af35afc23e916be80d3d0b9e1) and release/10.0 backport #136441 (d5ce4c1d541740525d038b0b30988058edfe2a89; helper is inGCEvents.csthere).Validation
CheckForOverflowUnderflow=falsefor ARM and ARM64 in Debug, Checked, and Release. There is no enclosing checked block around the cast.0xFFFFFFFFD2345678.ldarg.0; conv.i; ret. A checked-conversion control throws as expected.git diff --checkpassed on all three branches.No full runtime rebuild or EventPipe test-harness run was performed. The 32-bit checks were simulated narrowing on ARM64, not actual ARM32 execution. The standalone probe is not part of the PR.
Note
This PR description and change were prepared with GitHub Copilot.