We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67a06cb commit 3dc517cCopy full SHA for 3dc517c
1 file changed
rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll
@@ -97,12 +97,14 @@ class IfExprTree extends PostOrderTree instanceof IfExpr {
97
}
98
99
override predicate succ(AstNode pred, AstNode succ, Completion c) {
100
- // Edges from the condition to each branch
+ // Edges from the condition to the branches
101
last(super.getCondition(), pred, c) and
102
(
103
first(super.getThen(), succ) and c.(BooleanCompletion).getValue() = true
104
or
105
first(super.getElse(), succ) and c.(BooleanCompletion).getValue() = false
106
+ or
107
+ not super.hasElse() and succ = this and c.(BooleanCompletion).getValue() = false
108
)
109
110
// An edge from the then branch to the last node
0 commit comments