Skip to content

Commit

Permalink
Merge pull request #18007 from hvitved/rust/cfg/and-let
Browse files Browse the repository at this point in the history
Rust: Improve CFG for `let` expressions
  • Loading branch information
hvitved authored Nov 19, 2024
2 parents 2bfd732 + 46b4bad commit ef9f383
Show file tree
Hide file tree
Showing 3 changed files with 789 additions and 701 deletions.
8 changes: 7 additions & 1 deletion rust/ql/lib/codeql/rust/controlflow/internal/Splitting.qll
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ module ConditionalCompletionSplitting {
child = parent.(LogicalNotExpr).getExpr() and
childCompletion.getDual() = parentCompletion
or
childCompletion = parentCompletion and
(
childCompletion = parentCompletion
or
// needed for `let` expressions
childCompletion.(MatchCompletion).getValue() =
parentCompletion.(BooleanCompletion).getValue()
) and
(
child = parent.(BinaryLogicalOperation).getAnOperand()
or
Expand Down
Loading

0 comments on commit ef9f383

Please sign in to comment.