Skip to content

Commit 5cd08b8

Browse files
committed
Python: Ignore .isAbsent() from ClassCall
This means that DataFlowCall is only for resolvable calls, which might not seem like a big thing in itself, but enables the next commit to actually work :P
1 parent a5c2341 commit 5cd08b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ newtype TDataFlowCall =
704704
TFunctionCall(CallNode call) { call = any(FunctionValue f).getAFunctionCall() } or
705705
/** Bound methods need to make room for the explicit self parameter */
706706
TMethodCall(CallNode call) { call = any(FunctionValue f).getAMethodCall() } or
707-
TClassCall(CallNode call) { call = any(ClassValue c).getACall() } or
707+
TClassCall(CallNode call) { call = any(ClassValue c | not c.isAbsent()).getACall() } or
708708
TSpecialCall(SpecialMethodCallNode special)
709709

710710
/** Represents a call. */

python/ql/test/experimental/dataflow/calls/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __getitem__(self, key):
3131
# `mypkg.foo` is a `missing module variable`, but `mypkg.subpkg.bar` is compeltely
3232
# ignored.
3333
import mypkg
34-
mypkg.foo(42) # $ call=mypkg.foo(..) qlclass=ClassCall arg_0=[pre]mypkg.foo(..)
34+
mypkg.foo(42)
3535
mypkg.subpkg.bar(43)
3636
except:
3737
pass

0 commit comments

Comments
 (0)