Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class LetStmtTree extends PreOrderTree, LetStmt {
}

class MacroCallTree extends StandardPostOrderTree, MacroCall {
MacroCallTree() { not this.getParentNode() instanceof MacroPat }

override AstNode getChildNode(int i) { i = 0 and result = this.getMacroCallExpansion() }
}

Expand Down
25 changes: 2 additions & 23 deletions rust/ql/test/library-tests/controlflow/BasicBlocks.expected
Original file line number Diff line number Diff line change
Expand Up @@ -675,20 +675,11 @@ dominates
| test.rs:453:5:458:5 | enter fn or_pattern_3 | test.rs:455:13:455:25 | 2 |
| test.rs:453:5:458:5 | enter fn or_pattern_3 | test.rs:455:13:455:25 | [match(false)] 1 \| 2 |
| test.rs:453:5:458:5 | enter fn or_pattern_3 | test.rs:455:13:455:25 | [match(true)] 1 \| 2 |
| test.rs:453:5:458:5 | enter fn or_pattern_3 | test.rs:455:13:455:25 | one_or_two!... |
| test.rs:453:5:458:5 | enter fn or_pattern_3 | test.rs:455:30:455:30 | 3 |
| test.rs:453:5:458:5 | enter fn or_pattern_3 | test.rs:456:13:456:13 | _ |
| test.rs:454:9:457:9 | match a { ... } | test.rs:454:9:457:9 | match a { ... } |
| test.rs:455:13:455:25 | 2 | test.rs:455:13:455:25 | 2 |
| test.rs:455:13:455:25 | 2 | test.rs:455:13:455:25 | [match(false)] 1 \| 2 |
| test.rs:455:13:455:25 | 2 | test.rs:456:13:456:13 | _ |
| test.rs:455:13:455:25 | [match(false)] 1 \| 2 | test.rs:455:13:455:25 | [match(false)] 1 \| 2 |
| test.rs:455:13:455:25 | [match(false)] 1 \| 2 | test.rs:456:13:456:13 | _ |
| test.rs:455:13:455:25 | [match(true)] 1 \| 2 | test.rs:455:13:455:25 | [match(true)] 1 \| 2 |
| test.rs:455:13:455:25 | [match(true)] 1 \| 2 | test.rs:455:30:455:30 | 3 |
| test.rs:455:13:455:25 | one_or_two!... | test.rs:455:13:455:25 | one_or_two!... |
| test.rs:455:30:455:30 | 3 | test.rs:455:30:455:30 | 3 |
| test.rs:456:13:456:13 | _ | test.rs:456:13:456:13 | _ |
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:461:9:464:9 | match pair { ... } |
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:462:32:462:32 | _ |
Expand Down Expand Up @@ -1356,16 +1347,9 @@ postDominance
| test.rs:454:9:457:9 | match a { ... } | test.rs:455:13:455:25 | 2 |
| test.rs:454:9:457:9 | match a { ... } | test.rs:455:13:455:25 | [match(false)] 1 \| 2 |
| test.rs:454:9:457:9 | match a { ... } | test.rs:455:13:455:25 | [match(true)] 1 \| 2 |
| test.rs:454:9:457:9 | match a { ... } | test.rs:455:30:455:30 | 3 |
| test.rs:454:9:457:9 | match a { ... } | test.rs:456:13:456:13 | _ |
| test.rs:455:13:455:25 | 2 | test.rs:455:13:455:25 | 2 |
| test.rs:455:13:455:25 | [match(false)] 1 \| 2 | test.rs:455:13:455:25 | [match(false)] 1 \| 2 |
| test.rs:455:13:455:25 | [match(true)] 1 \| 2 | test.rs:455:13:455:25 | [match(true)] 1 \| 2 |
| test.rs:455:13:455:25 | one_or_two!... | test.rs:455:13:455:25 | one_or_two!... |
| test.rs:455:30:455:30 | 3 | test.rs:455:13:455:25 | [match(true)] 1 \| 2 |
| test.rs:455:30:455:30 | 3 | test.rs:455:30:455:30 | 3 |
| test.rs:456:13:456:13 | _ | test.rs:455:13:455:25 | [match(false)] 1 \| 2 |
| test.rs:456:13:456:13 | _ | test.rs:456:13:456:13 | _ |
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:461:9:464:9 | match pair { ... } |
Expand Down Expand Up @@ -1673,9 +1657,6 @@ immediateDominator
| test.rs:455:13:455:25 | 2 | test.rs:453:5:458:5 | enter fn or_pattern_3 |
| test.rs:455:13:455:25 | [match(false)] 1 \| 2 | test.rs:455:13:455:25 | 2 |
| test.rs:455:13:455:25 | [match(true)] 1 \| 2 | test.rs:453:5:458:5 | enter fn or_pattern_3 |
| test.rs:455:13:455:25 | one_or_two!... | test.rs:453:5:458:5 | enter fn or_pattern_3 |
| test.rs:455:30:455:30 | 3 | test.rs:455:13:455:25 | [match(true)] 1 \| 2 |
| test.rs:456:13:456:13 | _ | test.rs:455:13:455:25 | [match(false)] 1 \| 2 |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:462:32:462:32 | _ | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:463:13:463:13 | _ | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
Expand Down Expand Up @@ -2204,12 +2185,10 @@ joinBlockPredecessor
| test.rs:443:13:443:36 | ... \| ... | test.rs:443:26:443:36 | Some(...) | 1 |
| test.rs:443:26:443:36 | Some(...) | test.rs:443:13:443:22 | Some(...) | 1 |
| test.rs:443:26:443:36 | Some(...) | test.rs:443:18:443:21 | true | 0 |
| test.rs:454:9:457:9 | match a { ... } | test.rs:455:30:455:30 | 3 | 0 |
| test.rs:454:9:457:9 | match a { ... } | test.rs:456:13:456:13 | _ | 1 |
| test.rs:454:9:457:9 | match a { ... } | test.rs:455:13:455:25 | [match(false)] 1 \| 2 | 0 |
| test.rs:454:9:457:9 | match a { ... } | test.rs:455:13:455:25 | [match(true)] 1 \| 2 | 1 |
| test.rs:455:13:455:25 | [match(true)] 1 \| 2 | test.rs:453:5:458:5 | enter fn or_pattern_3 | 1 |
| test.rs:455:13:455:25 | [match(true)] 1 \| 2 | test.rs:455:13:455:25 | 2 | 0 |
| test.rs:455:13:455:25 | one_or_two!... | test.rs:455:13:455:25 | [match(false)] 1 \| 2 | 0 |
| test.rs:455:13:455:25 | one_or_two!... | test.rs:455:13:455:25 | [match(true)] 1 \| 2 | 1 |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:462:32:462:32 | _ | 0 |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:463:13:463:13 | _ | 1 |
| test.rs:476:9:480:9 | match e { ... } | test.rs:477:32:477:32 | _ | 0 |
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions rust/ql/test/library-tests/controlflow/Cfg.expected
Original file line number Diff line number Diff line change
Expand Up @@ -1129,9 +1129,7 @@ edges
| test.rs:455:13:455:25 | 2 | test.rs:455:13:455:25 | [match(false)] 1 \| 2 | no-match |
| test.rs:455:13:455:25 | 2 | test.rs:455:13:455:25 | [match(true)] 1 \| 2 | match |
| test.rs:455:13:455:25 | MacroPat | test.rs:455:13:455:25 | 1 | match |
| test.rs:455:13:455:25 | [match(false)] 1 \| 2 | test.rs:455:13:455:25 | one_or_two!... | no-match |
| test.rs:455:13:455:25 | [match(false)] 1 \| 2 | test.rs:456:13:456:13 | _ | no-match |
| test.rs:455:13:455:25 | [match(true)] 1 \| 2 | test.rs:455:13:455:25 | one_or_two!... | match |
| test.rs:455:13:455:25 | [match(true)] 1 \| 2 | test.rs:455:30:455:30 | 3 | match |
| test.rs:455:30:455:30 | 3 | test.rs:454:9:457:9 | match a { ... } | |
| test.rs:456:13:456:13 | _ | test.rs:456:18:456:18 | 4 | match |
Expand Down