Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9828539

Browse files
authored
Merge pull request #11357 from MathiasVP/ignore-more-instructions
C++: Ignore more instructions in dataflow
2 parents 4731f92 + a2ce51f commit 9828539

2 files changed

Lines changed: 3 additions & 129 deletions

File tree

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternalsCommon.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ predicate ignoreInstruction(Instruction instr) {
2828
instr instanceof PhiInstruction or
2929
instr instanceof ReadSideEffectInstruction or
3030
instr instanceof ChiInstruction or
31-
instr instanceof InitializeIndirectionInstruction
31+
instr instanceof InitializeIndirectionInstruction or
32+
instr instanceof AliasedDefinitionInstruction or
33+
instr instanceof InitializeNonLocalInstruction
3234
)
3335
}
3436

cpp/ql/test/library-tests/syntax-zoo/dataflow-ir-consistency.expected

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,11 @@ uniqueEnclosingCallable
99
| misc.c:210:5:210:20 | VariableAddress indirection | Node should have one enclosing callable but has 0. |
1010
uniqueType
1111
uniqueNodeLocation
12-
| aggregateinitializer.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
13-
| aggregateinitializer.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
1412
| allocators.cpp:14:5:14:8 | Address | Node should have one location but has 4. |
15-
| allocators.cpp:14:5:14:8 | AliasedDefinition | Node should have one location but has 4. |
16-
| allocators.cpp:14:5:14:8 | InitializeNonLocal | Node should have one location but has 4. |
1713
| allocators.cpp:14:5:14:8 | Phi | Node should have one location but has 4. |
1814
| allocators.cpp:14:5:14:8 | VariableAddress | Node should have one location but has 4. |
1915
| allocators.cpp:14:5:14:8 | VariableAddress indirection | Node should have one location but has 4. |
2016
| allocators.cpp:14:5:14:8 | VariableAddress indirection | Node should have one location but has 4. |
21-
| array_delete.cpp:5:6:5:6 | AliasedDefinition | Node should have one location but has 14. |
22-
| array_delete.cpp:5:6:5:6 | InitializeNonLocal | Node should have one location but has 14. |
23-
| assignexpr.cpp:6:6:6:6 | AliasedDefinition | Node should have one location but has 14. |
24-
| assignexpr.cpp:6:6:6:6 | InitializeNonLocal | Node should have one location but has 14. |
25-
| break_labels.c:2:5:2:5 | AliasedDefinition | Node should have one location but has 20. |
26-
| break_labels.c:2:5:2:5 | InitializeNonLocal | Node should have one location but has 20. |
2717
| break_labels.c:2:11:2:11 | Address | Node should have one location but has 4. |
2818
| break_labels.c:2:11:2:11 | VariableAddress | Node should have one location but has 4. |
2919
| break_labels.c:2:11:2:11 | VariableAddress indirection | Node should have one location but has 4. |
@@ -32,35 +22,11 @@ uniqueNodeLocation
3222
| break_labels.c:2:11:2:11 | i | Node should have one location but has 4. |
3323
| break_labels.c:2:11:2:11 | x | Node should have one location but has 4. |
3424
| break_labels.c:2:11:2:11 | x | Node should have one location but has 4. |
35-
| conditional_destructors.cpp:29:6:29:7 | AliasedDefinition | Node should have one location but has 2. |
36-
| conditional_destructors.cpp:29:6:29:7 | InitializeNonLocal | Node should have one location but has 2. |
37-
| conditional_destructors.cpp:38:6:38:7 | AliasedDefinition | Node should have one location but has 2. |
38-
| conditional_destructors.cpp:38:6:38:7 | InitializeNonLocal | Node should have one location but has 2. |
3925
| constmemberaccess.cpp:3:7:3:7 | x | Node should have one location but has 2. |
40-
| constmemberaccess.cpp:6:6:6:6 | AliasedDefinition | Node should have one location but has 14. |
41-
| constmemberaccess.cpp:6:6:6:6 | InitializeNonLocal | Node should have one location but has 14. |
4226
| constructorinitializer.cpp:3:9:3:9 | i | Node should have one location but has 2. |
4327
| constructorinitializer.cpp:3:9:3:9 | x | Node should have one location but has 2. |
4428
| constructorinitializer.cpp:3:16:3:16 | j | Node should have one location but has 2. |
4529
| constructorinitializer.cpp:3:16:3:16 | y | Node should have one location but has 2. |
46-
| constructorinitializer.cpp:6:6:6:6 | AliasedDefinition | Node should have one location but has 14. |
47-
| constructorinitializer.cpp:6:6:6:6 | InitializeNonLocal | Node should have one location but has 14. |
48-
| defconstructornewexpr.cpp:3:6:3:6 | AliasedDefinition | Node should have one location but has 14. |
49-
| defconstructornewexpr.cpp:3:6:3:6 | InitializeNonLocal | Node should have one location but has 14. |
50-
| defdestructordeleteexpr.cpp:3:6:3:6 | AliasedDefinition | Node should have one location but has 14. |
51-
| defdestructordeleteexpr.cpp:3:6:3:6 | InitializeNonLocal | Node should have one location but has 14. |
52-
| deleteexpr.cpp:6:6:6:6 | AliasedDefinition | Node should have one location but has 14. |
53-
| deleteexpr.cpp:6:6:6:6 | InitializeNonLocal | Node should have one location but has 14. |
54-
| dostmt.c:8:6:8:18 | AliasedDefinition | Node should have one location but has 4. |
55-
| dostmt.c:8:6:8:18 | InitializeNonLocal | Node should have one location but has 4. |
56-
| dostmt.c:16:6:16:18 | AliasedDefinition | Node should have one location but has 4. |
57-
| dostmt.c:16:6:16:18 | InitializeNonLocal | Node should have one location but has 4. |
58-
| dostmt.c:25:6:25:18 | AliasedDefinition | Node should have one location but has 2. |
59-
| dostmt.c:25:6:25:18 | InitializeNonLocal | Node should have one location but has 2. |
60-
| dostmt.c:32:6:32:11 | AliasedDefinition | Node should have one location but has 4. |
61-
| dostmt.c:32:6:32:11 | InitializeNonLocal | Node should have one location but has 4. |
62-
| duff.c:2:6:2:6 | AliasedDefinition | Node should have one location but has 20. |
63-
| duff.c:2:6:2:6 | InitializeNonLocal | Node should have one location but has 20. |
6430
| duff.c:2:12:2:12 | Address | Node should have one location but has 4. |
6531
| duff.c:2:12:2:12 | VariableAddress | Node should have one location but has 4. |
6632
| duff.c:2:12:2:12 | VariableAddress indirection | Node should have one location but has 4. |
@@ -69,17 +35,7 @@ uniqueNodeLocation
6935
| duff.c:2:12:2:12 | i | Node should have one location but has 4. |
7036
| duff.c:2:12:2:12 | x | Node should have one location but has 4. |
7137
| duff.c:2:12:2:12 | x | Node should have one location but has 4. |
72-
| dummyblock.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
73-
| dummyblock.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
74-
| emptyblock.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
75-
| emptyblock.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
76-
| enum.c:5:5:5:5 | AliasedDefinition | Node should have one location but has 20. |
77-
| enum.c:5:5:5:5 | InitializeNonLocal | Node should have one location but has 20. |
78-
| exprstmt.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
79-
| exprstmt.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
8038
| fieldaccess.cpp:3:7:3:7 | x | Node should have one location but has 2. |
81-
| fieldaccess.cpp:6:6:6:6 | AliasedDefinition | Node should have one location but has 14. |
82-
| fieldaccess.cpp:6:6:6:6 | InitializeNonLocal | Node should have one location but has 14. |
8339
| file://:0:0:0:0 | (unnamed parameter 0) | Node should have one location but has 0. |
8440
| file://:0:0:0:0 | (unnamed parameter 0) | Node should have one location but has 0. |
8541
| file://:0:0:0:0 | (unnamed parameter 0) | Node should have one location but has 0. |
@@ -117,20 +73,6 @@ uniqueNodeLocation
11773
| file://:0:0:0:0 | VariableAddress indirection | Node should have one location but has 0. |
11874
| file://:0:0:0:0 | VariableAddress indirection | Node should have one location but has 0. |
11975
| file://:0:0:0:0 | VariableAddress indirection | Node should have one location but has 0. |
120-
| forstmt.cpp:1:6:1:7 | AliasedDefinition | Node should have one location but has 2. |
121-
| forstmt.cpp:1:6:1:7 | InitializeNonLocal | Node should have one location but has 2. |
122-
| forstmt.cpp:8:6:8:7 | AliasedDefinition | Node should have one location but has 2. |
123-
| forstmt.cpp:8:6:8:7 | InitializeNonLocal | Node should have one location but has 2. |
124-
| ifelsestmt.c:1:6:1:19 | AliasedDefinition | Node should have one location but has 3. |
125-
| ifelsestmt.c:1:6:1:19 | InitializeNonLocal | Node should have one location but has 3. |
126-
| ifelsestmt.c:11:6:11:19 | AliasedDefinition | Node should have one location but has 3. |
127-
| ifelsestmt.c:11:6:11:19 | InitializeNonLocal | Node should have one location but has 3. |
128-
| ifelsestmt.c:19:6:19:18 | AliasedDefinition | Node should have one location but has 4. |
129-
| ifelsestmt.c:19:6:19:18 | InitializeNonLocal | Node should have one location but has 4. |
130-
| ifelsestmt.c:29:6:29:18 | AliasedDefinition | Node should have one location but has 4. |
131-
| ifelsestmt.c:29:6:29:18 | InitializeNonLocal | Node should have one location but has 4. |
132-
| ifelsestmt.c:37:6:37:11 | AliasedDefinition | Node should have one location but has 4. |
133-
| ifelsestmt.c:37:6:37:11 | InitializeNonLocal | Node should have one location but has 4. |
13476
| ifelsestmt.c:37:17:37:17 | Address | Node should have one location but has 2. |
13577
| ifelsestmt.c:37:17:37:17 | VariableAddress | Node should have one location but has 2. |
13678
| ifelsestmt.c:37:17:37:17 | VariableAddress indirection | Node should have one location but has 2. |
@@ -143,16 +85,6 @@ uniqueNodeLocation
14385
| ifelsestmt.c:37:24:37:24 | VariableAddress indirection | Node should have one location but has 2. |
14486
| ifelsestmt.c:37:24:37:24 | y | Node should have one location but has 2. |
14587
| ifelsestmt.c:37:24:37:24 | y | Node should have one location but has 2. |
146-
| ifstmt.c:1:6:1:19 | AliasedDefinition | Node should have one location but has 3. |
147-
| ifstmt.c:1:6:1:19 | InitializeNonLocal | Node should have one location but has 3. |
148-
| ifstmt.c:8:6:8:19 | AliasedDefinition | Node should have one location but has 3. |
149-
| ifstmt.c:8:6:8:19 | InitializeNonLocal | Node should have one location but has 3. |
150-
| ifstmt.c:14:6:14:18 | AliasedDefinition | Node should have one location but has 4. |
151-
| ifstmt.c:14:6:14:18 | InitializeNonLocal | Node should have one location but has 4. |
152-
| ifstmt.c:21:6:21:18 | AliasedDefinition | Node should have one location but has 4. |
153-
| ifstmt.c:21:6:21:18 | InitializeNonLocal | Node should have one location but has 4. |
154-
| ifstmt.c:27:6:27:11 | AliasedDefinition | Node should have one location but has 4. |
155-
| ifstmt.c:27:6:27:11 | InitializeNonLocal | Node should have one location but has 4. |
15688
| ifstmt.c:27:17:27:17 | Address | Node should have one location but has 2. |
15789
| ifstmt.c:27:17:27:17 | VariableAddress | Node should have one location but has 2. |
15890
| ifstmt.c:27:17:27:17 | VariableAddress indirection | Node should have one location but has 2. |
@@ -165,36 +97,18 @@ uniqueNodeLocation
16597
| ifstmt.c:27:24:27:24 | VariableAddress indirection | Node should have one location but has 2. |
16698
| ifstmt.c:27:24:27:24 | y | Node should have one location but has 2. |
16799
| ifstmt.c:27:24:27:24 | y | Node should have one location but has 2. |
168-
| initializer.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
169-
| initializer.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
170-
| landexpr.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
171-
| landexpr.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
172-
| lorexpr.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
173-
| lorexpr.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
174-
| ltrbinopexpr.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
175-
| ltrbinopexpr.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
176-
| membercallexpr.cpp:6:6:6:6 | AliasedDefinition | Node should have one location but has 14. |
177-
| membercallexpr.cpp:6:6:6:6 | InitializeNonLocal | Node should have one location but has 14. |
178100
| membercallexpr_args.cpp:3:6:3:6 | d | Node should have one location but has 2. |
179101
| membercallexpr_args.cpp:4:14:4:14 | x | Node should have one location but has 2. |
180102
| membercallexpr_args.cpp:4:21:4:21 | y | Node should have one location but has 2. |
181-
| membercallexpr_args.cpp:7:6:7:6 | AliasedDefinition | Node should have one location but has 14. |
182-
| membercallexpr_args.cpp:7:6:7:6 | InitializeNonLocal | Node should have one location but has 14. |
183103
| newexpr.cpp:3:9:3:9 | i | Node should have one location but has 2. |
184104
| newexpr.cpp:3:9:3:9 | x | Node should have one location but has 2. |
185105
| newexpr.cpp:3:16:3:16 | j | Node should have one location but has 2. |
186106
| newexpr.cpp:3:16:3:16 | y | Node should have one location but has 2. |
187-
| newexpr.cpp:6:6:6:6 | AliasedDefinition | Node should have one location but has 14. |
188-
| newexpr.cpp:6:6:6:6 | InitializeNonLocal | Node should have one location but has 14. |
189107
| no_dynamic_init.cpp:9:5:9:8 | Address | Node should have one location but has 4. |
190-
| no_dynamic_init.cpp:9:5:9:8 | AliasedDefinition | Node should have one location but has 4. |
191-
| no_dynamic_init.cpp:9:5:9:8 | InitializeNonLocal | Node should have one location but has 4. |
192108
| no_dynamic_init.cpp:9:5:9:8 | Phi | Node should have one location but has 4. |
193109
| no_dynamic_init.cpp:9:5:9:8 | VariableAddress | Node should have one location but has 4. |
194110
| no_dynamic_init.cpp:9:5:9:8 | VariableAddress indirection | Node should have one location but has 4. |
195111
| no_dynamic_init.cpp:9:5:9:8 | VariableAddress indirection | Node should have one location but has 4. |
196-
| nodefaultswitchstmt.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
197-
| nodefaultswitchstmt.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
198112
| nodefaultswitchstmt.c:1:12:1:12 | Address | Node should have one location but has 4. |
199113
| nodefaultswitchstmt.c:1:12:1:12 | VariableAddress | Node should have one location but has 4. |
200114
| nodefaultswitchstmt.c:1:12:1:12 | VariableAddress indirection | Node should have one location but has 4. |
@@ -203,45 +117,19 @@ uniqueNodeLocation
203117
| nodefaultswitchstmt.c:1:12:1:12 | i | Node should have one location but has 4. |
204118
| nodefaultswitchstmt.c:1:12:1:12 | x | Node should have one location but has 4. |
205119
| nodefaultswitchstmt.c:1:12:1:12 | x | Node should have one location but has 4. |
206-
| nonmembercallexpr.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 2. |
207-
| nonmembercallexpr.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 2. |
208-
| nonmembercallexpr.c:3:6:3:6 | AliasedDefinition | Node should have one location but has 20. |
209-
| nonmembercallexpr.c:3:6:3:6 | InitializeNonLocal | Node should have one location but has 20. |
210-
| nonmemberfp2callexpr.c:3:6:3:6 | AliasedDefinition | Node should have one location but has 20. |
211-
| nonmemberfp2callexpr.c:3:6:3:6 | InitializeNonLocal | Node should have one location but has 20. |
212-
| nonmemberfpcallexpr.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
213-
| nonmemberfpcallexpr.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
214120
| parameterinitializer.cpp:18:5:18:8 | Address | Node should have one location but has 4. |
215-
| parameterinitializer.cpp:18:5:18:8 | AliasedDefinition | Node should have one location but has 4. |
216-
| parameterinitializer.cpp:18:5:18:8 | InitializeNonLocal | Node should have one location but has 4. |
217121
| parameterinitializer.cpp:18:5:18:8 | Phi | Node should have one location but has 4. |
218122
| parameterinitializer.cpp:18:5:18:8 | VariableAddress | Node should have one location but has 4. |
219123
| parameterinitializer.cpp:18:5:18:8 | VariableAddress indirection | Node should have one location but has 4. |
220124
| parameterinitializer.cpp:18:5:18:8 | VariableAddress indirection | Node should have one location but has 4. |
221-
| pmcallexpr.cpp:6:6:6:6 | AliasedDefinition | Node should have one location but has 14. |
222-
| pmcallexpr.cpp:6:6:6:6 | InitializeNonLocal | Node should have one location but has 14. |
223-
| questionexpr.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
224-
| questionexpr.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
225-
| revsubscriptexpr.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 2. |
226-
| revsubscriptexpr.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 2. |
227-
| staticmembercallexpr.cpp:6:6:6:6 | AliasedDefinition | Node should have one location but has 14. |
228-
| staticmembercallexpr.cpp:6:6:6:6 | InitializeNonLocal | Node should have one location but has 14. |
229125
| staticmembercallexpr_args.cpp:3:6:3:6 | d | Node should have one location but has 2. |
230126
| staticmembercallexpr_args.cpp:4:21:4:21 | x | Node should have one location but has 2. |
231127
| staticmembercallexpr_args.cpp:4:28:4:28 | y | Node should have one location but has 2. |
232-
| staticmembercallexpr_args.cpp:7:6:7:6 | AliasedDefinition | Node should have one location but has 14. |
233-
| staticmembercallexpr_args.cpp:7:6:7:6 | InitializeNonLocal | Node should have one location but has 14. |
234128
| stream_it.cpp:16:5:16:8 | Address | Node should have one location but has 4. |
235-
| stream_it.cpp:16:5:16:8 | AliasedDefinition | Node should have one location but has 4. |
236-
| stream_it.cpp:16:5:16:8 | InitializeNonLocal | Node should have one location but has 4. |
237129
| stream_it.cpp:16:5:16:8 | Phi | Node should have one location but has 4. |
238130
| stream_it.cpp:16:5:16:8 | VariableAddress | Node should have one location but has 4. |
239131
| stream_it.cpp:16:5:16:8 | VariableAddress indirection | Node should have one location but has 4. |
240132
| stream_it.cpp:16:5:16:8 | VariableAddress indirection | Node should have one location but has 4. |
241-
| subscriptexpr.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
242-
| subscriptexpr.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
243-
| switchstmt.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
244-
| switchstmt.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
245133
| switchstmt.c:1:12:1:12 | Address | Node should have one location but has 4. |
246134
| switchstmt.c:1:12:1:12 | VariableAddress | Node should have one location but has 4. |
247135
| switchstmt.c:1:12:1:12 | VariableAddress indirection | Node should have one location but has 4. |
@@ -250,22 +138,6 @@ uniqueNodeLocation
250138
| switchstmt.c:1:12:1:12 | i | Node should have one location but has 4. |
251139
| switchstmt.c:1:12:1:12 | x | Node should have one location but has 4. |
252140
| switchstmt.c:1:12:1:12 | x | Node should have one location but has 4. |
253-
| tinyforstmt.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
254-
| tinyforstmt.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
255-
| unaryopexpr.c:1:6:1:6 | AliasedDefinition | Node should have one location but has 20. |
256-
| unaryopexpr.c:1:6:1:6 | InitializeNonLocal | Node should have one location but has 20. |
257-
| whilestmt.c:1:6:1:19 | AliasedDefinition | Node should have one location but has 3. |
258-
| whilestmt.c:1:6:1:19 | InitializeNonLocal | Node should have one location but has 3. |
259-
| whilestmt.c:8:6:8:19 | AliasedDefinition | Node should have one location but has 3. |
260-
| whilestmt.c:8:6:8:19 | InitializeNonLocal | Node should have one location but has 3. |
261-
| whilestmt.c:15:6:15:18 | AliasedDefinition | Node should have one location but has 4. |
262-
| whilestmt.c:15:6:15:18 | InitializeNonLocal | Node should have one location but has 4. |
263-
| whilestmt.c:23:6:23:18 | AliasedDefinition | Node should have one location but has 4. |
264-
| whilestmt.c:23:6:23:18 | InitializeNonLocal | Node should have one location but has 4. |
265-
| whilestmt.c:32:6:32:18 | AliasedDefinition | Node should have one location but has 2. |
266-
| whilestmt.c:32:6:32:18 | InitializeNonLocal | Node should have one location but has 2. |
267-
| whilestmt.c:39:6:39:11 | AliasedDefinition | Node should have one location but has 4. |
268-
| whilestmt.c:39:6:39:11 | InitializeNonLocal | Node should have one location but has 4. |
269141
missingLocation
270142
| Nodes without location: 37 |
271143
uniqueNodeToString

0 commit comments

Comments
 (0)