Skip to content

Go: (Refactor) Use makeSsa for SSA classes - #22857

Merged
owen-mc merged 6 commits into
github:mainfrom
owen-mc:go/make-ssa
Nov 13, 2026
Merged

owen-mc merged 6 commits into
github:mainfrom
owen-mc:go/make-ssa

Conversation

@owen-mc

@owen-mc owen-mc commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Instantiate MakeSsa to use more logic from the shared library.

DCA doesn't show any changes.

@owen-mc
owen-mc force-pushed the go/make-ssa branch 2 times, most recently from 024f618 to 7d8b19e Compare October 21, 2026 13:23
@owen-mc
owen-mc marked this pull request as ready for review October 21, 2026 13:25
Copilot AI max review requested due to automatic review settings October 21, 2026 13:25
@owen-mc
owen-mc requested a review from a team as a code owner October 21, 2026 13:25

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.

🔵 Needs a closer look

The foundational SSA/IR migration has unresolved behavior and compatibility regressions that need human validation.

3 open issues
What changed in this PR

Refactors Go’s static single-assignment (SSA) analysis to use shared CodeQL classes.

Changes:

  • Migrates data-flow, control-flow, framework models, and queries to definition-based APIs.
  • Adds deprecated compatibility classes and explicit type-switch write targets.
  • Updates test expectations, annotation comments, and migration notes.
File Description
go/​ql/​test/​query-tests/​Security/​CWE-601/​BadRedirectCheck/​BadRedirectCheck.expected Updates parameter labels.
go/​ql/​test/​query-tests/​Security/​CWE-347/​MissingJwtSignatureCheck.expected Updates parameter labels.
go/​ql/​test/​query-tests/​Security/​CWE-326/​InsufficientKeySize.expected Updates labels and section ordering.
go/​ql/​test/​query-tests/​Security/​CWE-322/​InsecureHostKeyCallback.expected Updates parameter labels.
go/​ql/​test/​query-tests/​Security/​CWE-312/​CleartextLogging.expected Updates parameter labels.
go/​ql/​test/​query-tests/​Security/​CWE-079/​StoredXss.expected Updates parameter labels.
go/​ql/​test/​query-tests/​Security/​CWE-022/​ZipSlip.expected Updates parameter labels.
go/​ql/​test/​query-tests/​Security/​CWE-022/​UnsafeUnzipSymlink.expected Updates parameter labels.
go/​ql/​test/​query-tests/​InconsistentCode/​UnhandledCloseWritableHandle/​UnhandledCloseWritableHandle.expected Updates parameter and capture labels.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​Twirp/​RequestForgery.expected Updates parameter and capture labels.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​gqlgen/​graph/​schema.resolvers.go Updates an expectation comment only.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​GoMicro/​main.go Updates an expectation comment only.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​GoMicro/​LogInjection.expected Updates request-parameter labels.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​GoKit/​main.go Updates expectation comments only.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​Beego/​CleartextLogging.expected Updates parameter labels.
go/​ql/​test/​library-tests/​semmle/​go/​dataflow/​SSA/​SsaWithFields.expected Updates definition labels.
go/​ql/​test/​library-tests/​semmle/​go/​dataflow/​SSA/​SsaDefinition.expected Updates definition labels.
go/​ql/​test/​library-tests/​semmle/​go/​dataflow/​SSA/​DefUse.ql Queries definition-based expression reads.
go/​ql/​test/​library-tests/​semmle/​go/​dataflow/​SSA/​DefUse.expected Reflects expression-read results.
go/​ql/​test/​library-tests/​semmle/​go/​dataflow/​FunctionInputsAndOutputs/​FunctionInput_getExitNode.expected Updates parameter labels.
go/​ql/​test/​library-tests/​semmle/​go/​dataflow/​FlowSteps/​LocalFlowStep.expected Updates parameter and capture labels.
go/​ql/​test/​library-tests/​semmle/​go/​dataflow/​ExternalValueFlow/​srcs.expected Updates source-parameter labels.
go/​ql/​test/​library-tests/​semmle/​go/​dataflow/​ExternalTaintFlow/​srcs.expected Updates source-parameter labels.
go/​ql/​test/​experimental/​Unsafe/​WrongUsageOfUnsafe.expected Updates parameter labels.
go/​ql/​test/​experimental/​CWE-522-DecompressionBombs/​DecompressionBombs.expected Updates parameter labels.
go/​ql/​test/​example-tests/​snippets/​typeinfo.expected Updates a parameter label.
go/​ql/​src/​RedundantCode/​DeadStoreOfLocal.ql Uses explicit-write definitions.
go/​ql/​src/​RedundantCode/​DeadStoreOfField.ql Uses the renamed definition predicate.
go/​ql/​src/​InconsistentCode/​WrappedErrorAlwaysNil.ql Uses definition-based reads.
go/​ql/​src/​InconsistentCode/​MissingErrorCheck.ql Migrates phi-input lookup.
go/​ql/​src/​experimental/​IntegerOverflow/​RangeAnalysis.qll Migrates range analysis to shared definitions.
go/​ql/​lib/​semmle/​go/​frameworks/​stdlib/​NetHttp.qll Uses base definitions.
go/​ql/​lib/​semmle/​go/​frameworks/​RsCors.qll Migrates configuration-definition lookup.
go/​ql/​lib/​semmle/​go/​frameworks/​Macaron.qll Uses base definitions.
go/​ql/​lib/​semmle/​go/​frameworks/​GinCors.qll Migrates configuration-definition lookup.
go/​ql/​lib/​semmle/​go/​frameworks/​Fasthttp.qll Uses base definitions.
go/​ql/​lib/​semmle/​go/​frameworks/​Beego.qll Uses base definitions.
go/​ql/​lib/​semmle/​go/​dataflow/​SsaImpl.qll Instantiates shared SSA classes.
go/​ql/​lib/​semmle/​go/​dataflow/​SSA.qll Exports shared classes and compatibility wrappers.
go/​ql/​lib/​semmle/​go/​dataflow/​internal/​DataFlowUtil.qll Accepts definitions in the SSA-node helper.
go/​ql/​lib/​semmle/​go/​dataflow/​internal/​DataFlowPrivate.qll Migrates local flow and capture handling.
go/​ql/​lib/​semmle/​go/​dataflow/​internal/​DataFlowNodes.qll Integrates shared definitions into flow nodes.
go/​ql/​lib/​semmle/​go/​dataflow/​GlobalValueNumbering.qll Uses shared explicit-write definitions.
go/​ql/​lib/​semmle/​go/​controlflow/​IR.qll Models type-switch write targets.
go/​ql/​lib/​semmle/​go/​controlflow/​Guards.qll Reuses shared SSA classes.
go/​ql/​lib/​semmle/​go/​controlflow/​ControlFlowGraph.qll Renames the definition predicate.
go/​ql/​lib/​change-notes/​2026-10-20-shared-ssa.md Documents the breaking API migration.

Review effort: Max

Comment thread go/ql/lib/semmle/go/dataflow/SSA.qll Resolved
Comment thread go/ql/lib/semmle/go/dataflow/SSA.qll Resolved

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.

Comment thread go/ql/lib/semmle/go/controlflow/IR.qll Resolved
Comment thread go/ql/lib/semmle/go/dataflow/SSA.qll Resolved
owen-mc and others added 5 commits November 12, 2026 12:15
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

@owen-mc
owen-mc requested a review from a team as a code owner November 12, 2026 15:45
@owen-mc
owen-mc requested a review from aschackmull November 12, 2026 15:45
@owen-mc
owen-mc merged commit a25b55c into github:main Nov 13, 2026
21 checks passed
@owen-mc
owen-mc deleted the go/make-ssa branch November 13, 2026 13:55
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.

4 participants