Skip to content

Commit cce99f9

Browse files
committed
C++: exclude conversions in IR field flow tests
1 parent 53a87fa commit cce99f9

File tree

3 files changed

+1
-44
lines changed

3 files changed

+1
-44
lines changed

cpp/ql/test/library-tests/dataflow/fields/IRConfiguration.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Conf extends Configuration {
1818
override predicate isSink(Node sink) {
1919
exists(Call c |
2020
c.getTarget().hasName("sink") and
21-
c.getAnArgument() = sink.asExpr()
21+
c.getAnArgument() = sink.asConvertedExpr()
2222
)
2323
}
2424

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
| file://:0:0:0:0 | (const void *)... | Unexpected result: ir= |

cpp/ql/test/library-tests/dataflow/fields/ir-path-flow.expected

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,19 @@ edges
33
| A.cpp:55:12:55:19 | (C *)... | A.cpp:55:5:55:5 | set output argument [c] |
44
| A.cpp:55:12:55:19 | new | A.cpp:55:12:55:19 | (C *)... |
55
| A.cpp:56:10:56:10 | Argument -1 indirection [c] | A.cpp:56:13:56:15 | call to get |
6-
| A.cpp:56:10:56:10 | Argument -1 indirection [c] | A.cpp:56:13:56:15 | call to get |
7-
| A.cpp:56:13:56:15 | call to get | A.cpp:56:10:56:17 | (void *)... |
8-
| A.cpp:57:10:57:25 | Argument -1 indirection [c] | A.cpp:57:28:57:30 | call to get |
96
| A.cpp:57:10:57:25 | Argument -1 indirection [c] | A.cpp:57:28:57:30 | call to get |
107
| A.cpp:57:11:57:24 | B output argument [c] | A.cpp:57:10:57:25 | Argument -1 indirection [c] |
118
| A.cpp:57:17:57:23 | new | A.cpp:57:11:57:24 | B output argument [c] |
12-
| A.cpp:57:28:57:30 | call to get | A.cpp:57:10:57:32 | (void *)... |
139
| A.cpp:98:12:98:18 | new | A.cpp:100:5:100:13 | Store |
1410
| A.cpp:100:5:100:13 | Chi [a] | A.cpp:101:8:101:9 | Argument 0 indirection [a] |
1511
| A.cpp:100:5:100:13 | Store | A.cpp:100:5:100:13 | Chi [a] |
1612
| A.cpp:101:8:101:9 | Argument 0 indirection [a] | A.cpp:103:14:103:14 | *c [a] |
1713
| A.cpp:103:14:103:14 | *c [a] | A.cpp:107:16:107:16 | a |
18-
| A.cpp:103:14:103:14 | *c [a] | A.cpp:107:16:107:16 | a |
19-
| A.cpp:107:16:107:16 | a | A.cpp:107:12:107:16 | (void *)... |
2014
| A.cpp:126:5:126:5 | Chi [c] | A.cpp:131:8:131:8 | f7 output argument [c] |
2115
| A.cpp:126:5:126:5 | set output argument [c] | A.cpp:126:5:126:5 | Chi [c] |
2216
| A.cpp:126:12:126:18 | new | A.cpp:126:5:126:5 | set output argument [c] |
2317
| A.cpp:131:8:131:8 | Chi [c] | A.cpp:132:13:132:13 | c |
24-
| A.cpp:131:8:131:8 | Chi [c] | A.cpp:132:13:132:13 | c |
2518
| A.cpp:131:8:131:8 | f7 output argument [c] | A.cpp:131:8:131:8 | Chi [c] |
26-
| A.cpp:132:13:132:13 | c | A.cpp:132:10:132:13 | (void *)... |
2719
| A.cpp:142:7:142:20 | Chi [c] | A.cpp:151:18:151:18 | D output argument [c] |
2820
| A.cpp:142:7:142:20 | Store | A.cpp:142:7:142:20 | Chi [c] |
2921
| A.cpp:142:14:142:20 | new | A.cpp:142:7:142:20 | Store |
@@ -32,14 +24,10 @@ edges
3224
| A.cpp:143:25:143:31 | new | A.cpp:143:7:143:31 | Store |
3325
| A.cpp:150:12:150:18 | new | A.cpp:151:18:151:18 | b |
3426
| A.cpp:151:12:151:24 | Chi [b] | A.cpp:152:13:152:13 | b |
35-
| A.cpp:151:12:151:24 | Chi [b] | A.cpp:152:13:152:13 | b |
3627
| A.cpp:151:12:151:24 | D output argument [b] | A.cpp:151:12:151:24 | Chi [b] |
3728
| A.cpp:151:18:151:18 | Chi [c] | A.cpp:154:13:154:13 | c |
38-
| A.cpp:151:18:151:18 | Chi [c] | A.cpp:154:13:154:13 | c |
3929
| A.cpp:151:18:151:18 | D output argument [c] | A.cpp:151:18:151:18 | Chi [c] |
4030
| A.cpp:151:18:151:18 | b | A.cpp:151:12:151:24 | D output argument [b] |
41-
| A.cpp:152:13:152:13 | b | A.cpp:152:10:152:13 | (void *)... |
42-
| A.cpp:154:13:154:13 | c | A.cpp:154:10:154:13 | (void *)... |
4331
| C.cpp:18:12:18:18 | C output argument [s1] | C.cpp:19:5:19:5 | Argument -1 indirection [s1] |
4432
| C.cpp:18:12:18:18 | C output argument [s3] | C.cpp:19:5:19:5 | Argument -1 indirection [s3] |
4533
| C.cpp:19:5:19:5 | Argument -1 indirection [s1] | C.cpp:27:8:27:11 | *#this [s1] |
@@ -52,11 +40,7 @@ edges
5240
| C.cpp:24:5:24:25 | Store | C.cpp:24:5:24:25 | Chi [s3] |
5341
| C.cpp:24:16:24:25 | new | C.cpp:24:5:24:25 | Store |
5442
| C.cpp:27:8:27:11 | *#this [s1] | C.cpp:29:10:29:11 | s1 |
55-
| C.cpp:27:8:27:11 | *#this [s1] | C.cpp:29:10:29:11 | s1 |
56-
| C.cpp:27:8:27:11 | *#this [s3] | C.cpp:31:10:31:11 | s3 |
5743
| C.cpp:27:8:27:11 | *#this [s3] | C.cpp:31:10:31:11 | s3 |
58-
| C.cpp:29:10:29:11 | s1 | file://:0:0:0:0 | (const void *)... |
59-
| C.cpp:31:10:31:11 | s3 | file://:0:0:0:0 | (const void *)... |
6044
| aliasing.cpp:9:3:9:22 | Chi [m1] | aliasing.cpp:25:17:25:19 | pointerSetter output argument [m1] |
6145
| aliasing.cpp:9:3:9:22 | Store | aliasing.cpp:9:3:9:22 | Chi [m1] |
6246
| aliasing.cpp:9:11:9:20 | call to user_input | aliasing.cpp:9:3:9:22 | Store |
@@ -190,30 +174,22 @@ nodes
190174
| A.cpp:55:12:55:19 | (C *)... | semmle.label | (C *)... |
191175
| A.cpp:55:12:55:19 | new | semmle.label | new |
192176
| A.cpp:56:10:56:10 | Argument -1 indirection [c] | semmle.label | Argument -1 indirection [c] |
193-
| A.cpp:56:10:56:17 | (void *)... | semmle.label | (void *)... |
194-
| A.cpp:56:13:56:15 | call to get | semmle.label | call to get |
195177
| A.cpp:56:13:56:15 | call to get | semmle.label | call to get |
196178
| A.cpp:57:10:57:25 | Argument -1 indirection [c] | semmle.label | Argument -1 indirection [c] |
197-
| A.cpp:57:10:57:32 | (void *)... | semmle.label | (void *)... |
198179
| A.cpp:57:11:57:24 | B output argument [c] | semmle.label | B output argument [c] |
199180
| A.cpp:57:17:57:23 | new | semmle.label | new |
200181
| A.cpp:57:28:57:30 | call to get | semmle.label | call to get |
201-
| A.cpp:57:28:57:30 | call to get | semmle.label | call to get |
202182
| A.cpp:98:12:98:18 | new | semmle.label | new |
203183
| A.cpp:100:5:100:13 | Chi [a] | semmle.label | Chi [a] |
204184
| A.cpp:100:5:100:13 | Store | semmle.label | Store |
205185
| A.cpp:101:8:101:9 | Argument 0 indirection [a] | semmle.label | Argument 0 indirection [a] |
206186
| A.cpp:103:14:103:14 | *c [a] | semmle.label | *c [a] |
207-
| A.cpp:107:12:107:16 | (void *)... | semmle.label | (void *)... |
208-
| A.cpp:107:16:107:16 | a | semmle.label | a |
209187
| A.cpp:107:16:107:16 | a | semmle.label | a |
210188
| A.cpp:126:5:126:5 | Chi [c] | semmle.label | Chi [c] |
211189
| A.cpp:126:5:126:5 | set output argument [c] | semmle.label | set output argument [c] |
212190
| A.cpp:126:12:126:18 | new | semmle.label | new |
213191
| A.cpp:131:8:131:8 | Chi [c] | semmle.label | Chi [c] |
214192
| A.cpp:131:8:131:8 | f7 output argument [c] | semmle.label | f7 output argument [c] |
215-
| A.cpp:132:10:132:13 | (void *)... | semmle.label | (void *)... |
216-
| A.cpp:132:13:132:13 | c | semmle.label | c |
217193
| A.cpp:132:13:132:13 | c | semmle.label | c |
218194
| A.cpp:142:7:142:20 | Chi [c] | semmle.label | Chi [c] |
219195
| A.cpp:142:7:142:20 | Store | semmle.label | Store |
@@ -227,11 +203,7 @@ nodes
227203
| A.cpp:151:18:151:18 | Chi [c] | semmle.label | Chi [c] |
228204
| A.cpp:151:18:151:18 | D output argument [c] | semmle.label | D output argument [c] |
229205
| A.cpp:151:18:151:18 | b | semmle.label | b |
230-
| A.cpp:152:10:152:13 | (void *)... | semmle.label | (void *)... |
231206
| A.cpp:152:13:152:13 | b | semmle.label | b |
232-
| A.cpp:152:13:152:13 | b | semmle.label | b |
233-
| A.cpp:154:10:154:13 | (void *)... | semmle.label | (void *)... |
234-
| A.cpp:154:13:154:13 | c | semmle.label | c |
235207
| A.cpp:154:13:154:13 | c | semmle.label | c |
236208
| C.cpp:18:12:18:18 | C output argument [s1] | semmle.label | C output argument [s1] |
237209
| C.cpp:18:12:18:18 | C output argument [s3] | semmle.label | C output argument [s3] |
@@ -247,8 +219,6 @@ nodes
247219
| C.cpp:27:8:27:11 | *#this [s1] | semmle.label | *#this [s1] |
248220
| C.cpp:27:8:27:11 | *#this [s3] | semmle.label | *#this [s3] |
249221
| C.cpp:29:10:29:11 | s1 | semmle.label | s1 |
250-
| C.cpp:29:10:29:11 | s1 | semmle.label | s1 |
251-
| C.cpp:31:10:31:11 | s3 | semmle.label | s3 |
252222
| C.cpp:31:10:31:11 | s3 | semmle.label | s3 |
253223
| aliasing.cpp:9:3:9:22 | Chi [m1] | semmle.label | Chi [m1] |
254224
| aliasing.cpp:9:3:9:22 | Store | semmle.label | Store |
@@ -353,8 +323,6 @@ nodes
353323
| constructors.cpp:43:9:43:9 | Argument 0 indirection [b_] | semmle.label | Argument 0 indirection [b_] |
354324
| constructors.cpp:46:9:46:9 | Argument 0 indirection [a_] | semmle.label | Argument 0 indirection [a_] |
355325
| constructors.cpp:46:9:46:9 | Argument 0 indirection [b_] | semmle.label | Argument 0 indirection [b_] |
356-
| file://:0:0:0:0 | (const void *)... | semmle.label | (const void *)... |
357-
| file://:0:0:0:0 | (const void *)... | semmle.label | (const void *)... |
358326
| simple.cpp:26:15:26:15 | *f [a_] | semmle.label | *f [a_] |
359327
| simple.cpp:26:15:26:15 | *f [b_] | semmle.label | *f [b_] |
360328
| simple.cpp:28:10:28:10 | Argument -1 indirection [a_] | semmle.label | Argument -1 indirection [a_] |
@@ -399,21 +367,13 @@ nodes
399367
| struct_init.c:31:23:31:23 | a | semmle.label | a |
400368
| struct_init.c:36:10:36:24 | Argument 0 indirection [a] | semmle.label | Argument 0 indirection [a] |
401369
#select
402-
| A.cpp:56:10:56:17 | (void *)... | A.cpp:55:12:55:19 | (C *)... | A.cpp:56:10:56:17 | (void *)... | (void *)... flows from $@ | A.cpp:55:12:55:19 | (C *)... | (C *)... |
403-
| A.cpp:56:10:56:17 | (void *)... | A.cpp:55:12:55:19 | new | A.cpp:56:10:56:17 | (void *)... | (void *)... flows from $@ | A.cpp:55:12:55:19 | new | new |
404370
| A.cpp:56:13:56:15 | call to get | A.cpp:55:12:55:19 | (C *)... | A.cpp:56:13:56:15 | call to get | call to get flows from $@ | A.cpp:55:12:55:19 | (C *)... | (C *)... |
405371
| A.cpp:56:13:56:15 | call to get | A.cpp:55:12:55:19 | new | A.cpp:56:13:56:15 | call to get | call to get flows from $@ | A.cpp:55:12:55:19 | new | new |
406-
| A.cpp:57:10:57:32 | (void *)... | A.cpp:57:17:57:23 | new | A.cpp:57:10:57:32 | (void *)... | (void *)... flows from $@ | A.cpp:57:17:57:23 | new | new |
407372
| A.cpp:57:28:57:30 | call to get | A.cpp:57:17:57:23 | new | A.cpp:57:28:57:30 | call to get | call to get flows from $@ | A.cpp:57:17:57:23 | new | new |
408-
| A.cpp:107:12:107:16 | (void *)... | A.cpp:98:12:98:18 | new | A.cpp:107:12:107:16 | (void *)... | (void *)... flows from $@ | A.cpp:98:12:98:18 | new | new |
409373
| A.cpp:107:16:107:16 | a | A.cpp:98:12:98:18 | new | A.cpp:107:16:107:16 | a | a flows from $@ | A.cpp:98:12:98:18 | new | new |
410-
| A.cpp:132:10:132:13 | (void *)... | A.cpp:126:12:126:18 | new | A.cpp:132:10:132:13 | (void *)... | (void *)... flows from $@ | A.cpp:126:12:126:18 | new | new |
411374
| A.cpp:132:13:132:13 | c | A.cpp:126:12:126:18 | new | A.cpp:132:13:132:13 | c | c flows from $@ | A.cpp:126:12:126:18 | new | new |
412-
| A.cpp:152:10:152:13 | (void *)... | A.cpp:143:25:143:31 | new | A.cpp:152:10:152:13 | (void *)... | (void *)... flows from $@ | A.cpp:143:25:143:31 | new | new |
413-
| A.cpp:152:10:152:13 | (void *)... | A.cpp:150:12:150:18 | new | A.cpp:152:10:152:13 | (void *)... | (void *)... flows from $@ | A.cpp:150:12:150:18 | new | new |
414375
| A.cpp:152:13:152:13 | b | A.cpp:143:25:143:31 | new | A.cpp:152:13:152:13 | b | b flows from $@ | A.cpp:143:25:143:31 | new | new |
415376
| A.cpp:152:13:152:13 | b | A.cpp:150:12:150:18 | new | A.cpp:152:13:152:13 | b | b flows from $@ | A.cpp:150:12:150:18 | new | new |
416-
| A.cpp:154:10:154:13 | (void *)... | A.cpp:142:14:142:20 | new | A.cpp:154:10:154:13 | (void *)... | (void *)... flows from $@ | A.cpp:142:14:142:20 | new | new |
417377
| A.cpp:154:13:154:13 | c | A.cpp:142:14:142:20 | new | A.cpp:154:13:154:13 | c | c flows from $@ | A.cpp:142:14:142:20 | new | new |
418378
| C.cpp:29:10:29:11 | s1 | C.cpp:22:12:22:21 | new | C.cpp:29:10:29:11 | s1 | s1 flows from $@ | C.cpp:22:12:22:21 | new | new |
419379
| C.cpp:31:10:31:11 | s3 | C.cpp:24:16:24:25 | new | C.cpp:31:10:31:11 | s3 | s3 flows from $@ | C.cpp:24:16:24:25 | new | new |
@@ -441,8 +401,6 @@ nodes
441401
| constructors.cpp:28:12:28:12 | call to a | constructors.cpp:36:11:36:20 | call to user_input | constructors.cpp:28:12:28:12 | call to a | call to a flows from $@ | constructors.cpp:36:11:36:20 | call to user_input | call to user_input |
442402
| constructors.cpp:29:12:29:12 | call to b | constructors.cpp:35:14:35:23 | call to user_input | constructors.cpp:29:12:29:12 | call to b | call to b flows from $@ | constructors.cpp:35:14:35:23 | call to user_input | call to user_input |
443403
| constructors.cpp:29:12:29:12 | call to b | constructors.cpp:36:25:36:34 | call to user_input | constructors.cpp:29:12:29:12 | call to b | call to b flows from $@ | constructors.cpp:36:25:36:34 | call to user_input | call to user_input |
444-
| file://:0:0:0:0 | (const void *)... | C.cpp:22:12:22:21 | new | file://:0:0:0:0 | (const void *)... | (const void *)... flows from $@ | C.cpp:22:12:22:21 | new | new |
445-
| file://:0:0:0:0 | (const void *)... | C.cpp:24:16:24:25 | new | file://:0:0:0:0 | (const void *)... | (const void *)... flows from $@ | C.cpp:24:16:24:25 | new | new |
446404
| simple.cpp:28:12:28:12 | call to a | simple.cpp:39:12:39:21 | call to user_input | simple.cpp:28:12:28:12 | call to a | call to a flows from $@ | simple.cpp:39:12:39:21 | call to user_input | call to user_input |
447405
| simple.cpp:28:12:28:12 | call to a | simple.cpp:41:12:41:21 | call to user_input | simple.cpp:28:12:28:12 | call to a | call to a flows from $@ | simple.cpp:41:12:41:21 | call to user_input | call to user_input |
448406
| simple.cpp:29:12:29:12 | call to b | simple.cpp:40:12:40:21 | call to user_input | simple.cpp:29:12:29:12 | call to b | call to b flows from $@ | simple.cpp:40:12:40:21 | call to user_input | call to user_input |

0 commit comments

Comments
 (0)