mirror of
https://github.com/github/codeql.git
synced 2026-05-31 11:31:23 +02:00
Sweep the last few uses of legacy AstNode.getAFlowNode() in tests over to explicit ControlFlowNode joins after the shared-CFG migration. importflow.ql needs the new Cfg::ControlFlowNode/CompareNode types because DataFlow::Node. asCfgNode() now returns the shared-CFG node. Also extend ImportResolution::allowedEssaImportStep to walk back through uncertain-write SSA inputs, so that a later 'from X import *' does not hide the preceding explicit (re)assignment from module-export resolution. Without this, a reassigned name that survives a wildcard import was no longer recognised as the module export. Rebless ModuleExport.expected to drop the legacy 'ControlFlowNode for' toString prefix and pick up the two correct rows exposed by the fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
12 lines
312 B
Plaintext
12 lines
312 B
Plaintext
import python
|
|
|
|
from AstNode a, Scope s
|
|
where
|
|
not a instanceof Import and
|
|
not a instanceof If and
|
|
not a instanceof AssignStmt and
|
|
not a instanceof ExprStmt and
|
|
a.getScope() = s and
|
|
s instanceof Function
|
|
select a.getLocation().getStartLine(), s.getName(), a, count(ControlFlowNode n | n.getNode() = a)
|