mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Python: Add test case for unwanted module type tracking
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import module.attr as attr_ref
|
||||
|
||||
x = attr_ref
|
||||
|
||||
def fun():
|
||||
y = attr_ref
|
||||
|
||||
# The following should _not_ be a reference to the above module, since we don't actually import it.
|
||||
z = module
|
||||
@@ -1,5 +1,12 @@
|
||||
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