File tree Expand file tree Collapse file tree
lib/semmle/code/cpp/ir/dataflow/internal
test/library-tests/syntax-zoo Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ private class Node0 extends Node, TNode0 {
390390
391391 override DataFlowType getType ( ) { result = node .getType ( ) }
392392
393- final override Location getLocationImpl ( ) { result = node .getLocationImpl ( ) }
393+ override Location getLocationImpl ( ) { result = node .getLocationImpl ( ) }
394394
395395 override string toStringImpl ( ) {
396396 // This predicate is overridden in subclasses. This default implementation
@@ -413,6 +413,8 @@ class InstructionNode extends Node0 {
413413 /** Gets the instruction corresponding to this node. */
414414 Instruction getInstruction ( ) { result = instr }
415415
416+ override Location getLocationImpl ( ) { result = instr .getAst ( ) .getLocation ( ) }
417+
416418 override string toStringImpl ( ) {
417419 if instr .( InitializeParameterInstruction ) .getIRVariable ( ) instanceof IRThisVariable
418420 then result = "this"
@@ -432,6 +434,8 @@ class OperandNode extends Node, Node0 {
432434 /** Gets the operand corresponding to this node. */
433435 Operand getOperand ( ) { result = op }
434436
437+ override Location getLocationImpl ( ) { result = op .getDef ( ) .getAst ( ) .getLocation ( ) }
438+
435439 override string toStringImpl ( ) {
436440 if op .getDef ( ) .( InitializeParameterInstruction ) .getIRVariable ( ) instanceof IRThisVariable
437441 then result = "this"
Original file line number Diff line number Diff line change 11uniqueEnclosingCallable
22uniqueType
33uniqueNodeLocation
4- | cpp11.cpp:28:21:28:21 | (__range) | Node should have one location but has 2. |
5- | cpp11.cpp:28:21:28:21 | (__range) | Node should have one location but has 2. |
6- | file://:0:0:0:0 | (__range) | Node should have one location but has 2. |
7- | file://:0:0:0:0 | (__range) | Node should have one location but has 2. |
8- | file://:0:0:0:0 | (__range) | Node should have one location but has 2. |
9- | file://:0:0:0:0 | (__range) | Node should have one location but has 2. |
104| file://:0:0:0:0 | (unnamed parameter 2) | Node should have one location but has 0. |
115| file://:0:0:0:0 | (unnamed parameter 2) | Node should have one location but has 0. |
126| file://:0:0:0:0 | (unnamed parameter 2) | Node should have one location but has 0. |
@@ -19,12 +13,6 @@ uniqueNodeLocation
1913| file://:0:0:0:0 | (unnamed parameter 2) indirection | Node should have one location but has 0. |
2014| file://:0:0:0:0 | (unnamed parameter 2) indirection | Node should have one location but has 0. |
2115| file://:0:0:0:0 | (unnamed parameter 2) indirection | Node should have one location but has 0. |
22- | file://:0:0:0:0 | this | Node should have one location but has 2. |
23- | file://:0:0:0:0 | this | Node should have one location but has 2. |
24- | ir.cpp:756:8:756:8 | this | Node should have one location but has 2. |
25- | ir.cpp:765:8:765:8 | this | Node should have one location but has 2. |
26- | stream_it.cpp:11:16:11:16 | (__range) | Node should have one location but has 2. |
27- | stream_it.cpp:11:16:11:16 | (__range) | Node should have one location but has 2. |
2816missingLocation
2917| Nodes without location: 12 |
3018uniqueNodeToString
You can’t perform that action at this time.
0 commit comments