Fix NativeAOT nullable isinst branch elimination - #134823
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 318157b0-8bdc-4d1e-b18e-25341047f8c3
|
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. |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
MichalStrehovsky
approved these changes
Sep 29, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix consistently addresses both affected compiler paths and includes representative regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes incorrect NativeAOT elimination of reachable isinst Nullable<T> branches.
Changes:
- Excludes nullable type tests from unsafe branch folding and conditional dependency scanning.
- Adds regression coverage for matching, mismatching, and null inputs.
| File | Description |
|---|---|
SubstitutedILProvider.cs |
Preserves nullable isinst branches. |
ILImporter.Scanner.cs |
Scans nullable success-branch dependencies unconditionally. |
Generics.cs |
Adds NativeAOT nullable branch regression tests. |
Member
Author
|
/backport to release/11.0 |
Contributor
|
Started backporting to |
2 of 4 tasks
JulieLeeMSFT
pushed a commit
that referenced
this pull request
Oct 1, 2026
) Backport of #134823 to release/11.0 /cc @agocke ## Customer Impact - [x] Customer reported - [ ] Found internally [Select one or both of the boxes. Describe how this issue impacts customers, citing the expected and actual behaviors and scope of the issue. If customer-reported, provide the issue number.] ## Regression - [ ] Yes - [x] No [If yes, specify when the regression was introduced. Provide the PR or commit if known.] ## Testing Unit test. ## Risk Very low. Co-authored-by: Andy Gocke <angocke@microsoft.com> Copilot-Session: 318157b0-8bdc-4d1e-b18e-25341047f8c3
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
isinst Nullable<T>success branches as unreachable based on the absence of a constructedNullable<T>MethodTableResolves #134799
Note
This pull request description was generated with GitHub Copilot.