Repository navigation
C#: Account for bogus nullness information from the extractor - #23322
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Combining extractor flow states with recursive SSA null inference introduces interacting effects on shared guard implications and downstream nullness classifications that warrant human review.
No open issues 🎉
What changed in this PR
This PR makes C# nullness analysis reject extractor-provided non-null information when the expression is known to be null.
Changes:
- Guard non-null flow-state inference with
not nullValueImplied(e). - Update test expectations to remove three incorrect non-null results.
| File | Description |
|---|---|
| csharp/ql/test/library-tests/controlflow/guards/AbstractValue.expected | Remove incorrect non-null expectations. |
| csharp/ql/lib/semmle/code/csharp/controlflow/Guards.qll | Reject contradictory extractor nullness information. |
Review effort: Balanced (adaptive)
hvitved
force-pushed
the
csharp/guards-non-null-roslyn-fix
branch
from
December 2, 2026 10:53
fa41ed3 to
4aebbac
Compare
hvitved
marked this pull request as ready for review
December 2, 2026 14:20
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.
DCA is fine.