Skip to content

Commit bd46b7d

Browse files
committed
Python: Cache a few call-graph predicates
We DON'T want to recompute these ones for sure!
1 parent 6646e98 commit bd46b7d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,7 @@ predicate resolveClassInstanceCall(CallNode call, Function target, Node self) {
10391039
/**
10401040
* Holds if `call` is a call to the `target`, with call-type `type`.
10411041
*/
1042+
cached
10421043
predicate resolveCall(ControlFlowNode call, Function target, CallType type) {
10431044
type instanceof CallTypePlainFunction and
10441045
call.(CallNode).getFunction() = functionTracker(target).asCfgNode() and
@@ -1114,6 +1115,7 @@ predicate normalCallArg(CallNode call, Node arg, ArgumentPosition apos) {
11141115
* Note: If `Bar.meth` and `Foo.meth` resolves to the same function, we will end up
11151116
* sending both `self` arguments to that function, which is by definition the right thing to do.
11161117
*/
1118+
cached
11171119
predicate getCallArg(
11181120
ControlFlowNode call, Function target, CallType type, Node arg, ArgumentPosition apos
11191121
) {

0 commit comments

Comments
 (0)