Skip to content

Commit c84e471

Browse files
committed
Python: Fix test issues
1 parent e0437b6 commit c84e471

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

python/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ private module Input implements InputSig<Location, PythonDataFlow> {
134134
other.getNode().getScope() = f
135135
)
136136
}
137+
138+
predicate missingArgumentCallExclude(ArgumentNode arg) {
139+
// We overapproximate the argument nodes in order to not rely on the global `getCallArg`
140+
// predicate.
141+
// Because of this, we must exclude the cases where we have an approximation but no actual
142+
// argument node.
143+
arg = getCallArgApproximation() and not getCallArg(_, _, _, arg, _)
144+
}
137145
}
138146

139147
import MakeConsistency<Location, PythonDataFlow, PythonTaintTracking, Input>

python/ql/src/Classes/InitCallsSubclass/InitCallsSubclassMethod.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import python
1616
import semmle.python.dataflow.new.DataFlow
1717
import semmle.python.dataflow.new.internal.DataFlowDispatch
18+
import semmle.python.dataflow.new.internal.DataFlowPrivate
1819

1920
predicate initSelfCallOverridden(
2021
Function init, DataFlow::Node self, DataFlow::MethodCallNode call, Function target,
@@ -39,7 +40,7 @@ predicate readsFromSelf(Function method) {
3940
self.getParameter() = method.getArg(0) and
4041
DataFlow::localFlow(self, sink)
4142
|
42-
sink instanceof DataFlow::ArgumentNode
43+
isArgumentNode(sink, _, _)
4344
or
4445
sink = any(DataFlow::AttrRead a).getObject()
4546
)

0 commit comments

Comments
 (0)