mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
Python: Fix unwanted module type tracking
This commit is contained in:
@@ -70,7 +70,7 @@ Node importModule(string name) {
|
||||
// Because named imports are modelled as `AttrRead`s, the statement `from foo import bar as baz`
|
||||
// is interpreted as if it was an assignment `baz = foo.bar`, which means `baz` gets tracked as a
|
||||
// reference to `foo.bar`, as desired.
|
||||
result.asCfgNode().getNode() = any(ImportExpr i | i.getAnImportedModuleName() = name)
|
||||
result.asCfgNode().getNode() = any(ImportExpr i | i.getName() = name)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
module_tracker
|
||||
| import_as_attr.py:1:6:1:11 | ControlFlowNode for ImportExpr |
|
||||
| import_as_attr_dotted.py:0:0:0:0 | ModuleVariableNode for Global Variable attr_ref in Module import_as_attr_dotted |
|
||||
| import_as_attr_dotted.py:1:8:1:18 | ControlFlowNode for ImportExpr |
|
||||
| import_as_attr_dotted.py:1:23:1:30 | GSSA Variable attr_ref |
|
||||
| import_as_attr_dotted.py:3:1:3:1 | GSSA Variable x |
|
||||
| import_as_attr_dotted.py:3:5:3:12 | ControlFlowNode for attr_ref |
|
||||
| import_as_attr_dotted.py:6:5:6:5 | SSA variable y |
|
||||
| import_as_attr_dotted.py:6:9:6:16 | ControlFlowNode for attr_ref |
|
||||
module_attr_tracker
|
||||
| import_as_attr.py:0:0:0:0 | ModuleVariableNode for Global Variable attr_ref in Module import_as_attr |
|
||||
| import_as_attr.py:1:20:1:35 | ControlFlowNode for ImportMember |
|
||||
|
||||
Reference in New Issue
Block a user