1
1
import semmle.code.cpp.ir.dataflow.DataFlow
2
+ private import codeql.util.Unit
2
3
3
4
module ProductFlow {
4
5
signature module ConfigSig {
@@ -68,33 +69,33 @@ module ProductFlow {
68
69
69
70
module Make< ConfigSig Config> {
70
71
private module StateConfig implements StateConfigSig {
71
- class FlowState1 = DataFlow :: FlowState ;
72
+ class FlowState1 = Unit ;
72
73
73
- class FlowState2 = DataFlow :: FlowState ;
74
+ class FlowState2 = Unit ;
74
75
75
76
predicate isSourcePair (
76
77
DataFlow:: Node source1 , FlowState1 state1 , DataFlow:: Node source2 , FlowState2 state2
77
78
) {
78
- state1 instanceof DataFlow :: FlowStateEmpty and
79
- state2 instanceof DataFlow :: FlowStateEmpty and
79
+ exists ( state1 ) and
80
+ exists ( state2 ) and
80
81
Config:: isSourcePair ( source1 , source2 )
81
82
}
82
83
83
84
predicate isSinkPair (
84
85
DataFlow:: Node sink1 , FlowState1 state1 , DataFlow:: Node sink2 , FlowState2 state2
85
86
) {
86
- state1 instanceof DataFlow :: FlowStateEmpty and
87
- state2 instanceof DataFlow :: FlowStateEmpty and
87
+ exists ( state1 ) and
88
+ exists ( state2 ) and
88
89
Config:: isSinkPair ( sink1 , sink2 )
89
90
}
90
91
91
92
predicate isBarrier1 ( DataFlow:: Node node , FlowState1 state ) {
92
- state instanceof DataFlow :: FlowStateEmpty and
93
+ exists ( state ) and
93
94
Config:: isBarrier1 ( node )
94
95
}
95
96
96
97
predicate isBarrier2 ( DataFlow:: Node node , FlowState2 state ) {
97
- state instanceof DataFlow :: FlowStateEmpty and
98
+ exists ( state ) and
98
99
Config:: isBarrier2 ( node )
99
100
}
100
101
@@ -111,8 +112,8 @@ module ProductFlow {
111
112
predicate isAdditionalFlowStep1 (
112
113
DataFlow:: Node node1 , FlowState1 state1 , DataFlow:: Node node2 , FlowState1 state2
113
114
) {
114
- state1 instanceof DataFlow :: FlowStateEmpty and
115
- state2 instanceof DataFlow :: FlowStateEmpty and
115
+ exists ( state1 ) and
116
+ exists ( state2 ) and
116
117
Config:: isAdditionalFlowStep1 ( node1 , node2 )
117
118
}
118
119
@@ -121,8 +122,8 @@ module ProductFlow {
121
122
predicate isAdditionalFlowStep2 (
122
123
DataFlow:: Node node1 , FlowState2 state1 , DataFlow:: Node node2 , FlowState2 state2
123
124
) {
124
- state1 instanceof DataFlow :: FlowStateEmpty and
125
- state2 instanceof DataFlow :: FlowStateEmpty and
125
+ exists ( state1 ) and
126
+ exists ( state2 ) and
126
127
Config:: isAdditionalFlowStep2 ( node1 , node2 )
127
128
}
128
129
0 commit comments