Skip to content

Conversation

aschackmull
Copy link
Contributor

This adds a few tuples to the updated predicates. Spot-checking the additions for adjacentReadPairSameVar all look correct. The differences for getAFirstRead all had to do with ref variables, and I couldn't quite make sense of them, but there weren't that many, and I think the new version ought to be more correct.

@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Apr 1, 2025
@Copilot Copilot AI review requested due to automatic review settings April 1, 2025 08:10
@aschackmull aschackmull requested a review from a team as a code owner April 1, 2025 08:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • csharp/ql/lib/semmle/code/csharp/controlflow/internal/PreSsa.qll: Language not supported

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

@github-actions github-actions bot added the C# label Apr 1, 2025
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (but let's wait for DCA to come back clean before merging).

@aschackmull
Copy link
Contributor Author

Dca looks fine. I checked the single new alert - it's technically true, the assigned value is never read, but it relies on knowing that a foreach statement executes at least once, so I don't think it can be removed. In any case, this just shows that we just got a very minor tweak to the CFG splitting, but the useless assignment query ought possibly not make use of splitting information, since the compiler will likely insist on keeping the initialisation.

@aschackmull aschackmull merged commit e6cf737 into github:main Apr 2, 2025
24 checks passed
@aschackmull aschackmull deleted the csharp/pressa-useuse branch April 2, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants