Skip to content

Conversation

@aschackmull
Copy link
Contributor

@aschackmull aschackmull commented Oct 31, 2025

What the title says.

There's a little bit of semantic impact from the first commit: Since the tweaked isUnreachableInCall referred to a slightly larger set of boolean constants than mere literals, I've expanded the input to Guards in the same way to recognize those constants.

@github-actions github-actions bot added the C# label Oct 31, 2025
@aschackmull
Copy link
Contributor Author

Dca is fairly uneventful. I dug into one of the weird alert diffs for NullMaybe, but it turned out to be due to missing types in buildless, so 🤷

@aschackmull aschackmull marked this pull request as ready for review November 4, 2025 14:36
@aschackmull aschackmull requested a review from a team as a code owner November 4, 2025 14:36
Copilot AI review requested due to automatic review settings November 4, 2025 14:36
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Nov 4, 2025
Copy link
Contributor

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.

Pull Request Overview

This PR refactors control flow guard usage across the C# codebase, replacing the deprecated controlsBlock predicate with newer guard APIs. The main changes include:

  • Removal of complex split-based control flow analysis from ControlFlowElement.qll
  • Simplification of guard-based constant value tracking in dataflow analysis
  • Migration to shared guard libraries (Guards::Guard.valueControls)
  • Updates to boolean constant detection to use value-based checks

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ConditionalBypassQuery.qll Replaced manual control flow checking with Guard.directlyControls API
DataFlowPrivate.qll Generalized boolean constant tracking to support any constant value type using GuardValue
Guards.qll Extended boolean constant detection beyond just BoolLiteral to any boolean-typed expression with a value
ControlFlowElement.qll Deprecated complex controlsBlock predicate in favor of simpler implementation
Caching.qll Removed caching dependency on deprecated controlsBlock predicate

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aschackmull aschackmull removed the no-change-note-required This PR does not need a change note label Nov 4, 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

@aschackmull aschackmull merged commit 02fd1dc into github:main Nov 5, 2025
23 of 24 checks passed
@aschackmull aschackmull deleted the csharp/guards-misc branch November 5, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants