Skip to content

Commit ef9f383

Browse files
authored
Merge pull request #18007 from hvitved/rust/cfg/and-let
Rust: Improve CFG for `let` expressions
2 parents 2bfd732 + 46b4bad commit ef9f383

File tree

3 files changed

+789
-701
lines changed

3 files changed

+789
-701
lines changed

Diff for: rust/ql/lib/codeql/rust/controlflow/internal/Splitting.qll

+7-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ module ConditionalCompletionSplitting {
7171
child = parent.(LogicalNotExpr).getExpr() and
7272
childCompletion.getDual() = parentCompletion
7373
or
74-
childCompletion = parentCompletion and
74+
(
75+
childCompletion = parentCompletion
76+
or
77+
// needed for `let` expressions
78+
childCompletion.(MatchCompletion).getValue() =
79+
parentCompletion.(BooleanCompletion).getValue()
80+
) and
7581
(
7682
child = parent.(BinaryLogicalOperation).getAnOperand()
7783
or

0 commit comments

Comments
 (0)