Skip to content

Go: fix FP in go/dead-store-of-local - #22610

Open
owen-mc wants to merge 2 commits into
github:mainfrom
owen-mc:go/fix/dead-store-of-local
Open

owen-mc wants to merge 2 commits into
github:mainfrom
owen-mc:go/fix/dead-store-of-local

Conversation

@owen-mc

@owen-mc owen-mc commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #22182. Some FPs were added where a read of a local was not noticed because it was trimmed from the CFG because it was unreachable. This restores the previous behaviour.

@owen-mc owen-mc added the no-change-note-required This PR does not need a change note label Sep 17, 2026
@owen-mc
owen-mc requested a review from a team as a code owner September 17, 2026 12:59
Copilot AI balanced review requested due to automatic review settings September 17, 2026 12:59
@github-actions github-actions Bot added the Go label Sep 17, 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.

Copilot review overview

🟢 Approval recommended

The focused query change correctly addresses the false positive and includes regression coverage.

Review effort: Balanced (auto)
Findings: None

Note

Copilot is running an experiment and ran this review at Balanced.

What changed in this PR

Updates the Go dead-store query to ignore references that exist only in unreachable code.

Changes:

  • Uses reachable IR instructions to detect variable usage.
  • Adds a short-circuit regression test.
  • Updates shifted test expectations.
File Description
go/​ql/​src/​RedundantCode/​DeadStoreOfLocal.ql Checks variable usage through reachable IR.
go/​ql/​test/​query-tests/​RedundantCode/​DeadStoreOfLocal/​main.go Adds the regression case.
go/​ql/​test/​query-tests/​RedundantCode/​DeadStoreOfLocal/​CONSISTENCY/​UnexpectedFrontendErrors.expected Updates the shifted source location.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Go 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