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,7 +248,14 @@ module PointsToBasedCallGraph {
|
|||||||
xmlCallee = this.getXMLCallee() and
|
xmlCallee = this.getXMLCallee() and
|
||||||
(
|
(
|
||||||
xmlCallee instanceof XMLPythonCallee and
|
xmlCallee instanceof XMLPythonCallee and
|
||||||
calleeValue.(PythonFunctionValue).getScope() = xmlCallee.(XMLPythonCallee).getACallee()
|
(
|
||||||
|
// 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
|
or
|
||||||
xmlCallee instanceof XMLExternalCallee and
|
xmlCallee instanceof XMLExternalCallee and
|
||||||
calleeValue.(BuiltinFunctionObjectInternal).getBuiltin() =
|
calleeValue.(BuiltinFunctionObjectInternal).getBuiltin() =
|
||||||
|
|||||||
Reference in New Issue
Block a user