mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Python: Add nullary pointsTo to Expr class
Like the one existing in ControlFlowNode.
This is useful for checking class of value being poitned to, as
expr.pointsTo().getClass() = someClass
Without this you need to do
exists(Value v | v.getClass() = someClass | expr.pointsTo(v))
This commit is contained in:
@@ -126,6 +126,11 @@ class Expr extends Expr_, AstNode {
|
||||
this.pointsTo(value, _)
|
||||
}
|
||||
|
||||
/** Gets a value that this expression might "point-to". */
|
||||
Value pointsTo() {
|
||||
this.pointsTo(result)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** An attribute expression, such as `value.attr` */
|
||||
|
||||
Reference in New Issue
Block a user