Skip to content

Commit fca49dd

Browse files
committed
C++: Accept test changes.
1 parent 73e4bfd commit fca49dd

File tree

7 files changed

+120
-13
lines changed

7 files changed

+120
-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
@@ -334,11 +334,18 @@ irFlow
334334
| test.cpp:1138:17:1138:22 | call to source | test.cpp:1140:8:1140:18 | * ... |
335335
| test.cpp:1165:10:1165:15 | call to source | test.cpp:1170:19:1170:32 | *global_int_ptr |
336336
| test.cpp:1165:10:1165:15 | call to source | test.cpp:1175:10:1175:24 | * ... |
337+
| test.cpp:1165:10:1165:15 | call to source | test.cpp:1184:19:1184:32 | *global_int_ptr |
338+
| test.cpp:1165:10:1165:15 | call to source | test.cpp:1189:10:1189:24 | * ... |
337339
| test.cpp:1165:10:1165:15 | call to source | test.cpp:1234:19:1234:34 | *global_int_array |
338340
| test.cpp:1165:10:1165:15 | call to source | test.cpp:1239:10:1239:26 | * ... |
341+
| test.cpp:1165:10:1165:15 | call to source | test.cpp:1248:19:1248:34 | *global_int_array |
342+
| test.cpp:1165:10:1165:15 | call to source | test.cpp:1253:10:1253:26 | * ... |
339343
| test.cpp:1195:10:1195:24 | *call to indirect_source | test.cpp:1200:19:1200:36 | **global_int_ptr_ptr |
340344
| test.cpp:1195:10:1195:24 | *call to indirect_source | test.cpp:1206:19:1206:37 | ** ... |
341345
| test.cpp:1195:10:1195:24 | *call to indirect_source | test.cpp:1209:10:1209:29 | * ... |
346+
| test.cpp:1195:10:1195:24 | *call to indirect_source | test.cpp:1218:19:1218:36 | **global_int_ptr_ptr |
347+
| test.cpp:1195:10:1195:24 | *call to indirect_source | test.cpp:1224:19:1224:37 | ** ... |
348+
| test.cpp:1195:10:1195:24 | *call to indirect_source | test.cpp:1227:10:1227:29 | * ... |
342349
| true_upon_entry.cpp:9:11:9:16 | call to source | true_upon_entry.cpp:13:8:13:8 | x |
343350
| true_upon_entry.cpp:17:11:17:16 | call to source | true_upon_entry.cpp:21:8:21:8 | x |
344351
| 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
@@ -1181,12 +1181,12 @@ namespace globals_without_explicit_def {
11811181

11821182
void test3() {
11831183
calls_set();
1184-
indirect_sink(global_int_ptr); // $ MISSING: ast,ir
1184+
indirect_sink(global_int_ptr); // $ ir MISSING: ast
11851185
}
11861186

11871187
void test4() {
11881188
calls_set();
1189-
sink(*global_int_ptr); // $ MISSING: ast,ir
1189+
sink(*global_int_ptr); // $ ir MISSING: ast
11901190
}
11911191

11921192
int** global_int_ptr_ptr;
@@ -1215,16 +1215,16 @@ namespace globals_without_explicit_def {
12151215

12161216
void test7() {
12171217
calls_set_indirect();
1218-
indirect_sink(global_int_ptr_ptr); // $ MISSING: ast,ir
1218+
indirect_sink(global_int_ptr_ptr); // $ ir MISSING: ast
12191219
sink(global_int_ptr_ptr); // $ MISSING: ast
12201220
}
12211221

12221222
void test8() {
12231223
calls_set_indirect();
1224-
indirect_sink(*global_int_ptr_ptr); // $ MISSING: ast,ir
1224+
indirect_sink(*global_int_ptr_ptr); // $ ir MISSING: ast
12251225
sink(*global_int_ptr_ptr);
12261226
indirect_sink(**global_int_ptr_ptr);
1227-
sink(**global_int_ptr_ptr); // $ MISSING: ast,ir
1227+
sink(**global_int_ptr_ptr); // $ ir MISSING: ast
12281228
}
12291229

12301230
int global_int_array[10];
@@ -1245,11 +1245,11 @@ namespace globals_without_explicit_def {
12451245

12461246
void test11() {
12471247
calls_set_array();
1248-
indirect_sink(global_int_array); // $ MISSING: ast,ir
1248+
indirect_sink(global_int_array); // $ ir MISSING: ast
12491249
}
12501250

12511251
void test12() {
12521252
calls_set_array();
1253-
sink(*global_int_array); // $ MISSING: ast,ir
1253+
sink(*global_int_array); // $ ir MISSING: ast
12541254
}
12551255
}

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

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

218218
void read_field() {
219-
sink(global_s.m1); // $ MISSING: ast,ir
219+
sink(global_s.m1); // $ ir MISSING: ast
220220
}
221221

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

226226
void read_nested_field() {
227-
sink(global_s2.s.m1); // $ MISSING: ast,ir
227+
sink(global_s2.s.m1); // $ ir MISSING: ast
228228
}
229229

230230
S* global_s_ptr;
@@ -235,15 +235,15 @@ namespace GlobalFieldFlow {
235235
}
236236

237237
void read_field_ptr() {
238-
sink(global_s_ptr->m1); // $ MISSING: ast,ir
238+
sink(global_s_ptr->m1); // $ ir MISSING: ast
239239
}
240240

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

245245
void read_nested_field_ptr() {
246-
sink(global_s2_ptr->s.m1); // $ MISSING: ast,ir
246+
sink(global_s2_ptr->s.m1); // $ ir MISSING: ast
247247
}
248248

249249
S_with_pointer global_s_with_pointer;
@@ -253,7 +253,7 @@ namespace GlobalFieldFlow {
253253
}
254254

255255
void read_field_indirect() {
256-
sink(*global_s_with_pointer.data); // $ MISSING: ast,ir
256+
sink(*global_s_with_pointer.data); // $ ir MISSING: ast
257257
}
258258

259259
S_with_array global_s_with_array;
@@ -263,6 +263,6 @@ namespace GlobalFieldFlow {
263263
}
264264

265265
void read_field_array() {
266-
sink(*global_s_with_array.data); // $ MISSING: ast,ir
266+
sink(*global_s_with_array.data); // $ ir MISSING: ast
267267
}
268268
}

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
@@ -346,6 +346,46 @@ edges
346346
| aliasing.cpp:200:21:200:21 | *s [post update] [m1] | aliasing.cpp:200:16:200:18 | *ps2 [post update] [s, m1] | provenance | |
347347
| aliasing.cpp:201:8:201:10 | *ps2 [s, m1] | aliasing.cpp:201:13:201:13 | *s [m1] | provenance | |
348348
| aliasing.cpp:201:13:201:13 | *s [m1] | aliasing.cpp:201:15:201:16 | m1 | provenance | |
349+
| aliasing.cpp:211:5:211:12 | *global_s [m1] | aliasing.cpp:211:5:211:12 | *global_s [m1] | provenance | |
350+
| aliasing.cpp:211:5:211:12 | *global_s [m1] | aliasing.cpp:219:10:219:17 | *global_s [m1] | provenance | |
351+
| aliasing.cpp:212:6:212:14 | *global_s2 [s, m1] | aliasing.cpp:212:6:212:14 | *global_s2 [s, m1] | provenance | |
352+
| aliasing.cpp:212:6:212:14 | *global_s2 [s, m1] | aliasing.cpp:227:10:227:18 | *global_s2 [s, m1] | provenance | |
353+
| aliasing.cpp:215:5:215:12 | *global_s [post update] [m1] | aliasing.cpp:211:5:211:12 | *global_s [m1] | provenance | |
354+
| aliasing.cpp:215:5:215:30 | ... = ... | aliasing.cpp:215:5:215:12 | *global_s [post update] [m1] | provenance | |
355+
| aliasing.cpp:215:19:215:28 | call to user_input | aliasing.cpp:215:5:215:30 | ... = ... | provenance | |
356+
| aliasing.cpp:219:10:219:17 | *global_s [m1] | aliasing.cpp:219:19:219:20 | m1 | provenance | |
357+
| aliasing.cpp:223:5:223:13 | *global_s2 [post update] [s, m1] | aliasing.cpp:212:6:212:14 | *global_s2 [s, m1] | provenance | |
358+
| aliasing.cpp:223:5:223:33 | ... = ... | aliasing.cpp:223:15:223:15 | *s [post update] [m1] | provenance | |
359+
| aliasing.cpp:223:15:223:15 | *s [post update] [m1] | aliasing.cpp:223:5:223:13 | *global_s2 [post update] [s, m1] | provenance | |
360+
| aliasing.cpp:223:22:223:31 | call to user_input | aliasing.cpp:223:5:223:33 | ... = ... | provenance | |
361+
| aliasing.cpp:227:10:227:18 | *global_s2 [s, m1] | aliasing.cpp:227:20:227:20 | *s [m1] | provenance | |
362+
| aliasing.cpp:227:20:227:20 | *s [m1] | aliasing.cpp:227:22:227:23 | m1 | provenance | |
363+
| aliasing.cpp:230:6:230:17 | **global_s_ptr [m1] | aliasing.cpp:230:6:230:17 | **global_s_ptr [m1] | provenance | |
364+
| aliasing.cpp:230:6:230:17 | **global_s_ptr [m1] | aliasing.cpp:238:10:238:21 | *global_s_ptr [m1] | provenance | |
365+
| aliasing.cpp:231:7:231:19 | **global_s2_ptr [s, m1] | aliasing.cpp:231:7:231:19 | **global_s2_ptr [s, m1] | provenance | |
366+
| aliasing.cpp:231:7:231:19 | **global_s2_ptr [s, m1] | aliasing.cpp:246:10:246:22 | *global_s2_ptr [s, m1] | provenance | |
367+
| aliasing.cpp:234:5:234:16 | *global_s_ptr [post update] [m1] | aliasing.cpp:230:6:230:17 | **global_s_ptr [m1] | provenance | |
368+
| aliasing.cpp:234:5:234:35 | ... = ... | aliasing.cpp:234:5:234:16 | *global_s_ptr [post update] [m1] | provenance | |
369+
| aliasing.cpp:234:24:234:33 | call to user_input | aliasing.cpp:234:5:234:35 | ... = ... | provenance | |
370+
| aliasing.cpp:238:10:238:21 | *global_s_ptr [m1] | aliasing.cpp:238:24:238:25 | m1 | provenance | |
371+
| aliasing.cpp:242:5:242:17 | *global_s2_ptr [post update] [s, m1] | aliasing.cpp:231:7:231:19 | **global_s2_ptr [s, m1] | provenance | |
372+
| aliasing.cpp:242:5:242:38 | ... = ... | aliasing.cpp:242:20:242:20 | *s [post update] [m1] | provenance | |
373+
| aliasing.cpp:242:20:242:20 | *s [post update] [m1] | aliasing.cpp:242:5:242:17 | *global_s2_ptr [post update] [s, m1] | provenance | |
374+
| aliasing.cpp:242:27:242:36 | call to user_input | aliasing.cpp:242:5:242:38 | ... = ... | provenance | |
375+
| aliasing.cpp:246:10:246:22 | *global_s2_ptr [s, m1] | aliasing.cpp:246:25:246:25 | *s [m1] | provenance | |
376+
| aliasing.cpp:246:25:246:25 | *s [m1] | aliasing.cpp:246:27:246:28 | m1 | provenance | |
377+
| aliasing.cpp:249:18:249:38 | *global_s_with_pointer [*data] | aliasing.cpp:249:18:249:38 | *global_s_with_pointer [*data] | provenance | |
378+
| aliasing.cpp:249:18:249:38 | *global_s_with_pointer [*data] | aliasing.cpp:256:11:256:31 | *global_s_with_pointer [*data] | provenance | |
379+
| aliasing.cpp:252:5:252:46 | ... = ... | aliasing.cpp:252:6:252:26 | *global_s_with_pointer [post update] [*data] | provenance | |
380+
| aliasing.cpp:252:6:252:26 | *global_s_with_pointer [post update] [*data] | aliasing.cpp:249:18:249:38 | *global_s_with_pointer [*data] | provenance | |
381+
| aliasing.cpp:252:35:252:44 | call to user_input | aliasing.cpp:252:5:252:46 | ... = ... | provenance | |
382+
| aliasing.cpp:256:11:256:31 | *global_s_with_pointer [*data] | aliasing.cpp:256:10:256:36 | * ... | provenance | |
383+
| aliasing.cpp:259:16:259:34 | *global_s_with_array [data] | aliasing.cpp:259:16:259:34 | *global_s_with_array [data] | provenance | |
384+
| aliasing.cpp:259:16:259:34 | *global_s_with_array [data] | aliasing.cpp:266:11:266:29 | *global_s_with_array [data] | provenance | |
385+
| aliasing.cpp:262:5:262:44 | ... = ... | aliasing.cpp:262:6:262:24 | *global_s_with_array [post update] [data] | provenance | |
386+
| aliasing.cpp:262:6:262:24 | *global_s_with_array [post update] [data] | aliasing.cpp:259:16:259:34 | *global_s_with_array [data] | provenance | |
387+
| aliasing.cpp:262:33:262:42 | call to user_input | aliasing.cpp:262:5:262:44 | ... = ... | provenance | |
388+
| aliasing.cpp:266:11:266:29 | *global_s_with_array [data] | aliasing.cpp:266:10:266:34 | * ... | provenance | |
349389
| arrays.cpp:6:3:6:23 | ... = ... | arrays.cpp:7:8:7:13 | access to array | provenance | |
350390
| arrays.cpp:6:3:6:23 | ... = ... | arrays.cpp:8:8:8:13 | access to array | provenance | |
351391
| arrays.cpp:6:3:6:23 | ... = ... | arrays.cpp:9:8:9:11 | * ... | provenance | |
@@ -1244,6 +1284,46 @@ nodes
12441284
| aliasing.cpp:201:8:201:10 | *ps2 [s, m1] | semmle.label | *ps2 [s, m1] |
12451285
| aliasing.cpp:201:13:201:13 | *s [m1] | semmle.label | *s [m1] |
12461286
| aliasing.cpp:201:15:201:16 | m1 | semmle.label | m1 |
1287+
| aliasing.cpp:211:5:211:12 | *global_s [m1] | semmle.label | *global_s [m1] |
1288+
| aliasing.cpp:212:6:212:14 | *global_s2 [s, m1] | semmle.label | *global_s2 [s, m1] |
1289+
| aliasing.cpp:215:5:215:12 | *global_s [post update] [m1] | semmle.label | *global_s [post update] [m1] |
1290+
| aliasing.cpp:215:5:215:30 | ... = ... | semmle.label | ... = ... |
1291+
| aliasing.cpp:215:19:215:28 | call to user_input | semmle.label | call to user_input |
1292+
| aliasing.cpp:219:10:219:17 | *global_s [m1] | semmle.label | *global_s [m1] |
1293+
| aliasing.cpp:219:19:219:20 | m1 | semmle.label | m1 |
1294+
| aliasing.cpp:223:5:223:13 | *global_s2 [post update] [s, m1] | semmle.label | *global_s2 [post update] [s, m1] |
1295+
| aliasing.cpp:223:5:223:33 | ... = ... | semmle.label | ... = ... |
1296+
| aliasing.cpp:223:15:223:15 | *s [post update] [m1] | semmle.label | *s [post update] [m1] |
1297+
| aliasing.cpp:223:22:223:31 | call to user_input | semmle.label | call to user_input |
1298+
| aliasing.cpp:227:10:227:18 | *global_s2 [s, m1] | semmle.label | *global_s2 [s, m1] |
1299+
| aliasing.cpp:227:20:227:20 | *s [m1] | semmle.label | *s [m1] |
1300+
| aliasing.cpp:227:22:227:23 | m1 | semmle.label | m1 |
1301+
| aliasing.cpp:230:6:230:17 | **global_s_ptr [m1] | semmle.label | **global_s_ptr [m1] |
1302+
| aliasing.cpp:231:7:231:19 | **global_s2_ptr [s, m1] | semmle.label | **global_s2_ptr [s, m1] |
1303+
| aliasing.cpp:234:5:234:16 | *global_s_ptr [post update] [m1] | semmle.label | *global_s_ptr [post update] [m1] |
1304+
| aliasing.cpp:234:5:234:35 | ... = ... | semmle.label | ... = ... |
1305+
| aliasing.cpp:234:24:234:33 | call to user_input | semmle.label | call to user_input |
1306+
| aliasing.cpp:238:10:238:21 | *global_s_ptr [m1] | semmle.label | *global_s_ptr [m1] |
1307+
| aliasing.cpp:238:24:238:25 | m1 | semmle.label | m1 |
1308+
| aliasing.cpp:242:5:242:17 | *global_s2_ptr [post update] [s, m1] | semmle.label | *global_s2_ptr [post update] [s, m1] |
1309+
| aliasing.cpp:242:5:242:38 | ... = ... | semmle.label | ... = ... |
1310+
| aliasing.cpp:242:20:242:20 | *s [post update] [m1] | semmle.label | *s [post update] [m1] |
1311+
| aliasing.cpp:242:27:242:36 | call to user_input | semmle.label | call to user_input |
1312+
| aliasing.cpp:246:10:246:22 | *global_s2_ptr [s, m1] | semmle.label | *global_s2_ptr [s, m1] |
1313+
| aliasing.cpp:246:25:246:25 | *s [m1] | semmle.label | *s [m1] |
1314+
| aliasing.cpp:246:27:246:28 | m1 | semmle.label | m1 |
1315+
| aliasing.cpp:249:18:249:38 | *global_s_with_pointer [*data] | semmle.label | *global_s_with_pointer [*data] |
1316+
| aliasing.cpp:252:5:252:46 | ... = ... | semmle.label | ... = ... |
1317+
| aliasing.cpp:252:6:252:26 | *global_s_with_pointer [post update] [*data] | semmle.label | *global_s_with_pointer [post update] [*data] |
1318+
| aliasing.cpp:252:35:252:44 | call to user_input | semmle.label | call to user_input |
1319+
| aliasing.cpp:256:10:256:36 | * ... | semmle.label | * ... |
1320+
| aliasing.cpp:256:11:256:31 | *global_s_with_pointer [*data] | semmle.label | *global_s_with_pointer [*data] |
1321+
| aliasing.cpp:259:16:259:34 | *global_s_with_array [data] | semmle.label | *global_s_with_array [data] |
1322+
| aliasing.cpp:262:5:262:44 | ... = ... | semmle.label | ... = ... |
1323+
| aliasing.cpp:262:6:262:24 | *global_s_with_array [post update] [data] | semmle.label | *global_s_with_array [post update] [data] |
1324+
| aliasing.cpp:262:33:262:42 | call to user_input | semmle.label | call to user_input |
1325+
| aliasing.cpp:266:10:266:34 | * ... | semmle.label | * ... |
1326+
| aliasing.cpp:266:11:266:29 | *global_s_with_array [data] | semmle.label | *global_s_with_array [data] |
12471327
| arrays.cpp:6:3:6:23 | ... = ... | semmle.label | ... = ... |
12481328
| arrays.cpp:6:12:6:21 | call to user_input | semmle.label | call to user_input |
12491329
| arrays.cpp:7:8:7:13 | access to array | semmle.label | access to array |
@@ -1902,6 +1982,12 @@ subpaths
19021982
| 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 |
19031983
| 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 |
19041984
| 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 |
1985+
| aliasing.cpp:219:19:219:20 | m1 | aliasing.cpp:215:19:215:28 | call to user_input | aliasing.cpp:219:19:219:20 | m1 | m1 flows from $@ | aliasing.cpp:215:19:215:28 | call to user_input | call to user_input |
1986+
| aliasing.cpp:227:22:227:23 | m1 | aliasing.cpp:223:22:223:31 | call to user_input | aliasing.cpp:227:22:227:23 | m1 | m1 flows from $@ | aliasing.cpp:223:22:223:31 | call to user_input | call to user_input |
1987+
| aliasing.cpp:238:24:238:25 | m1 | aliasing.cpp:234:24:234:33 | call to user_input | aliasing.cpp:238:24:238:25 | m1 | m1 flows from $@ | aliasing.cpp:234:24:234:33 | call to user_input | call to user_input |
1988+
| aliasing.cpp:246:27:246:28 | m1 | aliasing.cpp:242:27:242:36 | call to user_input | aliasing.cpp:246:27:246:28 | m1 | m1 flows from $@ | aliasing.cpp:242:27:242:36 | call to user_input | call to user_input |
1989+
| aliasing.cpp:256:10:256:36 | * ... | aliasing.cpp:252:35:252:44 | call to user_input | aliasing.cpp:256:10:256:36 | * ... | * ... flows from $@ | aliasing.cpp:252:35:252:44 | call to user_input | call to user_input |
1990+
| aliasing.cpp:266:10:266:34 | * ... | aliasing.cpp:262:33:262:42 | call to user_input | aliasing.cpp:266:10:266:34 | * ... | * ... flows from $@ | aliasing.cpp:262:33:262:42 | call to user_input | call to user_input |
19051991
| 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 |
19061992
| 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 |
19071993
| 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)