diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll index b9d0b65e876..7c2537a3b56 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll @@ -1054,7 +1054,7 @@ predicate getCallArg( type instanceof CallTypeClassMethod and apos.isSelf() and resolveMethodCall(call, target, type, arg) and - arg = classTracker(_) and + (arg = classTracker(_) or arg = clsTracker(_)) and // dataflow lib has requirement that arguments and calls are in same enclosing callable. exists(CfgNode cfgNode | cfgNode.getNode() = call | cfgNode.getEnclosingCallable() = arg.getEnclosingCallable() diff --git a/python/ql/test/experimental/dataflow/calls/test.py b/python/ql/test/experimental/dataflow/calls/test.py index afb22f3659c..0eb7e262cb4 100644 --- a/python/ql/test/experimental/dataflow/calls/test.py +++ b/python/ql/test/experimental/dataflow/calls/test.py @@ -28,7 +28,7 @@ class MyClass(object): @classmethod def other_classmethod(cls): - cls.cm(42) # $ call=cls.cm(..) callType=CallTypeClassMethod arg[position 0]=42 MISSING: arg[self]=cls + cls.cm(42) # $ call=cls.cm(..) callType=CallTypeClassMethod arg[position 0]=42 arg[self]=cls cls.sm(42) # $ call=cls.sm(..) callType=CallTypeStaticMethod arg[position 0]=42 def __getitem__(self, key):