Skip to content

Commit a507854

Browse files
committed
Rust: Fix bug in BooleanCompletion.isValidForSpecific0
1 parent 8c1fd8f commit a507854

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class BooleanCompletion extends ConditionalCompletion, TBooleanCompletion {
8686
or
8787
e = any(WhileExpr c).getCondition()
8888
or
89-
any(MatchArm arm).getGuard() = e
89+
any(MatchGuard guard).getCondition() = e
9090
or
9191
exists(BinaryExpr expr |
9292
expr.getOperatorName() = ["&&", "||"] and
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
deadEnd
2-
| test.rs:230:28:230:33 | ... < ... |
32
| test.rs:245:30:245:48 | BlockExpr |

rust/ql/test/library-tests/controlflow/Cfg.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,12 @@
428428
| test.rs:230:9:230:23 | TupleStructPat | test.rs:230:28:230:28 | x | match |
429429
| test.rs:230:9:230:23 | TupleStructPat | test.rs:231:9:231:23 | TupleStructPat | no-match |
430430
| test.rs:230:28:230:28 | x | test.rs:230:32:230:33 | 10 | |
431+
| test.rs:230:28:230:33 | ... < ... | test.rs:230:38:230:38 | x | true |
432+
| test.rs:230:28:230:33 | ... < ... | test.rs:231:9:231:23 | TupleStructPat | false |
431433
| test.rs:230:32:230:33 | 10 | test.rs:230:28:230:33 | ... < ... | |
434+
| test.rs:230:38:230:38 | x | test.rs:230:42:230:42 | 5 | |
435+
| test.rs:230:38:230:42 | ... + ... | test.rs:229:5:233:5 | MatchExpr | |
436+
| test.rs:230:42:230:42 | 5 | test.rs:230:38:230:42 | ... + ... | |
432437
| test.rs:231:9:231:23 | TupleStructPat | test.rs:231:28:231:28 | x | match |
433438
| test.rs:231:9:231:23 | TupleStructPat | test.rs:232:9:232:20 | PathPat | no-match |
434439
| test.rs:231:28:231:28 | x | test.rs:229:5:233:5 | MatchExpr | |
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
deadEnd
22
| variables.rs:2:5:2:22 | ExprStmt |
33
| variables.rs:6:5:6:22 | ExprStmt |
4-
| variables.rs:200:16:200:21 | ... > ... |
54
| variables.rs:310:5:310:42 | LetStmt |

0 commit comments

Comments
 (0)