File tree Expand file tree Collapse file tree
src/semmle/code/cpp/ir/dataflow/internal
test/library-tests/dataflow/dataflow-tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class Node extends Instruction {
2525 }
2626
2727 /** Gets the expression corresponding to this node, if any. */
28- Expr asExpr ( ) { result = this .getUnconvertedResultExpression ( ) }
28+ Expr asExpr ( ) { result = this .getConvertedResultExpression ( ) }
2929
3030 /** Gets the parameter corresponding to this node, if any. */
3131 Parameter asParameter ( ) { result = this .( InitializeParameterInstruction ) .getParameter ( ) }
@@ -48,8 +48,10 @@ class Node extends Instruction {
4848 * An expression, viewed as a node in a data flow graph.
4949 */
5050class ExprNode extends Node {
51- ExprNode ( ) { getAST ( ) instanceof Expr }
52- Expr getExpr ( ) { result = getAST ( ) }
51+ Expr expr ;
52+
53+ ExprNode ( ) { expr = this .getConvertedResultExpression ( ) }
54+ Expr getExpr ( ) { result = expr }
5355}
5456
5557/**
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class TestAllocationConfig extends DataFlow::Configuration {
1919 override predicate isSink ( DataFlow:: Node sink ) {
2020 exists ( FunctionCall call |
2121 call .getTarget ( ) .getName ( ) = "sink" and
22- sink .asExpr ( ) = call .getAnArgument ( )
22+ sink .asExpr ( ) = call .getAnArgument ( ) . getFullyConverted ( )
2323 )
2424 }
2525
Original file line number Diff line number Diff line change 11| test.cpp:6:12:6:17 | test.cpp:21:8:21:9 | IR only |
22| test.cpp:66:30:66:36 | test.cpp:71:8:71:9 | AST only |
3- | test.cpp:89:28:89:34 | test.cpp:92 :8:92 :14 | IR only |
3+ | test.cpp:89:28:89:34 | test.cpp:90 :8:90 :14 | AST only |
44| test.cpp:100:13:100:18 | test.cpp:103:10:103:12 | AST only |
55| test.cpp:120:9:120:20 | test.cpp:126:8:126:19 | AST only |
66| test.cpp:122:18:122:30 | test.cpp:132:22:132:23 | IR only |
Original file line number Diff line number Diff line change 1010| test.cpp:76:8:76:9 | Load: u1 | test.cpp:75:7:75:8 | Uninitialized: definition of u1 |
1111| test.cpp:84:8:84:18 | Load: ... ? ... : ... | test.cpp:83:7:83:8 | Uninitialized: definition of u2 |
1212| test.cpp:86:8:86:9 | Load: i1 | test.cpp:83:7:83:8 | Uninitialized: definition of u2 |
13- | test.cpp:90:8:90:14 | Load: source1 | test.cpp:89:28:89:34 | InitializeParameter: source1 |
14- | test.cpp:92:8:92:14 | Load: source1 | test.cpp:89:28:89:34 | InitializeParameter: source1 |
1513| test.cpp:132:22:132:23 | Load: m1 | test.cpp:122:18:122:30 | InitializeParameter: sourceStruct1 |
1614| test.cpp:140:22:140:23 | Load: m1 | test.cpp:122:18:122:30 | InitializeParameter: sourceStruct1 |
1715| test.cpp:188:8:188:8 | Load: y | test.cpp:186:27:186:32 | Call: call to source |
You can’t perform that action at this time.
0 commit comments