Repository navigation
Conversation
The argument label order was normalized due to an incorrect belief that they could appear at an arbitrary order at the call site.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Active findings remain because the change lacks multi-parameter coverage for mixed-label ordering and DCA results validating production alert impact beyond the focused fixture.
2 open issues
What changed in this PR
Restores declaration-order handling for Swift argument labels in unified MaD so model selectors match valid call sites and callable declarations.
Changes:
- Preserves argument and parameter label order using AST parent indexes.
- Updates legacy Swift and format-string model selectors to declaration order.
- Adjusts the MaD regression test and expected sink locations.
| File | Description |
|---|---|
| unified/ql/test/library-tests/mad/test.swift | Reorders constructor arguments in the MaD regression test to match declaration order. |
| unified/ql/test/library-tests/mad/test.expected | Updates expected sink locations for the reordered test calls. |
| unified/ql/lib/ext/legacy-swift.model.json | Updates legacy Swift model selectors to use declaration-order labels. |
| unified/ql/lib/ext/format-string.model.yml | Updates format-string model selectors to use declaration-order labels. |
| unified/ql/lib/codeql/unified/internal/mad/LegacyMaD.qll | Preserves argument-label order when constructing MaD signatures for calls and callable declarations. |
Review effort: Lite (dynamic)
| ) | ||
| | | ||
| name + ":" order by group, name | ||
| name + ":" order by arg.getParentIndex() |
| ) | ||
| | | ||
| name + ":" order by group, name | ||
| name + ":" order by param.getParentIndex() |
geoffw0
approved these changes
Nov 16, 2026
Contributor
There was a problem hiding this comment.
LGTM.
The existing query tests give me a lot of confidence in the adjustments to models.
There's a significant risk of merge / semantic merge issues with my work on various new queries. I think we should merge this as soon as possible, I will fix up my open PRs, and check recently merged ones as well.
This branch has not been deployed
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.

The argument label order had been sorted due to an incorrect belief that they could appear at an arbitrary order at the call site. This PR restores the MaD models to use the original declaration order.