mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Python: Add points-to regression for metaclass
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| test.py:6:5:6:22 | Function Foo.foo | test.py:9:1:9:11 | ControlFlowNode for Attribute() |
|
||||
@@ -0,0 +1,4 @@
|
||||
import python
|
||||
|
||||
from PythonFunctionValue func
|
||||
select func, func.getACall()
|
||||
@@ -0,0 +1,25 @@
|
||||
# Simple classmethod
|
||||
|
||||
class Foo(object):
|
||||
|
||||
@classmethod
|
||||
def foo(cls, arg):
|
||||
print(cls, arg)
|
||||
|
||||
Foo.foo(42)
|
||||
|
||||
|
||||
# classmethod defined by metaclass
|
||||
|
||||
class BarMeta(type):
|
||||
|
||||
def bar(cls, arg):
|
||||
print(cls, arg)
|
||||
|
||||
class Bar(metaclass=BarMeta):
|
||||
pass
|
||||
|
||||
Bar.bar(42) # TODO: No points-to
|
||||
|
||||
# If this is solved, please update python/ql/src/Variables/UndefinedExport.ql which has a
|
||||
# work-around for this behavior
|
||||
Reference in New Issue
Block a user