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>
16 lines
449 B
Plaintext
16 lines
449 B
Plaintext
import python
|
|
|
|
/*Find any Definition, assigned value pairs that 'valueForDefinition' misses */
|
|
Expr assignedValue(Name n) {
|
|
exists(Assign a | a.getATarget() = n and result = a.getValue())
|
|
or
|
|
exists(Alias a | a.getAsname() = n and result = a.getValue())
|
|
}
|
|
|
|
from Name def, DefinitionNode d
|
|
where
|
|
d.getNode() = def and
|
|
exists(assignedValue(def)) and
|
|
not d.getValue().getNode() = assignedValue(def)
|
|
select def.toString(), assignedValue(def)
|