Skip to content

Commit 0c4bcec

Browse files
committed
Python: Fix ModuleVariableNode.toString
In some cases mod.getName() does not have a result, so toString of ModuleVariableNode would also not have a result, which would cause data-flow paths that use these as an edge to not be valid :O
1 parent bc08d67 commit 0c4bcec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ class ModuleVariableNode extends Node, TModuleVariableNode {
407407
override Scope getScope() { result = mod }
408408

409409
override string toString() {
410-
result = "ModuleVariableNode for " + mod.getName() + "." + var.getId()
410+
result = "ModuleVariableNode in " + mod.toString() + " for " + var.getId()
411411
}
412412

413413
/** Gets the module in which this variable appears. */

0 commit comments

Comments
 (0)