mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Merge pull request #5053 from github/python-add-essavariable-locations
Python: Add locations for ESSA variables
This commit is contained in:
@@ -143,7 +143,7 @@ class EssaNode extends Node, TEssaNode {
|
||||
|
||||
override Scope getScope() { result = var.getScope() }
|
||||
|
||||
override Location getLocation() { result = var.getDefinition().getLocation() }
|
||||
override Location getLocation() { result = var.getLocation() }
|
||||
}
|
||||
|
||||
/** A data-flow node corresponding to a control-flow node. */
|
||||
|
||||
@@ -61,6 +61,13 @@ class EssaVariable extends TEssaDefinition {
|
||||
* defined by `from ... import *` and the like.
|
||||
*/
|
||||
predicate isMetaVariable() { this.getName() = "$" }
|
||||
|
||||
/**
|
||||
* Gets the location of this variable.
|
||||
*
|
||||
* Yields the location of the corresponding definition of this variable.
|
||||
*/
|
||||
Location getLocation() { result = this.getDefinition().getLocation() }
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user