Skip to content

Shared: Shadow isAfterValue on ControlFlowNode. - #22288

Merged
aschackmull merged 1 commit into
github:mainfrom
aschackmull:cfg/shadow-isaftervalue
Aug 6, 2026
Merged

Shared: Shadow isAfterValue on ControlFlowNode.#22288
aschackmull merged 1 commit into
github:mainfrom
aschackmull:cfg/shadow-isaftervalue

Conversation

@aschackmull

Copy link
Copy Markdown
Contributor

It can actually be nice to to use isAfterValue on ControlFlowNode post CFG construction. But in those use-cases the semantics you want (and expect) is actually different from what's on PreControlFlowNode. And using PreControlFlowNode::isAfterValue after the CFG is constructed is almost guaranteed to be wrong. Fortunately we can simply shadow the predicates to get a more useful and safer API since PreControlFlowNode is final.

The 3 added predicates are not used anywhere yet.

@aschackmull
aschackmull requested a review from a team as a code owner August 6, 2026 09:52
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Aug 6, 2026
Copilot AI balanced review requested due to automatic review settings August 6, 2026 09:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Ready to approve

The focused API addition is consistent with its stated purpose and has clear documentation.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Adds safer post-construction value-state queries to ControlFlowNode.

Changes:

  • Shadows three PreControlFlowNode predicates with CFG-specific semantics.
  • Documents the semantic distinction.
File summaries
File Description
shared/controlflow/codeql/controlflow/ControlFlowGraph.qll Adds and documents the three shadowing predicates.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@hvitved hvitved left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, good with the comment that explains the differences.

@aschackmull
aschackmull merged commit 876f68b into github:main Aug 6, 2026
108 checks passed
@aschackmull
aschackmull deleted the cfg/shadow-isaftervalue branch August 6, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants