Repository navigation
Conversation
owen-mc
force-pushed
the
go/data-flow-integration
branch
from
November 13, 2026 16:49
f3daf4e to
135d102
Compare
Do not treat select-receive assignment targets or other pure lvalues as variable reads in EvalInstruction.reads, matching ReadInstruction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… merges Record pre-migration behavior across SSA merges, loops, and captured overwrites before switching local SSA flow to DataFlowIntegration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Propagate unknown or possibly nil origins through SSA cycles and uncertain writes in interface dispatch and nil checks, and exclude SSA phi definitions from cleartext logging variable sources. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the shared DataFlowIntegration library for local SSA flow while preserving Go's field-sensitive barrier guards and closure flow, hiding synthetic SSA merge nodes from paths, and defining SsaNode.getBasicBlock. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enable shared SSA and DataFlowIntegration consistency queries and record the remaining capture-retention exit-read phi baselines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
owen-mc
force-pushed
the
go/data-flow-integration
branch
from
November 18, 2026 17:00
135d102 to
67b2034
Compare
owen-mc
force-pushed
the
go/data-flow-integration
branch
from
November 19, 2026 09:36
5ff21cd to
646eeee
Compare
owen-mc
marked this pull request as ready for review
November 19, 2026 09:48
owen-mc
requested review from
aschackmull
and
an adaptive review from Copilot
November 19, 2026 09:48
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Existing FlowSteps expectations are stale because loop-header phi edges are now retained, and the change note incorrectly claims local-flow reachability is unchanged.
2 open issues
What changed in this PR
Migrates Go’s local SSA data flow to the shared DataFlowIntegration library, building on the earlier MakeSsa migration.
Changes:
- Connects shared SSA nodes and flow steps while preserving Go’s barrier guards and closure flow.
- Adapts interface dispatch, nil checks, and clear-text logging to merge and cycle edges.
- Adds regression coverage, enables SSA consistency checks, and documents the changes.
| File | Description |
|---|---|
go/ql/test/query-tests/Security/CWE-643/CONSISTENCY/SsaConsistency.expected |
Records known phi consistency diagnostics. |
go/ql/test/query-tests/Security/CWE-312/passwords.go |
Tests password flow through branch merges. |
go/ql/test/query-tests/Security/CWE-312/CleartextLogging.expected |
Records merged-password alerts and paths. |
go/ql/test/query-tests/RedundantCode/ImpossibleInterfaceNilCheck/ssa.go |
Tests loops, typed nils, and captured writes. |
go/ql/test/query-tests/RedundantCode/ImpossibleInterfaceNilCheck/ImpossibleInterfaceNilCheck.expected |
Records expected nil-check alerts. |
go/ql/test/library-tests/semmle/go/frameworks/Twirp/CONSISTENCY/SsaConsistency.expected |
Records Twirp phi consistency diagnostics. |
go/ql/test/library-tests/semmle/go/dataflow/SSADataFlowIntegration/main.go |
Adds merge, loop, closure, and guard fixtures. |
go/ql/test/library-tests/semmle/go/dataflow/SSADataFlowIntegration/HiddenNodes.ql |
Checks that internal SSA nodes stay hidden from paths. |
go/ql/test/library-tests/semmle/go/dataflow/SSADataFlowIntegration/HiddenNodes.expected |
Records flow counts and hidden-node checks. |
go/ql/test/library-tests/semmle/go/dataflow/SSADataFlowIntegration/Flows.ql |
Checks value flow, barriers, and node regions. |
go/ql/test/library-tests/semmle/go/dataflow/SSADataFlowIntegration/Flows.expected |
Records successful flow and region checks. |
go/ql/test/library-tests/semmle/go/dataflow/SSADataFlowIntegration/CONSISTENCY/SsaConsistency.expected |
Records known capture-related phi diagnostics. |
go/ql/test/library-tests/semmle/go/dataflow/InterfaceDispatch/Targets.ql |
Queries viable interface-call targets. |
go/ql/test/library-tests/semmle/go/dataflow/InterfaceDispatch/Targets.expected |
Records expected dispatch targets. |
go/ql/test/library-tests/semmle/go/dataflow/InterfaceDispatch/main.go |
Adds loop and closure dispatch fixtures. |
go/ql/test/library-tests/semmle/go/dataflow/InterfaceDispatch/Flows.ql |
Runs interface-dispatch flow checks. |
go/ql/test/library-tests/semmle/go/dataflow/InterfaceDispatch/Flows.expected |
Records no inline flow-test failures. |
go/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/CONSISTENCY/SsaConsistency.expected |
Records an epilogue phi diagnostic. |
go/ql/test/experimental/CWE-942/CONSISTENCY/SsaConsistency.expected |
Records a captured-variable phi diagnostic. |
go/ql/src/RedundantCode/ImpossibleInterfaceNilCheck.ql |
Handles SSA cycles and uncertain writes. |
go/ql/lib/semmle/go/security/CleartextLoggingCustomizations.qll |
Excludes phi definitions from password sources. |
go/ql/lib/semmle/go/dataflow/SsaImpl.qll |
Configures and exposes shared SSA flow integration. |
go/ql/lib/semmle/go/dataflow/internal/DataFlowUtil.qll |
Consolidates barrier-node lookup. |
go/ql/lib/semmle/go/dataflow/internal/DataFlowPrivate.qll |
Uses shared flow steps and hides merge nodes. |
go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll |
Maps shared SSA nodes and supplies basic blocks. |
go/ql/lib/semmle/go/dataflow/internal/DataFlowDispatch.qll |
Handles cyclic flow and unknown receiver origins. |
go/ql/lib/semmle/go/controlflow/IR.qll |
Restricts expression reads to rvalues. |
go/ql/lib/change-notes/2026-11-18-ssa-data-flow-integration.md |
Documents flow and basic-block changes. |
go/ql/consistency-queries/SsaConsistency.ql |
Enables shared SSA consistency checks. |
Review effort: Max (adaptive)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This branch has not been deployed
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.


Use the shared
DataFlowIntegrationlibrary for Go’s local SSA flow, following the earlier migration toMakeSsa.This preserves Go’s field-sensitive barrier guards and closure flow, defines
SsaNode.getBasicBlock, and hides internal merge nodes from path explanations.Because local flow now steps through SSA merge and cycle edges, adapt interface dispatch,
go/impossible-interface-nil-check, andgo/clear-text-loggingto preserve existing behavior.Also exclude non-rvalue expressions from
IR::EvalInstruction.readsand enable SSA consistency checks (remaining single-input phi findings come from synthetic exit reads used to retain captured definitions, which will be removed soon when Go adopts to the shared variable capture library).DCA looks neutral.