Conversation
paldepind
force-pushed
the
unified/swift-defer
branch
from
September 30, 2026 08:04
5390425 to
b69bf9d
Compare
paldepind
marked this pull request as ready for review
September 30, 2026 08:09
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Deferred bodies are currently modeled as executing immediately instead of at scope exit.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds unified AST extraction for Swift defer statements.
Changes:
- Defines and extracts
defer_stmt. - Regenerates QL/schema artifacts and test expectations.
- Updates control-flow slices, though defer execution semantics remain incorrect.
| File | Description |
|---|---|
unified/extractor/ast_types.yml |
Defines the common defer node. |
unified/extractor/src/languages/swift/swift.rs |
Maps Swift defer statements. |
unified/extractor/tests/corpus/swift/control-flow/defer-statement.output |
Updates generated corpus output. |
unified/ql/lib/unified.dbscheme |
Adds generated database relations. |
unified/ql/lib/codeql/unified/internal/Ast.qll |
Adds the generated QL class. |
unified/ql/test/library-tests/controlflow/basicblock-slices.expected |
Updates generated control-flow expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - for_each_stmt | ||
| - while_stmt | ||
| - do_while_stmt | ||
| - defer_stmt |
Contributor
Author
There was a problem hiding this comment.
I'm pretty sure we can do the accurate CFG later.
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.

Adds a defer statement to the common AST and extracts Swift defer statements into it.