File tree Expand file tree Collapse file tree 5 files changed +9
-10
lines changed
src/semmle/code/cpp/ir/dataflow/internal
test/library-tests/dataflow Expand file tree Collapse file tree 5 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -162,11 +162,7 @@ class ExprNode extends InstructionNode {
162
162
* as `x` in `f(x)` and implicit parameters such as `this` in `x.f()`
163
163
*/
164
164
class ParameterNode extends InstructionNode {
165
- ParameterNode ( ) {
166
- instr instanceof InitializeParameterInstruction
167
- or
168
- instr instanceof InitializeThisInstruction
169
- }
165
+ override InitializeParameterInstruction instr ;
170
166
171
167
/**
172
168
* Holds if this node is the parameter of `c` at the specified (zero-based)
@@ -180,7 +176,9 @@ class ParameterNode extends InstructionNode {
180
176
* flow graph.
181
177
*/
182
178
private class ExplicitParameterNode extends ParameterNode {
183
- override InitializeParameterInstruction instr ;
179
+ ExplicitParameterNode ( ) {
180
+ exists ( instr .getParameter ( ) )
181
+ }
184
182
185
183
override predicate isParameterOf ( Function f , int i ) { f .getParameter ( i ) = instr .getParameter ( ) }
186
184
@@ -191,7 +189,9 @@ private class ExplicitParameterNode extends ParameterNode {
191
189
}
192
190
193
191
private class ThisParameterNode extends ParameterNode {
194
- override InitializeThisInstruction instr ;
192
+ ThisParameterNode ( ) {
193
+ instr .getIRVariable ( ) instanceof IRThisVariable
194
+ }
195
195
196
196
override predicate isParameterOf ( Function f , int i ) {
197
197
i = - 1 and instr .getEnclosingFunction ( ) = f
Original file line number Diff line number Diff line change @@ -19,9 +19,7 @@ uniqueNodeLocation
19
19
missingLocation
20
20
| Nodes without location: 4 |
21
21
uniqueNodeToString
22
- | lambdas.cpp:2:6:2:9 | (no string representation) | Node should have one toString but has 0. |
23
22
missingToString
24
- | Nodes without toString: 1 |
25
23
parameterCallable
26
24
localFlowIsLocal
27
25
compatibleTypesReflexive
Original file line number Diff line number Diff line change 40
40
| test.cpp:347:17:347:22 | test.cpp:349:10:349:18 | AST only |
41
41
| test.cpp:359:13:359:18 | test.cpp:365:10:365:14 | AST only |
42
42
| test.cpp:373:13:373:18 | test.cpp:369:10:369:14 | AST only |
43
- | test.cpp:373:13:373:18 | test.cpp:375:10:375:14 | AST only |
44
43
| test.cpp:399:7:399:9 | test.cpp:401:8:401:10 | AST only |
45
44
| test.cpp:405:7:405:9 | test.cpp:408:8:408:10 | AST only |
46
45
| test.cpp:416:7:416:11 | test.cpp:418:8:418:12 | AST only |
Original file line number Diff line number Diff line change 65
65
| test.cpp:266:12:266:12 | x | test.cpp:265:22:265:27 | call to source |
66
66
| test.cpp:289:14:289:14 | x | test.cpp:305:17:305:22 | call to source |
67
67
| test.cpp:318:7:318:7 | x | test.cpp:314:4:314:9 | call to source |
68
+ | test.cpp:375:10:375:14 | field | test.cpp:373:13:373:18 | call to source |
68
69
| test.cpp:385:8:385:10 | tmp | test.cpp:382:48:382:54 | source1 |
69
70
| test.cpp:392:8:392:10 | tmp | test.cpp:388:53:388:59 | source1 |
70
71
| test.cpp:394:10:394:12 | tmp | test.cpp:388:53:388:59 | source1 |
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ uniqueEnclosingCallable
2
2
uniqueTypeBound
3
3
| by_reference.cpp:106:21:106:41 | Chi | Node should have one type bound but has 2. |
4
4
| by_reference.cpp:126:21:126:40 | Chi | Node should have one type bound but has 2. |
5
+ | file://:0:0:0:0 | Chi | Node should have one type bound but has 2. |
5
6
uniqueTypeRepr
6
7
uniqueNodeLocation
7
8
| D.cpp:1:17:1:17 | o | Node should have one location but has 3. |
You can’t perform that action at this time.
0 commit comments