Python: Add note about trying DataFlowDispatchPointsTo for InlineCallGraphTest

Since I was very confused about no results for __call__, I tried to see
whether I had cheated by making the comparison too unfair. But it didn't
seem to be the case.
This commit is contained in:
Rasmus Wriedt Larsen
2022-09-06 14:24:30 +02:00
parent f3ac81a013
commit b5e8bf7882

View File

@@ -6,6 +6,10 @@ private import semmle.python.dataflow.new.internal.DataFlowDispatch as TT
predicate pointsToCallEdge(CallNode call, Function callable) {
exists(call.getLocation().getFile().getRelativePath()) and
exists(callable.getLocation().getFile().getRelativePath()) and
// I did try using viableCallable from `DataFlowDispatchPointsTo` (from temporary copy
// of `dataflow.new.internal` that still uses points-to) instead of direct
// `getACall()` on a Value, but it only added results for `__init__` methods, not for
// anything else.
exists(PythonFunctionValue funcValue |
funcValue.getScope() = callable and
call = funcValue.getACall()