Skip to content

Unified: Use ParameterEx for all parameters in data flow - #23316

Merged
hvitved merged 1 commit into
github:mainfrom
hvitved:unified/dataflow-paramex
Dec 3, 2026
Merged

hvitved merged 1 commit into
github:mainfrom
hvitved:unified/dataflow-paramex

Conversation

@hvitved

@hvitved hvitved commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

I would like for data flow and type inference to agree on (and hopefully share) how to match arguments against parameters, and as a first step this PR ensures that they both use ParameterEx for all parameters, whether implicit or explicit.

It does mean that ordinary parameters will have an extra flow step going from the parameter to the pattern (instead of the pattern itself being the parameter), but I think it is outweighed by the uniform treatment, and I doubt it will affect performance.

@hvitved
hvitved force-pushed the unified/dataflow-paramex branch from cdaeea4 to e1a710b Compare December 1, 2026 15:03
@hvitved
hvitved requested an adaptive review from Copilot December 1, 2026 19:48

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

DataFlowNode.qll constructs nodes for function-type syntax without an enclosing DataFlowCallable, adding unusable entries to the data-flow graph.

1 open issue
What changed in this PR

Refactors unified-language data flow to use ParameterEx consistently for parameter nodes, centralizing their identity, location, and control-flow mappings.

Changes:

  • Add implicit callee parameters and control-flow mappings to ParameterEx.
  • Update parameter matching, capture handling, and flow from explicit parameters into their patterns.
  • Refresh expected parameter labels, locations, and flow paths.
File Description
unified/​ql/​test/​query-tests/​security/​CWE-094/​UnsafeJsEval/​CONSISTENCY/​DataFlowConsistency.expected Update parameter locations and labels.
unified/​ql/​test/​library-tests/​type-inference/​CONSISTENCY/​DataFlowConsistency.expected Update parameter locations and labels.
unified/​ql/​test/​library-tests/​mad/​test.expected Update the implicit receiver label.
unified/​ql/​test/​library-tests/​dataflow/​test.expected Refresh flow paths and intermediate nodes.
unified/​ql/​lib/​codeql/​unified/​internal/​ParameterEx.qll Add callee parameters and control-flow mappings.
unified/​ql/​lib/​codeql/​unified/​internal/​dataflow/​DataFlowNode.qll Represent parameters with TParameterExNode.
unified/​ql/​lib/​codeql/​unified/​internal/​dataflow/​DataFlowInstantiation.qll Match parameter positions through ParameterEx.
unified/​ql/​lib/​codeql/​unified/​internal/​dataflow/​DataFlowGraph.qll Connect parameter nodes to pattern values.
unified/​ql/​lib/​codeql/​unified/​internal/​dataflow/​CaptureSsa.qll Resolve captured callee parameters through ParameterEx.

Review effort: Max (adaptive)

@hvitved
hvitved force-pushed the unified/dataflow-paramex branch from e1a710b to 4fc165f Compare December 2, 2026 10:48
@hvitved
hvitved force-pushed the unified/dataflow-paramex branch from 4fc165f to 2ccd2ab Compare December 2, 2026 14:04
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Dec 2, 2026
@hvitved
hvitved marked this pull request as ready for review December 2, 2026 14:11
@hvitved
hvitved requested a review from a team as a code owner December 2, 2026 14:11

@asgerf asgerf 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.

LGTM

@hvitved
hvitved merged commit 820d0a5 into github:main Dec 3, 2026
18 checks passed
@hvitved
hvitved deleted the unified/dataflow-paramex branch December 3, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Unified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants