| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Fixes shared Python CFG/SSA regressions affecting exception-handler reachability and module-export phi uses.
Changes:
| File | Description |
|---|---|
| python/ql/lib/semmle/python/controlflow/internal/AstNodeImpl.qll | Uses canonical CFG-node mapping for exception flow. |
| python/ql/lib/semmle/python/dataflow/new/internal/SsaImpl.qll | Supports phi definitions when resolving uses. |
| python/ql/test/library-tests/ControlFlow/shared-cfg-exceptions/test.py | Adds yield and import exception cases. |
| python/ql/test/library-tests/ControlFlow/shared-cfg-exceptions/ExceptionReachabilityTest.ql | Checks typed-handler reachability. |
| python/ql/test/library-tests/ControlFlow/shared-cfg-exceptions/ExceptionReachabilityTest.expected | Records expected exception results. |
| python/ql/test/library-tests/dataflow-new-ssa/test.py | Adds conditional module-export coverage. |
| python/ql/test/library-tests/dataflow-new-ssa/SsaTest.ql | Checks synthetic exit uses for phi definitions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 860cd56d-31cf-49f4-a947-45e0d72447c6
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes exception-handler reachability in the shared Python CFG introduced by #21921 and now present on main. Testing the dataflow switch-over in #21925 surfaced the bug.
Leaf expressions that may throw, including bare yield and plain imports, were not always connected to typed exception-handler entries. The fix uses the canonical shared-CFG injects mapping when starting exceptional completion, so these expressions reach the appropriate catch entry.
Tests
Adds focused inline coverage for:
DCA impact
The switch-over DCA in #38556 exposed effects of the missing exception edges in mypy, CPython, and youtube-dl. Restoring these edges recovers the affected catch reachability and downstream flow.
Validation