Repository navigation
[release/11.0] Fix NativeAOT GVM dispatch cell lookup in shared code - #137949
Merged
Merged
Conversation
When calling a generic virtual method from shared code, the target is normalized to the slot-defining method. The normalized target may not be runtime-determined even if the original callee context was shared (e.g. `Mid<__Canon>.M<int>` normalizes to `Base.M<int>`). Both the scanner and the JIT interface decided whether to do a runtime lookup of the dispatch cell based on `exactContextNeedsRuntimeLookup`, which describes the original context, leading to an assert/NotImplementedException. Decide based on the normalized target instead. Fixes #137774 Co-authored-by: Copilot <[email protected]> Copilot-Session: 73a57fb9-9b59-4942-b2bd-304253b3aeb0
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 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: @agocke, @dotnet/ilc-contrib |
jkotas
approved these changes
Nov 19, 2026
This was referenced Nov 20, 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.
Backport of #137885 to release/11.0
/cc @MichalStrehovsky
Customer Impact
#137774 - ML.NET fails to compile
Regression
Compiler crash after #129609. Copilot says the bug is older but we would only see asserts before that PR (that part I didn't validate).
Testing
Hitting this requires a generic virtual method that is not called through its slot definition where there is a difference in genericness of the owning type of the called method vs the method that owns the slot. Targeted test was added.
Risk
The risk is low, the fix is rather obvious and targeted. No surprises showed up when running complete product test pass.