Repository navigation
SSA: Refactor internal SSA barrier guards api - #23051
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 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)
hvitved
approved these changes
Nov 9, 2026
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.

The barrier guard modules that SSA DataFlowIntegration exposes ought to be based on SSA definitions rather than the
Exprtype 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.