Skip to content

Commit 90537f9

Browse files
committed
Fix other QL code
This reverts commit 5c02fb4.
1 parent 3fdc49c commit 90537f9

File tree

3 files changed

+43
-44
lines changed

3 files changed

+43
-44
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class CallExprTree extends StandardPostOrderTree instanceof CallExpr {
8181
override ControlFlowTree getChildNode(int i) { result = super.getArg(i) }
8282
}
8383

84-
class BinExprTree extends StandardPostOrderTree instanceof BinExpr {
84+
class BinaryOpExprTree extends StandardPostOrderTree instanceof BinaryExpr {
8585
override ControlFlowTree getChildNode(int i) {
8686
i = 0 and result = super.getLhs()
8787
or
@@ -121,7 +121,7 @@ class LetExprTree extends StandardPostOrderTree instanceof LetExpr {
121121
override ControlFlowTree getChildNode(int i) { i = 0 and result = super.getExpr() }
122122
}
123123

124-
class LiteralTree extends LeafTree instanceof Literal { }
124+
class LiteralExprTree extends LeafTree instanceof LiteralExpr { }
125125

126126
class PathExprTree extends LeafTree instanceof PathExpr { }
127127

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import rust
2-
import TestUtils
32

43
from File f
5-
where fileIsInTest(f)
4+
where exists(f.getRelativePath())
65
select f

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

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,33 @@ nodes
55
| test.rs:1:1:7:1 | main | semmle.order | 4 |
66
| test.rs:1:18:7:1 | BlockExpr | semmle.order | 5 |
77
| test.rs:2:5:6:5 | IfExpr | semmle.order | 6 |
8-
| test.rs:2:8:2:12 | Literal | semmle.order | 7 |
9-
| test.rs:2:8:2:21 | BinExpr | semmle.order | 8 |
10-
| test.rs:2:17:2:21 | Literal | semmle.order | 9 |
8+
| test.rs:2:8:2:12 | LiteralExpr | semmle.order | 7 |
9+
| test.rs:2:8:2:21 | BinaryExpr | semmle.order | 8 |
10+
| test.rs:2:17:2:21 | LiteralExpr | semmle.order | 9 |
1111
| test.rs:2:23:4:5 | BlockExpr | semmle.order | 10 |
1212
| test.rs:3:9:3:20 | CallExpr | semmle.order | 11 |
13-
| test.rs:3:19:3:19 | Literal | semmle.order | 12 |
13+
| test.rs:3:19:3:19 | LiteralExpr | semmle.order | 12 |
1414
| test.rs:4:12:6:5 | BlockExpr | semmle.order | 13 |
1515
| test.rs:5:9:5:20 | CallExpr | semmle.order | 14 |
16-
| test.rs:5:19:5:19 | Literal | semmle.order | 15 |
16+
| test.rs:5:19:5:19 | LiteralExpr | semmle.order | 15 |
1717
| test.rs:9:1:16:1 | decrement | semmle.order | 16 |
1818
| test.rs:9:1:16:1 | enter decrement | semmle.order | 17 |
1919
| test.rs:9:1:16:1 | exit decrement | semmle.order | 18 |
2020
| test.rs:9:1:16:1 | exit decrement (normal) | semmle.order | 19 |
2121
| test.rs:9:29:16:1 | BlockExpr | semmle.order | 20 |
2222
| test.rs:11:5:15:5 | IfExpr | semmle.order | 21 |
2323
| test.rs:11:8:11:8 | PathExpr | semmle.order | 22 |
24-
| test.rs:11:8:11:13 | BinExpr | semmle.order | 23 |
25-
| test.rs:11:13:11:13 | Literal | semmle.order | 24 |
24+
| test.rs:11:8:11:13 | BinaryExpr | semmle.order | 23 |
25+
| test.rs:11:13:11:13 | LiteralExpr | semmle.order | 24 |
2626
| test.rs:11:15:13:5 | BlockExpr | semmle.order | 25 |
27-
| test.rs:12:9:12:9 | Literal | semmle.order | 26 |
27+
| test.rs:12:9:12:9 | LiteralExpr | semmle.order | 26 |
2828
| test.rs:13:12:15:5 | BlockExpr | semmle.order | 27 |
2929
| test.rs:14:9:14:9 | PathExpr | semmle.order | 28 |
30-
| test.rs:14:9:14:13 | BinExpr | semmle.order | 29 |
31-
| test.rs:14:13:14:13 | Literal | semmle.order | 30 |
30+
| test.rs:14:9:14:13 | BinaryExpr | semmle.order | 29 |
31+
| test.rs:14:13:14:13 | LiteralExpr | semmle.order | 30 |
3232
edges
33-
| test.rs:1:1:7:1 | enter main | test.rs:2:8:2:12 | Literal | semmle.label | |
34-
| test.rs:1:1:7:1 | enter main | test.rs:2:8:2:12 | Literal | semmle.order | 1 |
33+
| test.rs:1:1:7:1 | enter main | test.rs:2:8:2:12 | LiteralExpr | semmle.label | |
34+
| test.rs:1:1:7:1 | enter main | test.rs:2:8:2:12 | LiteralExpr | semmle.order | 1 |
3535
| test.rs:1:1:7:1 | exit main (normal) | test.rs:1:1:7:1 | exit main | semmle.label | |
3636
| test.rs:1:1:7:1 | exit main (normal) | test.rs:1:1:7:1 | exit main | semmle.order | 1 |
3737
| test.rs:1:1:7:1 | main | test.rs:1:1:7:1 | exit main (normal) | semmle.label | |
@@ -40,26 +40,26 @@ edges
4040
| test.rs:1:18:7:1 | BlockExpr | test.rs:1:1:7:1 | main | semmle.order | 1 |
4141
| test.rs:2:5:6:5 | IfExpr | test.rs:1:18:7:1 | BlockExpr | semmle.label | |
4242
| test.rs:2:5:6:5 | IfExpr | test.rs:1:18:7:1 | BlockExpr | semmle.order | 1 |
43-
| test.rs:2:8:2:12 | Literal | test.rs:2:17:2:21 | Literal | semmle.label | |
44-
| test.rs:2:8:2:12 | Literal | test.rs:2:17:2:21 | Literal | semmle.order | 1 |
45-
| test.rs:2:8:2:21 | BinExpr | test.rs:3:19:3:19 | Literal | semmle.label | true |
46-
| test.rs:2:8:2:21 | BinExpr | test.rs:3:19:3:19 | Literal | semmle.order | 1 |
47-
| test.rs:2:8:2:21 | BinExpr | test.rs:5:19:5:19 | Literal | semmle.label | false |
48-
| test.rs:2:8:2:21 | BinExpr | test.rs:5:19:5:19 | Literal | semmle.order | 2 |
49-
| test.rs:2:17:2:21 | Literal | test.rs:2:8:2:21 | BinExpr | semmle.label | |
50-
| test.rs:2:17:2:21 | Literal | test.rs:2:8:2:21 | BinExpr | semmle.order | 1 |
43+
| test.rs:2:8:2:12 | LiteralExpr | test.rs:2:17:2:21 | LiteralExpr | semmle.label | |
44+
| test.rs:2:8:2:12 | LiteralExpr | test.rs:2:17:2:21 | LiteralExpr | semmle.order | 1 |
45+
| test.rs:2:8:2:21 | BinaryExpr | test.rs:3:19:3:19 | LiteralExpr | semmle.label | true |
46+
| test.rs:2:8:2:21 | BinaryExpr | test.rs:3:19:3:19 | LiteralExpr | semmle.order | 1 |
47+
| test.rs:2:8:2:21 | BinaryExpr | test.rs:5:19:5:19 | LiteralExpr | semmle.label | false |
48+
| test.rs:2:8:2:21 | BinaryExpr | test.rs:5:19:5:19 | LiteralExpr | semmle.order | 2 |
49+
| test.rs:2:17:2:21 | LiteralExpr | test.rs:2:8:2:21 | BinaryExpr | semmle.label | |
50+
| test.rs:2:17:2:21 | LiteralExpr | test.rs:2:8:2:21 | BinaryExpr | semmle.order | 1 |
5151
| test.rs:2:23:4:5 | BlockExpr | test.rs:2:5:6:5 | IfExpr | semmle.label | |
5252
| test.rs:2:23:4:5 | BlockExpr | test.rs:2:5:6:5 | IfExpr | semmle.order | 1 |
5353
| test.rs:3:9:3:20 | CallExpr | test.rs:2:23:4:5 | BlockExpr | semmle.label | |
5454
| test.rs:3:9:3:20 | CallExpr | test.rs:2:23:4:5 | BlockExpr | semmle.order | 1 |
55-
| test.rs:3:19:3:19 | Literal | test.rs:3:9:3:20 | CallExpr | semmle.label | |
56-
| test.rs:3:19:3:19 | Literal | test.rs:3:9:3:20 | CallExpr | semmle.order | 1 |
55+
| test.rs:3:19:3:19 | LiteralExpr | test.rs:3:9:3:20 | CallExpr | semmle.label | |
56+
| test.rs:3:19:3:19 | LiteralExpr | test.rs:3:9:3:20 | CallExpr | semmle.order | 1 |
5757
| test.rs:4:12:6:5 | BlockExpr | test.rs:2:5:6:5 | IfExpr | semmle.label | |
5858
| test.rs:4:12:6:5 | BlockExpr | test.rs:2:5:6:5 | IfExpr | semmle.order | 1 |
5959
| test.rs:5:9:5:20 | CallExpr | test.rs:4:12:6:5 | BlockExpr | semmle.label | |
6060
| test.rs:5:9:5:20 | CallExpr | test.rs:4:12:6:5 | BlockExpr | semmle.order | 1 |
61-
| test.rs:5:19:5:19 | Literal | test.rs:5:9:5:20 | CallExpr | semmle.label | |
62-
| test.rs:5:19:5:19 | Literal | test.rs:5:9:5:20 | CallExpr | semmle.order | 1 |
61+
| test.rs:5:19:5:19 | LiteralExpr | test.rs:5:9:5:20 | CallExpr | semmle.label | |
62+
| test.rs:5:19:5:19 | LiteralExpr | test.rs:5:9:5:20 | CallExpr | semmle.order | 1 |
6363
| test.rs:9:1:16:1 | decrement | test.rs:9:1:16:1 | exit decrement (normal) | semmle.label | |
6464
| test.rs:9:1:16:1 | decrement | test.rs:9:1:16:1 | exit decrement (normal) | semmle.order | 1 |
6565
| test.rs:9:1:16:1 | enter decrement | test.rs:11:8:11:8 | PathExpr | semmle.label | |
@@ -70,23 +70,23 @@ edges
7070
| test.rs:9:29:16:1 | BlockExpr | test.rs:9:1:16:1 | decrement | semmle.order | 1 |
7171
| test.rs:11:5:15:5 | IfExpr | test.rs:9:29:16:1 | BlockExpr | semmle.label | |
7272
| test.rs:11:5:15:5 | IfExpr | test.rs:9:29:16:1 | BlockExpr | semmle.order | 1 |
73-
| test.rs:11:8:11:8 | PathExpr | test.rs:11:13:11:13 | Literal | semmle.label | |
74-
| test.rs:11:8:11:8 | PathExpr | test.rs:11:13:11:13 | Literal | semmle.order | 1 |
75-
| test.rs:11:8:11:13 | BinExpr | test.rs:12:9:12:9 | Literal | semmle.label | true |
76-
| test.rs:11:8:11:13 | BinExpr | test.rs:12:9:12:9 | Literal | semmle.order | 1 |
77-
| test.rs:11:8:11:13 | BinExpr | test.rs:14:9:14:9 | PathExpr | semmle.label | false |
78-
| test.rs:11:8:11:13 | BinExpr | test.rs:14:9:14:9 | PathExpr | semmle.order | 2 |
79-
| test.rs:11:13:11:13 | Literal | test.rs:11:8:11:13 | BinExpr | semmle.label | |
80-
| test.rs:11:13:11:13 | Literal | test.rs:11:8:11:13 | BinExpr | semmle.order | 1 |
73+
| test.rs:11:8:11:8 | PathExpr | test.rs:11:13:11:13 | LiteralExpr | semmle.label | |
74+
| test.rs:11:8:11:8 | PathExpr | test.rs:11:13:11:13 | LiteralExpr | semmle.order | 1 |
75+
| test.rs:11:8:11:13 | BinaryExpr | test.rs:12:9:12:9 | LiteralExpr | semmle.label | true |
76+
| test.rs:11:8:11:13 | BinaryExpr | test.rs:12:9:12:9 | LiteralExpr | semmle.order | 1 |
77+
| test.rs:11:8:11:13 | BinaryExpr | test.rs:14:9:14:9 | PathExpr | semmle.label | false |
78+
| test.rs:11:8:11:13 | BinaryExpr | test.rs:14:9:14:9 | PathExpr | semmle.order | 2 |
79+
| test.rs:11:13:11:13 | LiteralExpr | test.rs:11:8:11:13 | BinaryExpr | semmle.label | |
80+
| test.rs:11:13:11:13 | LiteralExpr | test.rs:11:8:11:13 | BinaryExpr | semmle.order | 1 |
8181
| test.rs:11:15:13:5 | BlockExpr | test.rs:11:5:15:5 | IfExpr | semmle.label | |
8282
| test.rs:11:15:13:5 | BlockExpr | test.rs:11:5:15:5 | IfExpr | semmle.order | 1 |
83-
| test.rs:12:9:12:9 | Literal | test.rs:11:15:13:5 | BlockExpr | semmle.label | |
84-
| test.rs:12:9:12:9 | Literal | test.rs:11:15:13:5 | BlockExpr | semmle.order | 1 |
83+
| test.rs:12:9:12:9 | LiteralExpr | test.rs:11:15:13:5 | BlockExpr | semmle.label | |
84+
| test.rs:12:9:12:9 | LiteralExpr | test.rs:11:15:13:5 | BlockExpr | semmle.order | 1 |
8585
| test.rs:13:12:15:5 | BlockExpr | test.rs:11:5:15:5 | IfExpr | semmle.label | |
8686
| test.rs:13:12:15:5 | BlockExpr | test.rs:11:5:15:5 | IfExpr | semmle.order | 1 |
87-
| test.rs:14:9:14:9 | PathExpr | test.rs:14:13:14:13 | Literal | semmle.label | |
88-
| test.rs:14:9:14:9 | PathExpr | test.rs:14:13:14:13 | Literal | semmle.order | 1 |
89-
| test.rs:14:9:14:13 | BinExpr | test.rs:13:12:15:5 | BlockExpr | semmle.label | |
90-
| test.rs:14:9:14:13 | BinExpr | test.rs:13:12:15:5 | BlockExpr | semmle.order | 1 |
91-
| test.rs:14:13:14:13 | Literal | test.rs:14:9:14:13 | BinExpr | semmle.label | |
92-
| test.rs:14:13:14:13 | Literal | test.rs:14:9:14:13 | BinExpr | semmle.order | 1 |
87+
| test.rs:14:9:14:9 | PathExpr | test.rs:14:13:14:13 | LiteralExpr | semmle.label | |
88+
| test.rs:14:9:14:9 | PathExpr | test.rs:14:13:14:13 | LiteralExpr | semmle.order | 1 |
89+
| test.rs:14:9:14:13 | BinaryExpr | test.rs:13:12:15:5 | BlockExpr | semmle.label | |
90+
| test.rs:14:9:14:13 | BinaryExpr | test.rs:13:12:15:5 | BlockExpr | semmle.order | 1 |
91+
| test.rs:14:13:14:13 | LiteralExpr | test.rs:14:9:14:13 | BinaryExpr | semmle.label | |
92+
| test.rs:14:13:14:13 | LiteralExpr | test.rs:14:9:14:13 | BinaryExpr | semmle.order | 1 |

0 commit comments

Comments
 (0)