3
3
*/
4
4
5
5
private import codeql.util.Void
6
+ private import codeql.util.Unit
6
7
private import codeql.dataflow.DataFlow
7
8
private import codeql.dataflow.internal.DataFlowImpl
8
9
private import rust
@@ -26,11 +27,6 @@ module Node {
26
27
*/
27
28
Expr asExpr ( ) { none ( ) }
28
29
29
- /**
30
- * Gets this node's underlying pattern, if any.
31
- */
32
- Pat asPattern ( ) { none ( ) }
33
-
34
30
/**
35
31
* Gets the control flow node that corresponds to this data flow node.
36
32
*/
@@ -73,7 +69,7 @@ module Node {
73
69
final class ArgumentNode = NaNode ;
74
70
75
71
final class ReturnNode extends NaNode {
76
- ReturnKind getKind ( ) { none ( ) }
72
+ RustDataFlow :: ReturnKind getKind ( ) { none ( ) }
77
73
}
78
74
79
75
final class OutNode = NaNode ;
@@ -152,7 +148,7 @@ module RustDataFlow implements InputSig<Location> {
152
148
153
149
OutNode getAnOutNode ( DataFlowCall call , ReturnKind kind ) { none ( ) }
154
150
155
- final class DataFlowType = Void ;
151
+ final class DataFlowType = Unit ;
156
152
157
153
predicate compatibleTypes ( DataFlowType t1 , DataFlowType t2 ) { any ( ) }
158
154
@@ -281,21 +277,16 @@ module RustDataFlow implements InputSig<Location> {
281
277
class DataFlowSecondLevelScope = Void ;
282
278
}
283
279
284
- import RustDataFlow
285
- import MakeImpl< Location , RustDataFlow >
280
+ final class ContentSet = RustDataFlow:: ContentSet ;
286
281
287
- /**
288
- * Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local
289
- * (intra-procedural) step.
290
- */
291
- predicate localFlowStep = localFlowStepImpl / 2 ;
282
+ import MakeImpl< Location , RustDataFlow >
292
283
293
284
/** A collection of cached types and predicates to be evaluated in the same stage. */
294
285
cached
295
286
private module Cached {
296
287
cached
297
288
newtype TNode =
298
- TExprNode ( CfgNode n , Expr e ) or
289
+ TExprNode ( CfgNode n , Expr e ) { n . getAstNode ( ) = e } or
299
290
TSourceParameterNode ( Param param )
300
291
301
292
cached
@@ -311,14 +302,7 @@ private module Cached {
311
302
312
303
/** This is the local flow predicate that is exposed. */
313
304
cached
314
- predicate localFlowStepImpl ( Node nodeFrom , Node nodeTo ) { none ( ) }
305
+ predicate localFlowStepImpl ( Node:: Node nodeFrom , Node :: Node nodeTo ) { none ( ) }
315
306
}
316
307
317
308
import Cached
318
-
319
- /**
320
- * Holds if data flows from `source` to `sink` in zero or more local
321
- * (intra-procedural) steps.
322
- */
323
- pragma [ inline]
324
- predicate localFlow ( Node source , Node sink ) { localFlowStep * ( source , sink ) }
0 commit comments