File tree Expand file tree Collapse file tree
cpp/ql/test/library-tests/dataflow/parameters-without-defs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ void sink (int ); // $ MISSING: ir
2+ void indirect_sink (int *); // $ MISSING: ir
3+ int source ();
4+
5+ void test () {
6+ int x = source ();
7+ sink (x);
8+
9+ int * p = &x;
10+ indirect_sink (p);
11+ }
Original file line number Diff line number Diff line change 1+ testFailures
2+ failures
Original file line number Diff line number Diff line change 1+ import TestUtilities.dataflow.FlowTestCommon
2+ import semmle.code.cpp.dataflow.new.DataFlow
3+
4+ module ParamConfig implements DataFlow:: ConfigSig {
5+ predicate isSource ( DataFlow:: Node source ) { source .asExpr ( ) .( Call ) .getTarget ( ) .hasName ( "source" ) }
6+
7+ predicate isSink ( DataFlow:: Node sink ) {
8+ sink .asParameter ( ) .getFunction ( ) .hasName ( "sink" )
9+ or
10+ sink .asParameter ( 1 ) .getFunction ( ) .hasName ( "indirect_sink" )
11+ }
12+ }
13+
14+ module IRFlow = DataFlow:: Global< ParamConfig > ;
15+
16+ import MakeTest< IRFlowTest< IRFlow > >
You can’t perform that action at this time.
0 commit comments