Files
codeql/python/ql/lib/semmle/python/frameworks
yoff f9398546a4 Python: remove getAFlowNode() — bridge AST→CFG only via CFG-side getNode()
Option 2: eliminates the AST→CFG bridge from the AST layer. Previously
'AstNode.getAFlowNode()' returned a 'ControlFlowNode' from the legacy
'Flow.qll' CFG via 'py_flow_bb_node' — this hardcoded the AST to know
about the legacy CFG, preventing files from cleanly switching to the
new shared CFG.

Removes:
  * 'AstNode.getAFlowNode()' from 'AstExtended.qll'
  * Type-narrowing overrides on 'Attribute' / 'Subscript' / 'Call' /
    'IfExp' / 'Name' / 'NameConstant' / 'ImportMember' (in Exprs.qll
    and Import.qll)

Rewrites ~130 call sites across 'python/ql/lib/' and 'python/ql/src/'
to bridge from the CFG side instead:

  Before:  node = expr.getAFlowNode()
  After:   node.getNode() = expr

  Before:  expr.getAFlowNode().(DefinitionNode).getValue()
  After:   exists(DefinitionNode d | d.getNode() = expr | d.getValue())

  Before:  cn.operands(const.getAFlowNode(), op, x)
  After:   exists(ControlFlowNode c | c.getNode() = const | cn.operands(c, op, x))

This is semantically a no-op — both forms are duals of the same predicate.
Verified by passing all library tests:
  * 64 dataflow tests
  * 28 ControlFlow + dataflow-new-ssa tests
  * 1 essa SSA-compute test
  * 93 tests total in the focused suite

Once committed, files that want to switch from the legacy 'Flow' CFG
to the new 'Cfg' facade only need to change their imports — the
bridge sites are CFG-side and respect whichever ControlFlowNode is in
scope.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-28 21:09:46 +00:00
..
2026-03-27 22:39:10 +00:00
2025-07-14 16:30:45 +02:00
2023-12-08 11:27:52 +01:00
2025-07-14 16:30:45 +02:00
2023-03-22 15:51:47 +01:00
2023-09-29 11:32:51 +02:00
2021-10-08 11:55:54 +02:00
2024-12-09 19:55:42 +00:00
2024-05-15 15:08:27 +02:00
2025-07-14 16:30:45 +02:00
2023-12-08 11:27:51 +01:00
2024-12-09 19:57:39 +00:00
2023-09-25 10:35:18 +02:00
2024-05-10 08:32:45 +02:00
2022-09-09 10:34:14 +02:00
2022-09-09 10:34:14 +02:00
2025-07-14 16:30:45 +02:00
2023-12-08 11:27:51 +01:00
2023-12-08 11:27:51 +01:00
2022-10-10 13:49:26 +02:00
2022-03-07 18:59:49 +00:00
2023-09-25 10:24:53 +02:00
2024-05-27 09:48:10 +00:00
2022-10-13 18:08:47 +02:00
2025-05-27 13:51:03 +02:00
2024-05-29 15:42:29 +02:00
2023-12-08 11:27:52 +01:00
2024-05-10 08:32:45 +02:00
2024-01-29 14:30:20 +01:00
2025-07-14 16:30:45 +02:00
2023-12-08 11:27:51 +01:00
2022-10-13 12:43:47 +02:00
2025-07-14 16:30:45 +02:00
v1
2023-10-08 21:24:54 +02:00
2025-11-26 11:23:04 +00:00
2024-12-18 15:58:51 +01:00
2026-02-16 13:48:32 +00:00
2024-07-31 13:22:27 +02:00
2021-11-02 11:57:15 +01:00
2025-11-24 13:57:43 +00:00
2025-07-14 16:30:45 +02:00
2025-12-01 20:41:59 +00:00
2024-04-24 14:05:40 +01:00