mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
python: The MaD token Instance now follows subclasses
This commit is contained in:
@@ -226,6 +226,11 @@ module API {
|
||||
*/
|
||||
Node getASubclass() { result = this.getASuccessor(Label::subclass()) }
|
||||
|
||||
/**
|
||||
* Gets a node representing an instance of the class (or a transitive subclass of the class) represented by this node.
|
||||
*/
|
||||
Node getAnInstance() { result = this.getASubclass*().getReturn() }
|
||||
|
||||
/**
|
||||
* Gets a node representing the result from awaiting this node.
|
||||
*/
|
||||
|
||||
@@ -53,7 +53,7 @@ API::Node getExtraSuccessorFromNode(API::Node node, AccessPathTokenBase token) {
|
||||
result = node.getMember(token.getAnArgument())
|
||||
or
|
||||
token.getName() = "Instance" and
|
||||
result = node.getReturn() // In Python `Instance` is just an alias for `ReturnValue`
|
||||
result = node.getAnInstance()
|
||||
or
|
||||
token.getName() = "Awaited" and
|
||||
result = node.getAwaited()
|
||||
|
||||
Reference in New Issue
Block a user