Skip to content

Unified: Add exception CFG edges from try expressions. - #22589

Merged
aschackmull merged 1 commit into
github:mainfrom
aschackmull:unified/cfg-try-exception
Sep 17, 2026
Merged

aschackmull merged 1 commit into
github:mainfrom
aschackmull:unified/cfg-try-exception

Conversation

@aschackmull

Copy link
Copy Markdown
Contributor

This PR adds a swift CFG plugin and adds support for exception edges originating from try-prefixed calls.

Copilot AI balanced review requested due to automatic review settings September 16, 2026 11:23
@aschackmull
aschackmull requested a review from a team as a code owner September 16, 2026 11:23
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Sep 16, 2026

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.

Copilot review overview

🟡 Changes recommended

Exception edges are placed after an entire compound try operand rather than at its potentially throwing call sites.

Get a fresh assessment by requesting another Copilot review.

Review tier: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds Swift exception CFG edges for try expressions and enables catch-clause flow.

Changes:

  • Introduces language-specific CFG plugins.
  • Models try as a possible exception source.
  • Updates Swift CFG tests and generated expectations.
File Description
ControlFlowGraph.qll Integrates exception completions.
ControlFlowGraphPlugin.qll Defines the plugin interface.
ControlFlowGraphPluginSwift.qll Implements Swift try handling.
cfg.swift Adds CFG assertions.
cfg.expected Updates generated CFG results.
basicblock-slices.expected Updates generated block slices.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread unified/ql/lib/codeql/unified/internal/ControlFlowGraphPluginSwift.qll Outdated
@aschackmull
aschackmull marked this pull request as draft September 16, 2026 11:38
@aschackmull
aschackmull force-pushed the unified/cfg-try-exception branch from a11af2e to ea20259 Compare September 16, 2026 12:02
@aschackmull
aschackmull marked this pull request as ready for review September 16, 2026 12:02
@aschackmull
aschackmull requested a review from asgerf September 16, 2026 12:12
@aschackmull
aschackmull merged commit bd4e515 into github:main Sep 17, 2026
16 checks passed
@aschackmull
aschackmull deleted the unified/cfg-try-exception branch September 17, 2026 11:29
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants