File tree Expand file tree Collapse file tree
src/semmle/code/cpp/ir/dataflow/internal
test/library-tests/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,11 +162,7 @@ class ExprNode extends InstructionNode {
162162 * as `x` in `f(x)` and implicit parameters such as `this` in `x.f()`
163163 */
164164class ParameterNode extends InstructionNode {
165- ParameterNode ( ) {
166- instr instanceof InitializeParameterInstruction
167- or
168- instr instanceof InitializeThisInstruction
169- }
165+ override InitializeParameterInstruction instr ;
170166
171167 /**
172168 * Holds if this node is the parameter of `c` at the specified (zero-based)
@@ -180,7 +176,9 @@ class ParameterNode extends InstructionNode {
180176 * flow graph.
181177 */
182178private class ExplicitParameterNode extends ParameterNode {
183- override InitializeParameterInstruction instr ;
179+ ExplicitParameterNode ( ) {
180+ exists ( instr .getParameter ( ) )
181+ }
184182
185183 override predicate isParameterOf ( Function f , int i ) { f .getParameter ( i ) = instr .getParameter ( ) }
186184
@@ -191,7 +189,9 @@ private class ExplicitParameterNode extends ParameterNode {
191189}
192190
193191private class ThisParameterNode extends ParameterNode {
194- override InitializeThisInstruction instr ;
192+ ThisParameterNode ( ) {
193+ instr .getIRVariable ( ) instanceof IRThisVariable
194+ }
195195
196196 override predicate isParameterOf ( Function f , int i ) {
197197 i = - 1 and instr .getEnclosingFunction ( ) = f
Original file line number Diff line number Diff line change @@ -19,9 +19,7 @@ uniqueNodeLocation
1919missingLocation
2020| Nodes without location: 4 |
2121uniqueNodeToString
22- | lambdas.cpp:2:6:2:9 | (no string representation) | Node should have one toString but has 0. |
2322missingToString
24- | Nodes without toString: 1 |
2523parameterCallable
2624localFlowIsLocal
2725compatibleTypesReflexive
Original file line number Diff line number Diff line change 4040| test.cpp:347:17:347:22 | test.cpp:349:10:349:18 | AST only |
4141| test.cpp:359:13:359:18 | test.cpp:365:10:365:14 | AST only |
4242| 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 |
4443| test.cpp:399:7:399:9 | test.cpp:401:8:401:10 | AST only |
4544| test.cpp:405:7:405:9 | test.cpp:408:8:408:10 | AST only |
4645| test.cpp:416:7:416:11 | test.cpp:418:8:418:12 | AST only |
Original file line number Diff line number Diff line change 6565| test.cpp:266:12:266:12 | x | test.cpp:265:22:265:27 | call to source |
6666| test.cpp:289:14:289:14 | x | test.cpp:305:17:305:22 | call to source |
6767| 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 |
6869| test.cpp:385:8:385:10 | tmp | test.cpp:382:48:382:54 | source1 |
6970| test.cpp:392:8:392:10 | tmp | test.cpp:388:53:388:59 | source1 |
7071| 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
22uniqueTypeBound
33| by_reference.cpp:106:21:106:41 | Chi | Node should have one type bound but has 2. |
44| 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. |
56uniqueTypeRepr
67uniqueNodeLocation
78| 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