Skip to content

Shared CFG: check abrupt completion origins - #147

Closed
yoff wants to merge 1 commit into
mainfrom
yoff-abrupt-origin-consistency
Closed

Shared CFG: check abrupt completion origins#147
yoff wants to merge 1 commit into
mainfrom
yoff-abrupt-origin-consistency

Conversation

@yoff

@yoff yoff commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • add invalidAbruptCompletionOrigin to the shared CFG consistency checks;
  • validate only language-supplied Input2::beginAbruptCompletion origins, requiring each origin to be either node.isIn(ast) or node.isAdditional(ast, _);
  • register the check in consistencyOverview and add generated overview tests for every current consumer: Java, C#, and Python.

This intentionally does not inspect the shared library's combined private beginAbruptCompletion, whose unmatched final catch-clause completion legitimately originates at isAfterValue.

Motivation

This follows the consistency-check suggestion from review of github#22380: github#22380 (comment). The change is independent of github#22380 and contains no Python-specific CFG behavior change.

Validation

  • codeql query compile --search-path=. java/ql/consistency-queries/CfgConsistency.ql csharp/ql/consistency-queries/CfgConsistency.ql python/ql/consistency-queries/CfgConsistency.ql
  • codeql test run --search-path=. --consistency-queries java/ql/consistency-queries -- java/ql/test/library-tests/controlflow/basic — 28 tests passed
  • codeql test run --search-path=. --consistency-queries csharp/ql/consistency-queries -- csharp/ql/test/library-tests/controlflow/graph — 13 tests passed
  • codeql test run --search-path=. --consistency-queries python/ql/consistency-queries -- python/ql/test/library-tests/ControlFlow/successors — 7 tests passed

No invalid abrupt-completion origins or unrelated expected-output churn were found in the three consuming languages.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@yoff

yoff commented Aug 25, 2026

Copy link
Copy Markdown
Owner Author

Closing in favor of the upstream pull request against github/codeql:main.

@yoff yoff closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant