Skip to content

Commit 7aa28a0

Browse files
committed
Rust: Fix multiple CFG successors in range pattern without lower bound
1 parent b0625f8 commit 7aa28a0

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ module PatternTrees {
612612
result = rank[i + 1](Pat pat, int j | pat = this.getPat(j) | pat order by j)
613613
}
614614

615-
predicate isEmpty() { not any(Pat p) = this.getPat(0) }
615+
predicate isEmpty() { not any(Pat p) = this.getPatRanked(0) }
616616

617617
override predicate propagatesAbnormal(AstNode child) { child = this.getPatRanked(_) }
618618

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,6 @@ edges
716716
| test.rs:335:9:340:9 | MatchExpr | test.rs:334:31:341:5 | BlockExpr | |
717717
| test.rs:335:15:335:16 | 42 | test.rs:336:13:336:15 | RangePat | |
718718
| test.rs:336:13:336:15 | RangePat | test.rs:336:15:336:15 | LiteralPat | match |
719-
| test.rs:336:13:336:15 | RangePat | test.rs:336:20:336:20 | 1 | match |
720719
| test.rs:336:13:336:15 | RangePat | test.rs:337:13:337:16 | RangePat | no-match |
721720
| test.rs:336:15:336:15 | LiteralPat | test.rs:336:20:336:20 | 1 | match |
722721
| test.rs:336:15:336:15 | LiteralPat | test.rs:337:13:337:16 | RangePat | no-match |

0 commit comments

Comments
 (0)