Skip to content

Commit 4b16067

Browse files
committed
C++: Fix testcases after merge from master
1 parent 2cf9bce commit 4b16067

File tree

2 files changed

+54
-22
lines changed

2 files changed

+54
-22
lines changed

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

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
edges
22
| A.cpp:98:12:98:18 | new | A.cpp:100:5:100:13 | Store |
3-
| A.cpp:100:5:100:13 | Chi [a] | A.cpp:101:8:101:9 | Argument 0 indirection [a] |
4-
| A.cpp:100:5:100:13 | Store | A.cpp:100:5:100:13 | Chi [a] |
3+
| A.cpp:100:5:100:13 | Store | A.cpp:100:5:100:13 | a [a] |
4+
| A.cpp:100:5:100:13 | a [a] | A.cpp:101:8:101:9 | Argument 0 indirection [a] |
55
| A.cpp:101:8:101:9 | Argument 0 indirection [a] | A.cpp:103:14:103:14 | *c [a] |
66
| A.cpp:103:14:103:14 | *c [a] | A.cpp:107:16:107:16 | a |
7-
| A.cpp:103:14:103:14 | *c [a] | A.cpp:107:16:107:16 | a |
87
| A.cpp:107:16:107:16 | a | A.cpp:107:12:107:16 | (void *)... |
8+
| A.cpp:107:16:107:16 | a | A.cpp:107:16:107:16 | a |
99
| A.cpp:142:7:142:20 | Chi [c] | A.cpp:151:18:151:18 | D output argument [c] |
1010
| A.cpp:142:7:142:20 | Store | A.cpp:142:7:142:20 | c [c] |
1111
| A.cpp:142:7:142:20 | c [c] | A.cpp:142:7:142:20 | Chi [c] |
@@ -75,9 +75,17 @@ edges
7575
| simple.cpp:65:11:65:20 | call to user_input | simple.cpp:65:5:65:22 | i [i] |
7676
| simple.cpp:66:12:66:12 | Store [i] | simple.cpp:67:13:67:13 | i |
7777
| simple.cpp:67:13:67:13 | i | simple.cpp:67:13:67:13 | i |
78+
| simple.cpp:83:9:83:28 | Store | simple.cpp:83:9:83:28 | f1 [f1] |
79+
| simple.cpp:83:9:83:28 | f1 [f1] | simple.cpp:83:9:83:28 | f2.f1 [f2, f1] |
80+
| simple.cpp:83:9:83:28 | f2.f1 [f2, f1] | simple.cpp:84:14:84:20 | Argument -1 indirection [f2, f1] |
81+
| simple.cpp:83:17:83:26 | call to user_input | simple.cpp:83:9:83:28 | Store |
82+
| simple.cpp:84:14:84:20 | Argument -1 indirection [f2, f1] | simple.cpp:84:14:84:20 | call to getf2f1 |
7883
| simple.cpp:108:30:108:31 | d2 [d1_2, y] | simple.cpp:111:18:111:18 | d1_2.y [y] |
7984
| simple.cpp:111:18:111:18 | d1_2.y [y] | simple.cpp:111:18:111:18 | y |
8085
| simple.cpp:111:18:111:18 | y | simple.cpp:111:18:111:18 | y |
86+
| simple.cpp:114:37:114:38 | *d2 [d1_2, y] | simple.cpp:117:19:117:19 | d1_2.y [y] |
87+
| simple.cpp:117:19:117:19 | d1_2.y [y] | simple.cpp:117:19:117:19 | y |
88+
| simple.cpp:117:19:117:19 | y | simple.cpp:117:19:117:19 | y |
8189
| simple.cpp:122:5:122:33 | Chi [d2_1, d1_1, ... (3)] | simple.cpp:123:27:123:30 | d2_1 [d1_1, x] |
8290
| simple.cpp:122:5:122:33 | Store | simple.cpp:122:5:122:33 | x [x] |
8391
| simple.cpp:122:5:122:33 | d1_1.x [d1_1, x] | simple.cpp:122:5:122:33 | d2_1.d1_1.x [d2_1, d1_1, ... (3)] |
@@ -93,25 +101,41 @@ edges
93101
| simple.cpp:130:15:130:15 | x | simple.cpp:130:15:130:15 | x |
94102
| simple.cpp:136:21:136:28 | Chi [d2_1, d1_2, ... (3)] | simple.cpp:139:23:139:23 | d2_1.d1_2.y [d1_2, y] |
95103
| simple.cpp:136:21:136:28 | Chi [d2_1, d1_2, ... (3)] | simple.cpp:141:20:141:23 | d2_1 [d1_2, y] |
104+
| simple.cpp:136:21:136:28 | Chi [d2_1, d1_2, ... (3)] | simple.cpp:143:23:143:30 | d2_1 [d1_2, y] |
96105
| simple.cpp:136:21:136:28 | d2_1 [d2_1, d1_2, ... (3)] | simple.cpp:136:21:136:28 | Chi [d2_1, d1_2, ... (3)] |
97106
| simple.cpp:136:21:136:28 | write_to_d1_2_y output argument [d1_2, y] | simple.cpp:136:21:136:28 | d2_1 [d2_1, d1_2, ... (3)] |
107+
| simple.cpp:136:21:136:28 | write_to_d1_2_y output argument [d1_2, y] | simple.cpp:143:23:143:30 | Argument 0 indirection [d1_2, y] |
108+
| simple.cpp:136:21:136:28 | write_to_d1_2_y output argument [d1_2, y] | simple.cpp:144:23:144:30 | Argument 0 indirection [d1_2, y] |
98109
| simple.cpp:136:31:136:40 | call to user_input | simple.cpp:136:21:136:28 | write_to_d1_2_y output argument [d1_2, y] |
99110
| simple.cpp:139:23:139:23 | d1_2.y [y] | simple.cpp:139:23:139:23 | y |
100111
| simple.cpp:139:23:139:23 | d2_1.d1_2.y [d1_2, y] | simple.cpp:139:23:139:23 | d1_2.y [y] |
101112
| simple.cpp:139:23:139:23 | y | simple.cpp:139:23:139:23 | y |
102113
| simple.cpp:141:20:141:23 | d2_1 [d1_2, y] | simple.cpp:108:30:108:31 | d2 [d1_2, y] |
103114
| simple.cpp:141:20:141:23 | d2_1 [d1_2, y] | simple.cpp:141:20:141:23 | d2_1 [d1_2, y] |
115+
| simple.cpp:143:23:143:30 | Argument 0 indirection [d1_2, y] | simple.cpp:114:37:114:38 | *d2 [d1_2, y] |
116+
| simple.cpp:143:23:143:30 | Argument 0 indirection [d1_2, y] | simple.cpp:143:23:143:30 | read_from_y_deref output argument [d1_2, y] |
117+
| simple.cpp:143:23:143:30 | d2_1 [d1_2, y] | simple.cpp:144:23:144:30 | Argument 0 indirection [d1_2, y] |
118+
| simple.cpp:143:23:143:30 | read_from_y_deref output argument [d1_2, y] | simple.cpp:144:23:144:30 | Argument 0 indirection [d1_2, y] |
119+
| simple.cpp:144:23:144:30 | Argument 0 indirection [d1_2, y] | simple.cpp:114:37:114:38 | *d2 [d1_2, y] |
120+
| struct_init.c:14:24:14:25 | *ab [a] | struct_init.c:15:12:15:12 | a |
121+
| struct_init.c:15:12:15:12 | a | struct_init.c:15:12:15:12 | a |
122+
| struct_init.c:20:20:20:29 | Store | struct_init.c:20:20:20:29 | a [a] |
123+
| struct_init.c:20:20:20:29 | a [a] | struct_init.c:24:10:24:12 | Argument 0 indirection [a] |
124+
| struct_init.c:20:20:20:29 | call to user_input | struct_init.c:20:20:20:29 | Store |
104125
| struct_init.c:20:20:20:29 | call to user_input | struct_init.c:22:11:22:11 | a |
105126
| struct_init.c:24:10:24:12 | Argument 0 indirection [a] | struct_init.c:14:24:14:25 | *ab [a] |
106-
| struct_init.c:27:7:27:16 | Chi [a] | struct_init.c:36:10:36:24 | Argument 0 indirection [a] |
107-
| struct_init.c:27:7:27:16 | Store | struct_init.c:27:7:27:16 | Chi [a] |
127+
| struct_init.c:27:7:27:16 | Chi [nestedAB, a] | struct_init.c:27:21:27:21 | nestedAB.b [a] |
128+
| struct_init.c:27:7:27:16 | Store | struct_init.c:27:7:27:16 | a [a] |
129+
| struct_init.c:27:7:27:16 | a [a] | struct_init.c:27:7:27:16 | nestedAB.a [nestedAB, a] |
108130
| struct_init.c:27:7:27:16 | call to user_input | struct_init.c:27:7:27:16 | Store |
109131
| struct_init.c:27:7:27:16 | call to user_input | struct_init.c:31:23:31:23 | a |
132+
| struct_init.c:27:7:27:16 | nestedAB.a [nestedAB, a] | struct_init.c:27:7:27:16 | Chi [nestedAB, a] |
133+
| struct_init.c:27:21:27:21 | nestedAB.b [a] | struct_init.c:36:10:36:24 | Argument 0 indirection [a] |
110134
| struct_init.c:36:10:36:24 | Argument 0 indirection [a] | struct_init.c:14:24:14:25 | *ab [a] |
111135
nodes
112136
| A.cpp:98:12:98:18 | new | semmle.label | new |
113-
| A.cpp:100:5:100:13 | Chi [a] | semmle.label | Chi [a] |
114137
| A.cpp:100:5:100:13 | Store | semmle.label | Store |
138+
| A.cpp:100:5:100:13 | a [a] | semmle.label | a [a] |
115139
| A.cpp:101:8:101:9 | Argument 0 indirection [a] | semmle.label | Argument 0 indirection [a] |
116140
| A.cpp:103:14:103:14 | *c [a] | semmle.label | *c [a] |
117141
| A.cpp:107:12:107:16 | (void *)... | semmle.label | (void *)... |
@@ -198,12 +222,21 @@ nodes
198222
| simple.cpp:65:11:65:20 | call to user_input | semmle.label | call to user_input |
199223
| simple.cpp:66:12:66:12 | Store [i] | semmle.label | Store [i] |
200224
| simple.cpp:67:13:67:13 | i | semmle.label | i |
201-
<<<<<<< HEAD
202225
| simple.cpp:67:13:67:13 | i | semmle.label | i |
226+
| simple.cpp:83:9:83:28 | Store | semmle.label | Store |
227+
| simple.cpp:83:9:83:28 | f1 [f1] | semmle.label | f1 [f1] |
228+
| simple.cpp:83:9:83:28 | f2.f1 [f2, f1] | semmle.label | f2.f1 [f2, f1] |
229+
| simple.cpp:83:17:83:26 | call to user_input | semmle.label | call to user_input |
230+
| simple.cpp:84:14:84:20 | Argument -1 indirection [f2, f1] | semmle.label | Argument -1 indirection [f2, f1] |
231+
| simple.cpp:84:14:84:20 | call to getf2f1 | semmle.label | call to getf2f1 |
203232
| simple.cpp:108:30:108:31 | d2 [d1_2, y] | semmle.label | d2 [d1_2, y] |
204233
| simple.cpp:111:18:111:18 | d1_2.y [y] | semmle.label | d1_2.y [y] |
205234
| simple.cpp:111:18:111:18 | y | semmle.label | y |
206235
| simple.cpp:111:18:111:18 | y | semmle.label | y |
236+
| simple.cpp:114:37:114:38 | *d2 [d1_2, y] | semmle.label | *d2 [d1_2, y] |
237+
| simple.cpp:117:19:117:19 | d1_2.y [y] | semmle.label | d1_2.y [y] |
238+
| simple.cpp:117:19:117:19 | y | semmle.label | y |
239+
| simple.cpp:117:19:117:19 | y | semmle.label | y |
207240
| simple.cpp:122:5:122:33 | Chi [d2_1, d1_1, ... (3)] | semmle.label | Chi [d2_1, d1_1, ... (3)] |
208241
| simple.cpp:122:5:122:33 | Store | semmle.label | Store |
209242
| simple.cpp:122:5:122:33 | d1_1.x [d1_1, x] | semmle.label | d1_1.x [d1_1, x] |
@@ -228,23 +261,24 @@ nodes
228261
| simple.cpp:139:23:139:23 | y | semmle.label | y |
229262
| simple.cpp:141:20:141:23 | d2_1 [d1_2, y] | semmle.label | d2_1 [d1_2, y] |
230263
| simple.cpp:141:20:141:23 | d2_1 [d1_2, y] | semmle.label | d2_1 [d1_2, y] |
231-
=======
232-
| simple.cpp:83:9:83:28 | Chi [f1] | semmle.label | Chi [f1] |
233-
| simple.cpp:83:9:83:28 | Store | semmle.label | Store |
234-
| simple.cpp:83:17:83:26 | call to user_input | semmle.label | call to user_input |
235-
| simple.cpp:84:14:84:20 | Argument -1 indirection [f1] | semmle.label | Argument -1 indirection [f1] |
236-
| simple.cpp:84:14:84:20 | call to getf2f1 | semmle.label | call to getf2f1 |
264+
| simple.cpp:143:23:143:30 | Argument 0 indirection [d1_2, y] | semmle.label | Argument 0 indirection [d1_2, y] |
265+
| simple.cpp:143:23:143:30 | d2_1 [d1_2, y] | semmle.label | d2_1 [d1_2, y] |
266+
| simple.cpp:143:23:143:30 | read_from_y_deref output argument [d1_2, y] | semmle.label | read_from_y_deref output argument [d1_2, y] |
267+
| simple.cpp:144:23:144:30 | Argument 0 indirection [d1_2, y] | semmle.label | Argument 0 indirection [d1_2, y] |
237268
| struct_init.c:14:24:14:25 | *ab [a] | semmle.label | *ab [a] |
238269
| struct_init.c:15:12:15:12 | a | semmle.label | a |
239-
| struct_init.c:20:20:20:29 | Chi [a] | semmle.label | Chi [a] |
270+
| struct_init.c:15:12:15:12 | a | semmle.label | a |
240271
| struct_init.c:20:20:20:29 | Store | semmle.label | Store |
241-
>>>>>>> master
272+
| struct_init.c:20:20:20:29 | a [a] | semmle.label | a [a] |
242273
| struct_init.c:20:20:20:29 | call to user_input | semmle.label | call to user_input |
243274
| struct_init.c:22:11:22:11 | a | semmle.label | a |
244275
| struct_init.c:24:10:24:12 | Argument 0 indirection [a] | semmle.label | Argument 0 indirection [a] |
245-
| struct_init.c:27:7:27:16 | Chi [a] | semmle.label | Chi [a] |
276+
| struct_init.c:27:7:27:16 | Chi [nestedAB, a] | semmle.label | Chi [nestedAB, a] |
246277
| struct_init.c:27:7:27:16 | Store | semmle.label | Store |
278+
| struct_init.c:27:7:27:16 | a [a] | semmle.label | a [a] |
247279
| struct_init.c:27:7:27:16 | call to user_input | semmle.label | call to user_input |
280+
| struct_init.c:27:7:27:16 | nestedAB.a [nestedAB, a] | semmle.label | nestedAB.a [nestedAB, a] |
281+
| struct_init.c:27:21:27:21 | nestedAB.b [a] | semmle.label | nestedAB.b [a] |
248282
| struct_init.c:31:23:31:23 | a | semmle.label | a |
249283
| struct_init.c:36:10:36:24 | Argument 0 indirection [a] | semmle.label | Argument 0 indirection [a] |
250284
#select
@@ -266,15 +300,13 @@ nodes
266300
| by_reference.cpp:130:27:130:27 | a | by_reference.cpp:88:13:88:22 | call to user_input | by_reference.cpp:130:27:130:27 | a | a flows from $@ | by_reference.cpp:88:13:88:22 | call to user_input | call to user_input |
267301
| by_reference.cpp:134:29:134:29 | a | by_reference.cpp:88:13:88:22 | call to user_input | by_reference.cpp:134:29:134:29 | a | a flows from $@ | by_reference.cpp:88:13:88:22 | call to user_input | call to user_input |
268302
| simple.cpp:67:13:67:13 | i | simple.cpp:65:11:65:20 | call to user_input | simple.cpp:67:13:67:13 | i | i flows from $@ | simple.cpp:65:11:65:20 | call to user_input | call to user_input |
269-
<<<<<<< HEAD
303+
| simple.cpp:84:14:84:20 | call to getf2f1 | simple.cpp:83:17:83:26 | call to user_input | simple.cpp:84:14:84:20 | call to getf2f1 | call to getf2f1 flows from $@ | simple.cpp:83:17:83:26 | call to user_input | call to user_input |
270304
| simple.cpp:111:18:111:18 | y | simple.cpp:136:31:136:40 | call to user_input | simple.cpp:111:18:111:18 | y | y flows from $@ | simple.cpp:136:31:136:40 | call to user_input | call to user_input |
305+
| simple.cpp:117:19:117:19 | y | simple.cpp:136:31:136:40 | call to user_input | simple.cpp:117:19:117:19 | y | y flows from $@ | simple.cpp:136:31:136:40 | call to user_input | call to user_input |
271306
| simple.cpp:124:20:124:20 | x | simple.cpp:122:22:122:31 | call to user_input | simple.cpp:124:20:124:20 | x | x flows from $@ | simple.cpp:122:22:122:31 | call to user_input | call to user_input |
272307
| simple.cpp:130:15:130:15 | x | simple.cpp:122:22:122:31 | call to user_input | simple.cpp:130:15:130:15 | x | x flows from $@ | simple.cpp:122:22:122:31 | call to user_input | call to user_input |
273308
| simple.cpp:139:23:139:23 | y | simple.cpp:136:31:136:40 | call to user_input | simple.cpp:139:23:139:23 | y | y flows from $@ | simple.cpp:136:31:136:40 | call to user_input | call to user_input |
274-
=======
275-
| simple.cpp:84:14:84:20 | call to getf2f1 | simple.cpp:83:17:83:26 | call to user_input | simple.cpp:84:14:84:20 | call to getf2f1 | call to getf2f1 flows from $@ | simple.cpp:83:17:83:26 | call to user_input | call to user_input |
276309
| struct_init.c:15:12:15:12 | a | struct_init.c:20:20:20:29 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:20:20:20:29 | call to user_input | call to user_input |
277310
| struct_init.c:15:12:15:12 | a | struct_init.c:27:7:27:16 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:27:7:27:16 | call to user_input | call to user_input |
278-
>>>>>>> master
279311
| struct_init.c:22:11:22:11 | a | struct_init.c:20:20:20:29 | call to user_input | struct_init.c:22:11:22:11 | a | a flows from $@ | struct_init.c:20:20:20:29 | call to user_input | call to user_input |
280312
| struct_init.c:31:23:31:23 | a | struct_init.c:27:7:27:16 | call to user_input | struct_init.c:31:23:31:23 | a | a flows from $@ | struct_init.c:27:7:27:16 | call to user_input | call to user_input |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ void read_from_y(DeepStruct2 d2) {
113113

114114
void read_from_y_deref(DeepStruct2* d2) {
115115
sink(d2->d1_1.y);
116-
// Hopefully we will catch this flow when we merge #3123
117-
sink(d2->d1_2.y); //$ast $f-:ir
116+
117+
sink(d2->d1_2.y); //$ast,ir
118118
}
119119

120120
void test_deep_structs() {

0 commit comments

Comments
 (0)