mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: Allow cls passing to classmethod
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user