Repository navigation
Unified: Use ParameterEx for all parameters in data flow - #23316
Merged
Merged
Conversation
hvitved
force-pushed
the
unified/dataflow-paramex
branch
from
December 1, 2026 15:03
cdaeea4 to
e1a710b
Compare
Contributor
There was a problem hiding this comment.
🟡 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
force-pushed
the
unified/dataflow-paramex
branch
from
December 2, 2026 10:48
e1a710b to
4fc165f
Compare
hvitved
force-pushed
the
unified/dataflow-paramex
branch
from
December 2, 2026 14:04
4fc165f to
2ccd2ab
Compare
hvitved
marked this pull request as ready for review
December 2, 2026 14:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
ParameterExfor 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.