Skip to content

SSA: Refactor internal SSA barrier guards api - #23051

Merged
aschackmull merged 2 commits into
github:mainfrom
aschackmull:ssa/barrierguard-refactor
Nov 10, 2026
Merged

aschackmull merged 2 commits into
github:mainfrom
aschackmull:ssa/barrierguard-refactor

Conversation

@aschackmull

Copy link
Copy Markdown
Contributor

The barrier guard modules that SSA DataFlowIntegration exposes ought to be based on SSA definitions rather than the Expr type passed into DataFlowIntegration as that's not really an expression. The wrapping and translation to expressions is done on the language-specific side regardless.

The first commit is a simple rename and the second commit is the actual change. This also means that SSA can be reduced to only present 2 barrier guard modules instead of the current 3.

@aschackmull
aschackmull requested a review from a team as a code owner November 9, 2026 10:12
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Nov 9, 2026
@aschackmull
aschackmull requested review from a team as code owners November 9, 2026 10:12
Copilot AI adaptive review requested due to automatic review settings November 9, 2026 10:12
@github-actions github-actions Bot added C# JS C++ Java Ruby Rust Pull requests that update Rust code labels Nov 9, 2026

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.

🟡 Changes recommended

The shared barrier-guard contract change lacks final-revision before-and-after query comparisons (DCA) and an assessment of changed alerts or unexpected regressions.

1 open issue
What changed in this PR

Refactors the shared SSA barrier-guard API to accept SSA definitions rather than expressions, leaving expression translation to language-specific dataflow adapters.

Changes:

  • Consolidates three shared barrier-guard modules into two definition-based modules.
  • Updates C++, C#, Java, JavaScript, Ruby, and Rust integrations.
  • Adds a JavaScript helper for mapping SSA definitions to reads.
File Description
shared/​ssa/​codeql/​ssa/​Ssa.qll Consolidates and renames the definition-based barrier-guard API.
rust/​ql/​lib/​codeql/​rust/​dataflow/​internal/​SsaImpl.qll Maps definitions to reads in Rust adapters.
ruby/​ql/​lib/​codeql/​ruby/​dataflow/​internal/​SsaImpl.qll Maps definitions to reads in Ruby adapters.
javascript/​ql/​lib/​semmle/​javascript/​dataflow/​internal/​TaintTrackingPrivate.qll Adapts falsy-value guards to SSA definitions.
javascript/​ql/​lib/​semmle/​javascript/​dataflow/​internal/​sharedlib/​Ssa.qll Adds the definition-to-read helper.
javascript/​ql/​lib/​semmle/​javascript/​dataflow/​internal/​BarrierGuards.qll Adapts stateful guards to the new API.
java/​ql/​lib/​semmle/​code/​java/​dataflow/​internal/​SsaImpl.qll Updates shared barrier-module references.
csharp/​ql/​lib/​semmle/​code/​csharp/​dataflow/​internal/​SsaImpl.qll Updates shared barrier-module references.
cpp/​ql/​lib/​semmle/​code/​cpp/​ir/​dataflow/​internal/​SsaImpl.qll Updates the parameterized barrier-module reference.

Review effort: Balanced (auto)

Comment thread shared/ssa/codeql/ssa/Ssa.qll Resolved
@aschackmull
aschackmull merged commit 92c8ce9 into github:main Nov 10, 2026
119 of 120 checks passed
@aschackmull
aschackmull deleted the ssa/barrierguard-refactor branch November 10, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# C++ Java JS no-change-note-required This PR does not need a change note Ruby Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants