Skip to content

Unified: use type-inferred field resolution in data flow - #22980

Draft
hvitved wants to merge 2 commits into
mainfrom
hvitved-unified-field-resolution
Draft

hvitved wants to merge 2 commits into
mainfrom
hvitved-unified-field-resolution

Conversation

@hvitved

@hvitved hvitved commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Name-based member content conflates unrelated fields with the same name. Use field resolution from type inference where available to distinguish resolved fields, while retaining name-based fallback for unresolved accesses and compatibility with flow summaries.

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.

🟡 Changes recommended

The change can multiply read candidates across unrelated receiver types and drop valid data flow when only some receiver alternatives resolve to fields.

2 open issues
What changed in this PR

Updates Unified’s data-flow model to distinguish fields using type-inferred declarations, while retaining name-based fallback and compatibility with flow summaries.

Changes:

  • Adds resolved-field content and name-based read compatibility.
  • Routes qualified and implicit member reads and stores through field resolution.
  • Adds Swift regression cases, a field-read summary model, and updated expected output.
File Description
unified/​ql/​test/​library-tests/​dataflow/​test.ext.yml Adds a name-based field-read flow summary.
unified/​ql/​test/​library-tests/​dataflow/​test.expected Updates expected flow paths for the changed model and new cases.
unified/​ql/​test/​library-tests/​dataflow/​fields.swift Covers resolved, inherited, unresolved, and summarized field accesses.
unified/​ql/​lib/​codeql/​unified/​internal/​dataflow/​DataFlowGraph.qll Uses resolved content for member reads and stores.
unified/​ql/​lib/​codeql/​unified/​internal/​dataflow/​Content.qll Introduces resolved-field identities, fallback selection, and name-based compatibility.

Review effort: Max

@hvitved
hvitved force-pushed the hvitved-unified-field-resolution branch 2 times, most recently from 4dbff80 to 71419e1 Compare November 2, 2026 19:20
@hvitved
hvitved force-pushed the hvitved-unified-field-resolution branch from 6524f1a to 2797f96 Compare November 3, 2026 12:42

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants