Skip to content

Commit 02f2031

Browse files
committed
Python: Ensure other call for super().foo
1 parent 4a98ed9 commit 02f2031

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,12 @@ private module Input implements InputSig<PythonDataFlow> {
111111
or
112112
// in the code `def func(self): super().foo(); super.bar()` we use `self` as the
113113
// (pos self) argument in both .foo() and .bar() calls.
114-
exists(Function f |
114+
exists(Function f, DataFlowCall other | other != call |
115115
exprNode(f.getArg(0)) = arg and
116116
call.getNode().getScope() = f and
117-
arg = call.getArgument(any(ArgumentPosition p | p.isSelf()))
117+
arg = call.getArgument(any(ArgumentPosition p | p.isSelf())) and
118+
arg = other.getArgument(any(ArgumentPosition p | p.isSelf())) and
119+
other.getNode().getScope() = f
118120
)
119121
}
120122
}

0 commit comments

Comments
 (0)