Skip to content

Commit f3213ae

Browse files
committed
C++: Accept test changes.
1 parent f665295 commit f3213ae

File tree

4 files changed

+106
-13
lines changed

4 files changed

+106
-13
lines changed

cpp/ql/test/library-tests/dataflow/dataflow-tests/test-source-sink.expected

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,18 @@ irFlow
307307
| test.cpp:915:57:915:76 | *indirect_source(1) | test.cpp:921:19:921:50 | *global_pointer_static_indirect_1 |
308308
| test.cpp:931:10:931:15 | call to source | test.cpp:936:19:936:32 | *global_int_ptr |
309309
| test.cpp:931:10:931:15 | call to source | test.cpp:941:10:941:24 | * ... |
310+
| test.cpp:931:10:931:15 | call to source | test.cpp:950:19:950:32 | *global_int_ptr |
311+
| test.cpp:931:10:931:15 | call to source | test.cpp:955:10:955:24 | * ... |
310312
| test.cpp:931:10:931:15 | call to source | test.cpp:1000:19:1000:34 | *global_int_array |
311313
| test.cpp:931:10:931:15 | call to source | test.cpp:1005:10:1005:26 | * ... |
314+
| test.cpp:931:10:931:15 | call to source | test.cpp:1014:19:1014:34 | *global_int_array |
315+
| test.cpp:931:10:931:15 | call to source | test.cpp:1019:10:1019:26 | * ... |
312316
| test.cpp:961:10:961:24 | *call to indirect_source | test.cpp:966:19:966:36 | **global_int_ptr_ptr |
313317
| test.cpp:961:10:961:24 | *call to indirect_source | test.cpp:972:19:972:37 | ** ... |
314318
| test.cpp:961:10:961:24 | *call to indirect_source | test.cpp:975:10:975:29 | * ... |
319+
| test.cpp:961:10:961:24 | *call to indirect_source | test.cpp:984:19:984:36 | **global_int_ptr_ptr |
320+
| test.cpp:961:10:961:24 | *call to indirect_source | test.cpp:990:19:990:37 | ** ... |
321+
| test.cpp:961:10:961:24 | *call to indirect_source | test.cpp:993:10:993:29 | * ... |
315322
| true_upon_entry.cpp:9:11:9:16 | call to source | true_upon_entry.cpp:13:8:13:8 | x |
316323
| true_upon_entry.cpp:17:11:17:16 | call to source | true_upon_entry.cpp:21:8:21:8 | x |
317324
| true_upon_entry.cpp:27:9:27:14 | call to source | true_upon_entry.cpp:29:8:29:8 | x |

cpp/ql/test/library-tests/dataflow/dataflow-tests/test.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -947,12 +947,12 @@ namespace globals_without_explicit_def {
947947

948948
void test3() {
949949
calls_set();
950-
indirect_sink(global_int_ptr); // $ MISSING: ast,ir
950+
indirect_sink(global_int_ptr); // $ ir MISSING: ast
951951
}
952952

953953
void test4() {
954954
calls_set();
955-
sink(*global_int_ptr); // $ MISSING: ast,ir
955+
sink(*global_int_ptr); // $ ir MISSING: ast
956956
}
957957

958958
int** global_int_ptr_ptr;
@@ -981,16 +981,16 @@ namespace globals_without_explicit_def {
981981

982982
void test7() {
983983
calls_set_indirect();
984-
indirect_sink(global_int_ptr_ptr); // $ MISSING: ast,ir
984+
indirect_sink(global_int_ptr_ptr); // $ ir MISSING: ast
985985
sink(global_int_ptr_ptr); // $ MISSING: ast
986986
}
987987

988988
void test8() {
989989
calls_set_indirect();
990-
indirect_sink(*global_int_ptr_ptr); // $ MISSING: ast,ir
990+
indirect_sink(*global_int_ptr_ptr); // $ ir MISSING: ast
991991
sink(*global_int_ptr_ptr);
992992
indirect_sink(**global_int_ptr_ptr);
993-
sink(**global_int_ptr_ptr); // $ MISSING: ast,ir
993+
sink(**global_int_ptr_ptr); // $ ir MISSING: ast
994994
}
995995

996996
int global_int_array[10];
@@ -1011,11 +1011,11 @@ namespace globals_without_explicit_def {
10111011

10121012
void test11() {
10131013
calls_set_array();
1014-
indirect_sink(global_int_array); // $ MISSING: ast,ir
1014+
indirect_sink(global_int_array); // $ ir MISSING: ast
10151015
}
10161016

10171017
void test12() {
10181018
calls_set_array();
1019-
sink(*global_int_array); // $ MISSING: ast,ir
1019+
sink(*global_int_array); // $ ir MISSING: ast
10201020
}
10211021
}

cpp/ql/test/library-tests/dataflow/fields/aliasing.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ namespace GlobalFieldFlow {
215215
}
216216

217217
void read_field() {
218-
sink(global_s.m1); // $ MISSING: ast,ir
218+
sink(global_s.m1); // $ ir MISSING: ast
219219
}
220220

221221
void set_nested_field() {
222222
global_s2.s.m1 = user_input();
223223
}
224224

225225
void read_nested_field() {
226-
sink(global_s2.s.m1); // $ MISSING: ast,ir
226+
sink(global_s2.s.m1); // $ ir MISSING: ast
227227
}
228228

229229
S* global_s_ptr;
@@ -234,15 +234,15 @@ namespace GlobalFieldFlow {
234234
}
235235

236236
void read_field_ptr() {
237-
sink(global_s_ptr->m1); // $ MISSING: ast,ir
237+
sink(global_s_ptr->m1); // $ ir MISSING: ast
238238
}
239239

240240
void set_nested_field_ptr() {
241241
global_s2_ptr->s.m1 = user_input();
242242
}
243243

244244
void read_nested_field_ptr() {
245-
sink(global_s2_ptr->s.m1); // $ MISSING: ast,ir
245+
sink(global_s2_ptr->s.m1); // $ ir MISSING: ast
246246
}
247247

248248
S_with_pointer global_s_with_pointer;
@@ -252,7 +252,7 @@ namespace GlobalFieldFlow {
252252
}
253253

254254
void read_field_indirect() {
255-
sink(*global_s_with_pointer.data); // $ MISSING: ast,ir
255+
sink(*global_s_with_pointer.data); // $ ir MISSING: ast
256256
}
257257

258258
S_with_array global_s_with_array;
@@ -262,6 +262,6 @@ namespace GlobalFieldFlow {
262262
}
263263

264264
void read_field_array() {
265-
sink(*global_s_with_array.data); // $ MISSING: ast,ir
265+
sink(*global_s_with_array.data); // $ ir MISSING: ast
266266
}
267267
}

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

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,46 @@ edges
271271
| aliasing.cpp:200:21:200:21 | *s [post update] [m1] | aliasing.cpp:200:16:200:18 | *ps2 [post update] [s, m1] |
272272
| aliasing.cpp:201:8:201:10 | *ps2 [s, m1] | aliasing.cpp:201:13:201:13 | *s [m1] |
273273
| aliasing.cpp:201:13:201:13 | *s [m1] | aliasing.cpp:201:15:201:16 | m1 |
274+
| aliasing.cpp:210:5:210:12 | *global_s [m1] | aliasing.cpp:210:5:210:12 | *global_s [m1] |
275+
| aliasing.cpp:210:5:210:12 | *global_s [m1] | aliasing.cpp:218:10:218:17 | *global_s [m1] |
276+
| aliasing.cpp:211:6:211:14 | *global_s2 [s, m1] | aliasing.cpp:211:6:211:14 | *global_s2 [s, m1] |
277+
| aliasing.cpp:211:6:211:14 | *global_s2 [s, m1] | aliasing.cpp:226:10:226:18 | *global_s2 [s, m1] |
278+
| aliasing.cpp:214:5:214:12 | *global_s [post update] [m1] | aliasing.cpp:210:5:210:12 | *global_s [m1] |
279+
| aliasing.cpp:214:5:214:30 | ... = ... | aliasing.cpp:214:5:214:12 | *global_s [post update] [m1] |
280+
| aliasing.cpp:214:19:214:28 | call to user_input | aliasing.cpp:214:5:214:30 | ... = ... |
281+
| aliasing.cpp:218:10:218:17 | *global_s [m1] | aliasing.cpp:218:19:218:20 | m1 |
282+
| aliasing.cpp:222:5:222:13 | *global_s2 [post update] [s, m1] | aliasing.cpp:211:6:211:14 | *global_s2 [s, m1] |
283+
| aliasing.cpp:222:5:222:33 | ... = ... | aliasing.cpp:222:15:222:15 | *s [post update] [m1] |
284+
| aliasing.cpp:222:15:222:15 | *s [post update] [m1] | aliasing.cpp:222:5:222:13 | *global_s2 [post update] [s, m1] |
285+
| aliasing.cpp:222:22:222:31 | call to user_input | aliasing.cpp:222:5:222:33 | ... = ... |
286+
| aliasing.cpp:226:10:226:18 | *global_s2 [s, m1] | aliasing.cpp:226:20:226:20 | *s [m1] |
287+
| aliasing.cpp:226:20:226:20 | *s [m1] | aliasing.cpp:226:22:226:23 | m1 |
288+
| aliasing.cpp:229:6:229:17 | **global_s_ptr [m1] | aliasing.cpp:229:6:229:17 | **global_s_ptr [m1] |
289+
| aliasing.cpp:229:6:229:17 | **global_s_ptr [m1] | aliasing.cpp:237:10:237:21 | *global_s_ptr [m1] |
290+
| aliasing.cpp:230:7:230:19 | **global_s2_ptr [s, m1] | aliasing.cpp:230:7:230:19 | **global_s2_ptr [s, m1] |
291+
| aliasing.cpp:230:7:230:19 | **global_s2_ptr [s, m1] | aliasing.cpp:245:10:245:22 | *global_s2_ptr [s, m1] |
292+
| aliasing.cpp:233:5:233:16 | *global_s_ptr [post update] [m1] | aliasing.cpp:229:6:229:17 | **global_s_ptr [m1] |
293+
| aliasing.cpp:233:5:233:35 | ... = ... | aliasing.cpp:233:5:233:16 | *global_s_ptr [post update] [m1] |
294+
| aliasing.cpp:233:24:233:33 | call to user_input | aliasing.cpp:233:5:233:35 | ... = ... |
295+
| aliasing.cpp:237:10:237:21 | *global_s_ptr [m1] | aliasing.cpp:237:24:237:25 | m1 |
296+
| aliasing.cpp:241:5:241:17 | *global_s2_ptr [post update] [s, m1] | aliasing.cpp:230:7:230:19 | **global_s2_ptr [s, m1] |
297+
| aliasing.cpp:241:5:241:38 | ... = ... | aliasing.cpp:241:20:241:20 | *s [post update] [m1] |
298+
| aliasing.cpp:241:20:241:20 | *s [post update] [m1] | aliasing.cpp:241:5:241:17 | *global_s2_ptr [post update] [s, m1] |
299+
| aliasing.cpp:241:27:241:36 | call to user_input | aliasing.cpp:241:5:241:38 | ... = ... |
300+
| aliasing.cpp:245:10:245:22 | *global_s2_ptr [s, m1] | aliasing.cpp:245:25:245:25 | *s [m1] |
301+
| aliasing.cpp:245:25:245:25 | *s [m1] | aliasing.cpp:245:27:245:28 | m1 |
302+
| aliasing.cpp:248:18:248:38 | *global_s_with_pointer [*data] | aliasing.cpp:248:18:248:38 | *global_s_with_pointer [*data] |
303+
| aliasing.cpp:248:18:248:38 | *global_s_with_pointer [*data] | aliasing.cpp:255:11:255:31 | *global_s_with_pointer [*data] |
304+
| aliasing.cpp:251:5:251:46 | ... = ... | aliasing.cpp:251:6:251:26 | *global_s_with_pointer [post update] [*data] |
305+
| aliasing.cpp:251:6:251:26 | *global_s_with_pointer [post update] [*data] | aliasing.cpp:248:18:248:38 | *global_s_with_pointer [*data] |
306+
| aliasing.cpp:251:35:251:44 | call to user_input | aliasing.cpp:251:5:251:46 | ... = ... |
307+
| aliasing.cpp:255:11:255:31 | *global_s_with_pointer [*data] | aliasing.cpp:255:10:255:36 | * ... |
308+
| aliasing.cpp:258:16:258:34 | *global_s_with_array [data] | aliasing.cpp:258:16:258:34 | *global_s_with_array [data] |
309+
| aliasing.cpp:258:16:258:34 | *global_s_with_array [data] | aliasing.cpp:265:11:265:29 | *global_s_with_array [data] |
310+
| aliasing.cpp:261:5:261:44 | ... = ... | aliasing.cpp:261:6:261:24 | *global_s_with_array [post update] [data] |
311+
| aliasing.cpp:261:6:261:24 | *global_s_with_array [post update] [data] | aliasing.cpp:258:16:258:34 | *global_s_with_array [data] |
312+
| aliasing.cpp:261:33:261:42 | call to user_input | aliasing.cpp:261:5:261:44 | ... = ... |
313+
| aliasing.cpp:265:11:265:29 | *global_s_with_array [data] | aliasing.cpp:265:10:265:34 | * ... |
274314
| arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:7:8:7:13 | access to array |
275315
| arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:8:8:8:13 | access to array |
276316
| arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:9:8:9:11 | * ... |
@@ -1044,6 +1084,46 @@ nodes
10441084
| aliasing.cpp:201:8:201:10 | *ps2 [s, m1] | semmle.label | *ps2 [s, m1] |
10451085
| aliasing.cpp:201:13:201:13 | *s [m1] | semmle.label | *s [m1] |
10461086
| aliasing.cpp:201:15:201:16 | m1 | semmle.label | m1 |
1087+
| aliasing.cpp:210:5:210:12 | *global_s [m1] | semmle.label | *global_s [m1] |
1088+
| aliasing.cpp:211:6:211:14 | *global_s2 [s, m1] | semmle.label | *global_s2 [s, m1] |
1089+
| aliasing.cpp:214:5:214:12 | *global_s [post update] [m1] | semmle.label | *global_s [post update] [m1] |
1090+
| aliasing.cpp:214:5:214:30 | ... = ... | semmle.label | ... = ... |
1091+
| aliasing.cpp:214:19:214:28 | call to user_input | semmle.label | call to user_input |
1092+
| aliasing.cpp:218:10:218:17 | *global_s [m1] | semmle.label | *global_s [m1] |
1093+
| aliasing.cpp:218:19:218:20 | m1 | semmle.label | m1 |
1094+
| aliasing.cpp:222:5:222:13 | *global_s2 [post update] [s, m1] | semmle.label | *global_s2 [post update] [s, m1] |
1095+
| aliasing.cpp:222:5:222:33 | ... = ... | semmle.label | ... = ... |
1096+
| aliasing.cpp:222:15:222:15 | *s [post update] [m1] | semmle.label | *s [post update] [m1] |
1097+
| aliasing.cpp:222:22:222:31 | call to user_input | semmle.label | call to user_input |
1098+
| aliasing.cpp:226:10:226:18 | *global_s2 [s, m1] | semmle.label | *global_s2 [s, m1] |
1099+
| aliasing.cpp:226:20:226:20 | *s [m1] | semmle.label | *s [m1] |
1100+
| aliasing.cpp:226:22:226:23 | m1 | semmle.label | m1 |
1101+
| aliasing.cpp:229:6:229:17 | **global_s_ptr [m1] | semmle.label | **global_s_ptr [m1] |
1102+
| aliasing.cpp:230:7:230:19 | **global_s2_ptr [s, m1] | semmle.label | **global_s2_ptr [s, m1] |
1103+
| aliasing.cpp:233:5:233:16 | *global_s_ptr [post update] [m1] | semmle.label | *global_s_ptr [post update] [m1] |
1104+
| aliasing.cpp:233:5:233:35 | ... = ... | semmle.label | ... = ... |
1105+
| aliasing.cpp:233:24:233:33 | call to user_input | semmle.label | call to user_input |
1106+
| aliasing.cpp:237:10:237:21 | *global_s_ptr [m1] | semmle.label | *global_s_ptr [m1] |
1107+
| aliasing.cpp:237:24:237:25 | m1 | semmle.label | m1 |
1108+
| aliasing.cpp:241:5:241:17 | *global_s2_ptr [post update] [s, m1] | semmle.label | *global_s2_ptr [post update] [s, m1] |
1109+
| aliasing.cpp:241:5:241:38 | ... = ... | semmle.label | ... = ... |
1110+
| aliasing.cpp:241:20:241:20 | *s [post update] [m1] | semmle.label | *s [post update] [m1] |
1111+
| aliasing.cpp:241:27:241:36 | call to user_input | semmle.label | call to user_input |
1112+
| aliasing.cpp:245:10:245:22 | *global_s2_ptr [s, m1] | semmle.label | *global_s2_ptr [s, m1] |
1113+
| aliasing.cpp:245:25:245:25 | *s [m1] | semmle.label | *s [m1] |
1114+
| aliasing.cpp:245:27:245:28 | m1 | semmle.label | m1 |
1115+
| aliasing.cpp:248:18:248:38 | *global_s_with_pointer [*data] | semmle.label | *global_s_with_pointer [*data] |
1116+
| aliasing.cpp:251:5:251:46 | ... = ... | semmle.label | ... = ... |
1117+
| aliasing.cpp:251:6:251:26 | *global_s_with_pointer [post update] [*data] | semmle.label | *global_s_with_pointer [post update] [*data] |
1118+
| aliasing.cpp:251:35:251:44 | call to user_input | semmle.label | call to user_input |
1119+
| aliasing.cpp:255:10:255:36 | * ... | semmle.label | * ... |
1120+
| aliasing.cpp:255:11:255:31 | *global_s_with_pointer [*data] | semmle.label | *global_s_with_pointer [*data] |
1121+
| aliasing.cpp:258:16:258:34 | *global_s_with_array [data] | semmle.label | *global_s_with_array [data] |
1122+
| aliasing.cpp:261:5:261:44 | ... = ... | semmle.label | ... = ... |
1123+
| aliasing.cpp:261:6:261:24 | *global_s_with_array [post update] [data] | semmle.label | *global_s_with_array [post update] [data] |
1124+
| aliasing.cpp:261:33:261:42 | call to user_input | semmle.label | call to user_input |
1125+
| aliasing.cpp:265:10:265:34 | * ... | semmle.label | * ... |
1126+
| aliasing.cpp:265:11:265:29 | *global_s_with_array [data] | semmle.label | *global_s_with_array [data] |
10471127
| arrays.cpp:6:12:6:21 | call to user_input | semmle.label | call to user_input |
10481128
| arrays.cpp:7:8:7:13 | access to array | semmle.label | access to array |
10491129
| arrays.cpp:8:8:8:13 | access to array | semmle.label | access to array |
@@ -1653,6 +1733,12 @@ subpaths
16531733
| aliasing.cpp:176:13:176:14 | m1 | aliasing.cpp:106:9:106:18 | call to user_input | aliasing.cpp:176:13:176:14 | m1 | m1 flows from $@ | aliasing.cpp:106:9:106:18 | call to user_input | call to user_input |
16541734
| aliasing.cpp:189:15:189:16 | m1 | aliasing.cpp:106:9:106:18 | call to user_input | aliasing.cpp:189:15:189:16 | m1 | m1 flows from $@ | aliasing.cpp:106:9:106:18 | call to user_input | call to user_input |
16551735
| aliasing.cpp:201:15:201:16 | m1 | aliasing.cpp:106:9:106:18 | call to user_input | aliasing.cpp:201:15:201:16 | m1 | m1 flows from $@ | aliasing.cpp:106:9:106:18 | call to user_input | call to user_input |
1736+
| aliasing.cpp:218:19:218:20 | m1 | aliasing.cpp:214:19:214:28 | call to user_input | aliasing.cpp:218:19:218:20 | m1 | m1 flows from $@ | aliasing.cpp:214:19:214:28 | call to user_input | call to user_input |
1737+
| aliasing.cpp:226:22:226:23 | m1 | aliasing.cpp:222:22:222:31 | call to user_input | aliasing.cpp:226:22:226:23 | m1 | m1 flows from $@ | aliasing.cpp:222:22:222:31 | call to user_input | call to user_input |
1738+
| aliasing.cpp:237:24:237:25 | m1 | aliasing.cpp:233:24:233:33 | call to user_input | aliasing.cpp:237:24:237:25 | m1 | m1 flows from $@ | aliasing.cpp:233:24:233:33 | call to user_input | call to user_input |
1739+
| aliasing.cpp:245:27:245:28 | m1 | aliasing.cpp:241:27:241:36 | call to user_input | aliasing.cpp:245:27:245:28 | m1 | m1 flows from $@ | aliasing.cpp:241:27:241:36 | call to user_input | call to user_input |
1740+
| aliasing.cpp:255:10:255:36 | * ... | aliasing.cpp:251:35:251:44 | call to user_input | aliasing.cpp:255:10:255:36 | * ... | * ... flows from $@ | aliasing.cpp:251:35:251:44 | call to user_input | call to user_input |
1741+
| aliasing.cpp:265:10:265:34 | * ... | aliasing.cpp:261:33:261:42 | call to user_input | aliasing.cpp:265:10:265:34 | * ... | * ... flows from $@ | aliasing.cpp:261:33:261:42 | call to user_input | call to user_input |
16561742
| arrays.cpp:7:8:7:13 | access to array | arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:7:8:7:13 | access to array | access to array flows from $@ | arrays.cpp:6:12:6:21 | call to user_input | call to user_input |
16571743
| arrays.cpp:8:8:8:13 | access to array | arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:8:8:8:13 | access to array | access to array flows from $@ | arrays.cpp:6:12:6:21 | call to user_input | call to user_input |
16581744
| arrays.cpp:9:8:9:11 | * ... | arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:9:8:9:11 | * ... | * ... flows from $@ | arrays.cpp:6:12:6:21 | call to user_input | call to user_input |

0 commit comments

Comments
 (0)