@@ -7,6 +7,7 @@ private import codeql.rust.dataflow.internal.Content
77private import codeql.rust.dataflow.FlowSource as FlowSource
88private import codeql.rust.dataflow.FlowSink as FlowSink
99private import codeql.rust.dataflow.internal.TaintTrackingImpl
10+ private import codeql.rust.dataflow.internal.TaintTrackingImpl as TaintTrackingImpl
1011private import codeql.mad.modelgenerator.internal.ModelGeneratorImpl
1112private import codeql.rust.dataflow.internal.FlowSummaryImpl as FlowSummary
1213
@@ -42,9 +43,15 @@ class QualifiedCallable extends TCallable {
4243 string getCanonicalPath ( ) { result = path }
4344}
4445
45- module ModelGeneratorCommonInput implements
46- ModelGeneratorCommonInputSig< R:: Location , DataFlowImpl:: RustDataFlow >
47- {
46+ private module RustDataFlowInput implements DataFlowImpl:: RustDataFlowInputSig {
47+ predicate includeDynamicTargets ( ) { none ( ) }
48+ }
49+
50+ module RustDataFlow = DataFlowImpl:: RustDataFlowGen< RustDataFlowInput > ;
51+
52+ module RustTaintTracking = TaintTrackingImpl:: RustTaintTrackingGen< RustDataFlowInput > ;
53+
54+ module ModelGeneratorCommonInput implements ModelGeneratorCommonInputSig< R:: Location , RustDataFlow > {
4855 // NOTE: We are not using type information for now.
4956 class Type = Unit ;
5057
@@ -71,9 +78,8 @@ module ModelGeneratorCommonInput implements
7178
7279 string parameterExactAccess ( R:: ParamBase p ) {
7380 result =
74- "Argument[" +
75- any ( DataFlowImpl:: RustDataFlow:: ParameterPosition pos | p = pos .getParameterIn ( _) )
76- .toString ( ) + "]"
81+ "Argument[" + any ( RustDataFlow:: ParameterPosition pos | p = pos .getParameterIn ( _) ) .toString ( ) +
82+ "]"
7783 }
7884
7985 string parameterApproximateAccess ( R:: ParamBase p ) { result = parameterExactAccess ( p ) }
@@ -83,16 +89,12 @@ module ModelGeneratorCommonInput implements
8389 }
8490
8591 bindingset [ c]
86- string paramReturnNodeAsApproximateOutput (
87- QualifiedCallable c , DataFlowImpl:: RustDataFlow:: ParameterPosition pos
88- ) {
92+ string paramReturnNodeAsApproximateOutput ( QualifiedCallable c , RustDataFlow:: ParameterPosition pos ) {
8993 result = paramReturnNodeAsExactOutput ( c , pos )
9094 }
9195
9296 bindingset [ c]
93- string paramReturnNodeAsExactOutput (
94- QualifiedCallable c , DataFlowImpl:: RustDataFlow:: ParameterPosition pos
95- ) {
97+ string paramReturnNodeAsExactOutput ( QualifiedCallable c , RustDataFlow:: ParameterPosition pos ) {
9698 result = parameterExactAccess ( c .getFunction ( ) .getParam ( pos .getPosition ( ) ) )
9799 or
98100 pos .isSelf ( ) and result = qualifierString ( )
@@ -102,7 +104,7 @@ module ModelGeneratorCommonInput implements
102104 result .getFunction ( ) = ret .( Node:: Node ) .getEnclosingCallable ( ) .asCfgScope ( )
103105 }
104106
105- predicate isOwnInstanceAccessNode ( DataFlowImpl :: RustDataFlow:: ReturnNode node ) {
107+ predicate isOwnInstanceAccessNode ( RustDataFlow:: ReturnNode node ) {
106108 // This is probably not relevant to implement for Rust, as we only use
107109 // `captureMixedFlow` which doesn't explicitly distinguish between
108110 // functions that return `self` and those that don't.
@@ -119,7 +121,7 @@ module ModelGeneratorCommonInput implements
119121}
120122
121123private import ModelGeneratorCommonInput
122- private import MakeModelGeneratorFactory< R:: Location , DataFlowImpl :: RustDataFlow , RustTaintTracking , ModelGeneratorCommonInput >
124+ private import MakeModelGeneratorFactory< R:: Location , RustDataFlow , RustTaintTracking , ModelGeneratorCommonInput >
123125
124126private module SummaryModelGeneratorInput implements SummaryModelGeneratorInputSig {
125127 class SummaryTargetApi extends QualifiedCallable {
0 commit comments