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:
Rasmus Wriedt Larsen
2019-09-30 12:29:44 +02:00
parent fc8c1e195a
commit 59e09d6d5d

View File

@@ -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` */