File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
lib/codeql/rust/controlflow/internal
test/library-tests/controlflow Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -494,9 +494,13 @@ class MatchExprTree extends PostOrderTree instanceof MatchExpr {
494494 override predicate first ( AstNode node ) { first ( super .getExpr ( ) , node ) }
495495
496496 override predicate succ ( AstNode pred , AstNode succ , Completion c ) {
497- // Edge from the scrutinee to the first arm.
497+ // Edge from the scrutinee to the first arm or to the match expression if no arms .
498498 last ( super .getExpr ( ) , pred , c ) and
499- first ( super .getArm ( 0 ) .getPat ( ) , succ ) and
499+ (
500+ first ( super .getArm ( 0 ) .getPat ( ) , succ )
501+ or
502+ not exists ( super .getArm ( 0 ) ) and succ = this
503+ ) and
500504 completionIsNormal ( c )
501505 or
502506 // Edge from a failed pattern or guard in one arm to the beginning of the next arm.
Original file line number Diff line number Diff line change @@ -681,6 +681,8 @@ edges
681681| test.rs:311:26:311:30 | value | test.rs:310:9:313:9 | MatchExpr | |
682682| test.rs:312:13:312:22 | TupleStructPat | test.rs:312:17:312:21 | never | match |
683683| test.rs:312:17:312:21 | never | test.rs:312:33:312:37 | never | match |
684+ | test.rs:312:27:312:40 | MatchExpr | test.rs:310:9:313:9 | MatchExpr | |
685+ | test.rs:312:33:312:37 | never | test.rs:312:27:312:40 | MatchExpr | |
684686| test.rs:319:5:322:5 | enter test_let_match | test.rs:319:23:319:23 | a | |
685687| test.rs:319:5:322:5 | exit test_let_match (normal) | test.rs:319:5:322:5 | exit test_let_match | |
686688| test.rs:319:23:319:23 | a | test.rs:319:23:319:36 | Param | match |
You can’t perform that action at this time.
0 commit comments