24
24
*/
25
25
26
26
private import csharp
27
+ private import codeql.util.Boolean
27
28
private import DataFlowImplCommon
28
29
private import DataFlowImplSpecific:: Private
29
30
private import DataFlowImplSpecific:: Private as DataFlowPrivate
30
31
31
32
/**
32
33
* An input configuration for content data flow.
33
34
*/
34
- signature module ContentConfigSig {
35
+ signature module ConfigSig {
35
36
/**
36
37
* Holds if `source` is a relevant data flow source.
37
38
*/
@@ -76,7 +77,7 @@ signature module ContentConfigSig {
76
77
/**
77
78
* Constructs a global content data flow computation.
78
79
*/
79
- module Global< ContentConfigSig ContentConfig> implements DataFlow :: GlobalFlowSig {
80
+ module Global< ConfigSig ContentConfig> {
80
81
private module FlowConfig implements DataFlow:: StateConfigSig {
81
82
class FlowState = State ;
82
83
@@ -116,8 +117,6 @@ module Global<ContentConfigSig ContentConfig> implements DataFlow::GlobalFlowSig
116
117
117
118
private module Flow = DataFlow:: GlobalWithState< FlowConfig > ;
118
119
119
- import Flow
120
-
121
120
/**
122
121
* Holds if data stored inside `sourceAp` on `source` flows to `sinkAp` inside `sink`
123
122
* for this configuration. `preservesValue` indicates whether any of the additional
@@ -131,7 +130,7 @@ module Global<ContentConfigSig ContentConfig> implements DataFlow::GlobalFlowSig
131
130
* that was last stored into. That is, if `sinkAp` is `Field1.Field2` (with `Field1`
132
131
* being the top of the stack), then there is flow into `sink.Field1.Field2`.
133
132
*/
134
- additional predicate flow (
133
+ predicate flow (
135
134
DataFlow:: Node source , AccessPath sourceAp , DataFlow:: Node sink , AccessPath sinkAp ,
136
135
boolean preservesValue
137
136
) {
@@ -150,15 +149,11 @@ module Global<ContentConfigSig ContentConfig> implements DataFlow::GlobalFlowSig
150
149
}
151
150
152
151
private newtype TState =
153
- TInitState ( boolean preservesValue ) { preservesValue in [ false , true ] } or
154
- TStoreState ( int size , boolean preservesValue ) {
155
- size in [ 1 .. ContentConfig:: accessPathLimit ( ) ] and
156
- preservesValue in [ false , true ]
152
+ TInitState ( Boolean preservesValue ) or
153
+ TStoreState ( int size , Boolean preservesValue ) {
154
+ size in [ 1 .. ContentConfig:: accessPathLimit ( ) ]
157
155
} or
158
- TReadState ( int size , boolean preservesValue ) {
159
- size in [ 1 .. ContentConfig:: accessPathLimit ( ) ] and
160
- preservesValue in [ false , true ]
161
- }
156
+ TReadState ( int size , Boolean preservesValue ) { size in [ 1 .. ContentConfig:: accessPathLimit ( ) ] }
162
157
163
158
abstract private class State extends TState {
164
159
abstract string toString ( ) ;
@@ -260,7 +255,7 @@ module Global<ContentConfigSig ContentConfig> implements DataFlow::GlobalFlowSig
260
255
}
261
256
262
257
/** An access path. */
263
- additional class AccessPath extends TAccessPath {
258
+ class AccessPath extends TAccessPath {
264
259
/** Gets the head of this access path, if any. */
265
260
DataFlow:: ContentSet getHead ( ) { this = TAccessPathCons ( result , _) }
266
261
0 commit comments