Skip to content

Commit 4398c83

Browse files
committed
Rust: Add more QLDoc to the CFG consistency library.
1 parent 85f2582 commit 4398c83

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rust/ql/lib/codeql/rust/controlflow/internal/CfgConsistency.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ query predicate nonPostOrderExpr(Expr e, string cls) {
2323
)
2424
}
2525

26+
/**
27+
* Holds if CFG scope `scope` lacks an initial AST node. Overrides shared consistency predicate.
28+
*/
2629
query predicate scopeNoFirst(CfgScope scope) {
2730
Consistency::scopeNoFirst(scope) and
2831
not scope = any(Function f | not exists(f.getBody())) and
@@ -35,6 +38,9 @@ private predicate letElsePanic(BlockExpr be) {
3538
exists(Completion c | CfgImpl::last(be, _, c) | completionIsNormal(c))
3639
}
3740

41+
/**
42+
* Holds if `node` is lacking a successor. Overrides shared consistency predicate.
43+
*/
3844
query predicate deadEnd(CfgImpl::Node node) {
3945
Consistency::deadEnd(node) and
4046
not letElsePanic(node.getAstNode())

0 commit comments

Comments
 (0)