Repository navigation
JIT: Do not reuse local addresses across suspension points in async methods - #134511
Merged
Merged
Conversation
…ethods Locals move to a new frame when an async method resumes, but `TYP_I_IMPL`-typed local addresses were not covered by the byref-only CSE kills at suspension points and could be reused after resumption. Add a "frame version" argument to `VNF_PtrToLoc` that is unique per `GT_LCL_ADDR` in async methods. Number loads of address-exposed locals with a new `VNF_ByrefExposedLocalLoad` that ignores the frame version. Fix dotnet#133588 Co-authored-by: Copilot <[email protected]> Copilot-Session: ef38ea02-2a4e-45b5-8127-86b751617a68
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical async value-numbering paths can still reuse stale local addresses across suspension points.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
This pull request prevents JIT reuse of local addresses across async suspension points and adds regression coverage for issue #133588.
Changes:
- Adds frame-versioned
VNF_PtrToLochandling. - Adds
VNF_ByrefExposedLocalLoad. - Adds and registers an async regression test.
| File | Description |
|---|---|
src/tests/async/regression/133588.csproj |
Registers the regression test project. |
src/tests/async/regression/133588.cs |
Reproduces stale-address behavior. |
src/coreclr/jit/valuenumfuncs.h |
Defines updated value-numbering functions. |
src/coreclr/jit/valuenum.cpp |
Implements frame-aware address numbering and local-load handling. |
src/coreclr/jit/compiler.h |
Declares the new helper. |
Member
Author
EgorBo
reviewed
Sep 23, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Locals move to a new frame when an async method resumes, but this was not modelled by VN. Add a "frame version" argument to
VNF_PtrToLocthat is unique perGT_LCL_ADDRin async methods. Number loads of address-exposed locals with a newVNF_ByrefExposedLocalLoadthat ignores the frame version to avoid regressions.Fix #133588