Skip to content

Unified: Use getAnArgument() to check argument of a MaD token - #22956

Merged
asgerf merged 2 commits into
github:mainfrom
asgerf:unified/fix-atomic-token-check
Oct 30, 2026
Merged

asgerf merged 2 commits into
github:mainfrom
asgerf:unified/fix-atomic-token-check

Conversation

@asgerf

@asgerf asgerf commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Writing token = "Argument[self]" fails to work for tokens like Argument[self,0]

@asgerf asgerf added the no-change-note-required This PR does not need a change note label Oct 30, 2026
@asgerf
asgerf marked this pull request as ready for review October 30, 2026 12:38
Copilot AI auto review requested due to automatic review settings October 30, 2026 12:38
@asgerf
asgerf requested a review from a team as a code owner October 30, 2026 12:38

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.

🟢 Approval recommended

The change adds multi-argument receiver matching in the legacy MaD interpreter and includes regression models, tests, and expected results, with no active review issues identified.

No open issues 🎉

What changed in this PR

Updates Unified’s legacy MaD interpreter to recognize receiver tokens when self appears alongside positional arguments, such as Argument[self,0] and Parameter[self,0].

Changes:

  • Matches Argument and Parameter tokens by name and individual arguments.
  • Preserves receiver handling for multi-argument tokens.
  • Adds Swift MaD regression models, test cases, and expected results.
File Description
unified/​ql/​test/​library-tests/​mad/​test.swift Adds Swift source and sink cases using shorthand MaD tokens.
unified/​ql/​test/​library-tests/​mad/​test.ext.yml Defines models with combined receiver and positional-argument tokens.
unified/​ql/​test/​library-tests/​mad/​test.expected Records the expected receiver and explicit-argument results.
unified/​ql/​lib/​codeql/​unified/​internal/​mad/​LegacyMaD.qll Supports receiver matching within multi-argument MaD tokens.

Review effort: Lite (auto)

@asgerf
asgerf merged commit 350cd9b into github:main Oct 30, 2026
17 checks passed
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