Skip to content

Commit 262d43a

Browse files
committed
Python: Make compile and add comment
1 parent 2051ba3 commit 262d43a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private module Input implements InputSig<PythonDataFlow> {
4949
predicate uniqueEnclosingCallableExclude(Node n) {
5050
// `CaptureNode`s miss enclosing calables in some cases.
5151
exists(Function func |
52-
func = n.(CaptureNode).getSynthesizedCaptureNode().getEnclosingCallable()
52+
func = n.(SynthCaptureNode).getSynthesizedCaptureNode().getEnclosingCallable()
5353
|
5454
// This can happen if `func` is a comprehension.
5555
// In that case, there is no associated DataFlowCallable.
@@ -60,8 +60,8 @@ private module Input implements InputSig<PythonDataFlow> {
6060
or
6161
// We only have a selection of valid callables.
6262
// For instance, we do not have classes as `DataFlowCallable`s.
63-
not n.(CaptureNode).getSynthesizedCaptureNode().getEnclosingCallable() instanceof Function and
64-
not n.(CaptureNode).getSynthesizedCaptureNode().getEnclosingCallable() instanceof Module
63+
not n.(SynthCaptureNode).getSynthesizedCaptureNode().getEnclosingCallable() instanceof Function and
64+
not n.(SynthCaptureNode).getSynthesizedCaptureNode().getEnclosingCallable() instanceof Module
6565
}
6666

6767
predicate uniqueCallEnclosingCallableExclude(DataFlowCall call) {
@@ -141,6 +141,7 @@ private module Input implements InputSig<PythonDataFlow> {
141141
other.getNode().getScope() = f
142142
)
143143
or
144+
// The capture argument node will be reused for every call to the same callable.
144145
arg = call.getArgument(_) and
145146
arg instanceof CaptureArgumentNode
146147
}

0 commit comments

Comments
 (0)