Skip to content

Commit 59e09d6

Browse files
committed
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))
1 parent fc8c1e1 commit 59e09d6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

python/ql/src/semmle/python/Exprs.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ class Expr extends Expr_, AstNode {
126126
this.pointsTo(value, _)
127127
}
128128

129+
/** Gets a value that this expression might "point-to". */
130+
Value pointsTo() {
131+
this.pointsTo(result)
132+
}
133+
129134
}
130135

131136
/** An attribute expression, such as `value.attr` */

0 commit comments

Comments
 (0)