Skip to content

Commit 8e2c1a4

Browse files
author
Alvaro Muñoz
committed
Expose predicates to check local flow
1 parent 3e2dffc commit 8e2c1a4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ql/lib/codeql/actions/dataflow/internal/DataFlowPublic.qll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,16 @@ class FieldContent extends Content, TFieldContent {
174174

175175
override string toString() { result = name }
176176
}
177+
178+
predicate hasLocalFlow(Node n1, Node n2) {
179+
simpleLocalFlowStep(n1, n2) or
180+
exists(ContentSet c | ctxFieldReadStep(n1, n2, c))
181+
}
182+
183+
predicate hasLocalFlowExpr(AstNode n1, AstNode n2) {
184+
exists(Node dn1, Node dn2 |
185+
dn1.asExpr() = n1 and
186+
dn2.asExpr() = n2 and
187+
hasLocalFlow(dn1, dn2)
188+
)
189+
}

0 commit comments

Comments
 (0)