mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: CG trace: handle class instantiation properly in points-to
This commit is contained in:
@@ -248,8 +248,15 @@ module PointsToBasedCallGraph {
|
||||
xmlCallee = this.getXMLCallee() and
|
||||
(
|
||||
xmlCallee instanceof XMLPythonCallee and
|
||||
(
|
||||
// normal function
|
||||
calleeValue.(PythonFunctionValue).getScope() = xmlCallee.(XMLPythonCallee).getACallee()
|
||||
or
|
||||
// class instantiation -- points-to says the call goes to the class
|
||||
calleeValue.(ClassValue).lookup("__init__").(PythonFunctionValue).getScope() =
|
||||
xmlCallee.(XMLPythonCallee).getACallee()
|
||||
)
|
||||
or
|
||||
xmlCallee instanceof XMLExternalCallee and
|
||||
calleeValue.(BuiltinFunctionObjectInternal).getBuiltin() =
|
||||
xmlCallee.(XMLExternalCallee).getACallee()
|
||||
|
||||
Reference in New Issue
Block a user