File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
lib/codeql/rust/controlflow/internal
test/library-tests/controlflow Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -507,9 +507,12 @@ class MatchExprTree extends PostOrderTree instanceof MatchExpr {
507
507
first ( super .getArm ( 0 ) .getPat ( ) , succ ) and
508
508
completionIsNormal ( c )
509
509
or
510
- // Edge from a failed match/ guard in one arm to the beginning of the next arm.
510
+ // Edge from a failed pattern or guard in one arm to the beginning of the next arm.
511
511
exists ( int i |
512
- last ( super .getArm ( i ) , pred , c ) and
512
+ (
513
+ last ( super .getArm ( i ) .getPat ( ) , pred , c ) or
514
+ last ( super .getArm ( i ) .getGuard ( ) .getCondition ( ) , pred , c )
515
+ ) and
513
516
first ( super .getArm ( i + 1 ) , succ ) and
514
517
c .( ConditionalCompletion ) .failed ( )
515
518
)
Original file line number Diff line number Diff line change @@ -661,7 +661,6 @@ edges
661
661
| test.rs:297:18:297:18 | a | test.rs:297:24:297:24 | a | match |
662
662
| test.rs:297:24:297:24 | a | test.rs:296:10:299:9 | [boolean(false)] MatchExpr | false |
663
663
| test.rs:297:24:297:24 | a | test.rs:296:10:299:9 | [boolean(true)] MatchExpr | true |
664
- | test.rs:297:24:297:24 | a | test.rs:298:13:298:13 | WildcardPat | false |
665
664
| test.rs:298:13:298:13 | WildcardPat | test.rs:298:18:298:22 | false | match |
666
665
| test.rs:298:18:298:22 | false | test.rs:296:10:299:9 | [boolean(false)] MatchExpr | false |
667
666
| test.rs:299:15:299:18 | cond | test.rs:296:9:299:18 | ... && ... | |
You can’t perform that action at this time.
0 commit comments