-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Go: fix small issues highlighted by data flow consistency checks #20929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This is needed because a PR to another repo is needed to update the location of the consistency queries, and until that PR is merged we don't want to runny dummy.ql as a consistency query. After that PR is merged we should reinstate these files so that consistency tests are run on this test folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses small issues identified by data flow consistency checks in the Go language implementation. The main focus is on fixing the reverseRead consistency check violations, which occur when a read step exists from node a to a.b, node a.b has a post-update node, but node a is missing its post-update node.
Key Changes
- Extended post-update node generation for method call receivers to include all implicit field reads in promoted field access chains
- Refactored
skipImplicitFieldReadsinFlowSummaryImpl.qllto use a new utility predicatelookThroughImplicitFieldRead - Added exclusion predicates to the Go consistency checks for known acceptable edge cases
- Fixed an SSA implementation issue where adjacent variable references could incorrectly include self-loops
Reviewed changes
Copilot reviewed 63 out of 64 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll |
Added localFlowIsLocalExclude exclusion predicate and documentation for reverseRead check |
go/ql/lib/semmle/go/dataflow/internal/DataFlowImplConsistency.qll |
Implemented Go-specific exclusion predicates for consistency checks |
go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll |
Extended post-update node creation to handle promoted field access chains using transitive closure |
go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll |
Refactored to use new IR::lookThroughImplicitFieldRead utility predicate |
go/ql/lib/semmle/go/dataflow/SsaImpl.qll |
Added condition to prevent self-loops in adjacent variable reference detection |
go/ql/lib/semmle/go/controlflow/IR.qll |
Added lookThroughImplicitFieldRead utility predicate for consistent field read navigation |
go/ql/consistency-queries/UnexpectedFrontendErrors.ql |
Moved query to consistency-queries directory |
go/ql/lib/change-notes/2025-11-26-unexpected-frontend-errors-query-moved.md |
Change note documenting the query move |
go/Makefile |
Updated consistency queries path references |
Multiple .expected files |
Updated test expectations with reverseRead consistency check results |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --- | ||
| category: breaking | ||
| --- | ||
| * The query `go/unexpected-frontend-error` has been moved from the `codeql/go-queries` query to the `codeql-go-consistency-queries` query pack. |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a double space between "query" and "to" in the change note.
| * The query `go/unexpected-frontend-error` has been moved from the `codeql/go-queries` query to the `codeql-go-consistency-queries` query pack. | |
| * The query `go/unexpected-frontend-error` has been moved from the `codeql/go-queries` query to the `codeql-go-consistency-queries` query pack. |
No description provided.