@@ -219,16 +219,14 @@ module RelevantStateConfig implements DataFlow::ConfigSig {
219
219
220
220
module RelevantStateFlow = DataFlow:: Global< RelevantStateConfig > ;
221
221
222
- predicate relevantState ( DataFlow:: Node sink , Class state ) {
223
- exists ( DataFlow:: Node source |
224
- RelevantStateFlow:: flow ( source , sink ) and
225
- isSourceImpl ( source , state )
226
- )
222
+ predicate relevantState ( DataFlow:: Node source , DataFlow:: Node sink , Class state ) {
223
+ RelevantStateFlow:: flow ( source , sink ) and
224
+ isSourceImpl ( source , state )
227
225
}
228
226
229
227
predicate isSinkImpl ( DataFlow:: Node sink , Class state , Type convertedType , boolean compatible ) {
230
228
exists ( UnsafeCast cast |
231
- relevantState ( sink , state ) and
229
+ relevantState ( _ , sink , state ) and
232
230
sink .asExpr ( ) = cast .getUnconverted ( ) and
233
231
convertedType = cast .getConvertedType ( )
234
232
|
@@ -245,10 +243,10 @@ predicate isSinkImpl(DataFlow::Node sink, Class state, Type convertedType, boole
245
243
*/
246
244
module BadConfig implements DataFlow:: StateConfigSig {
247
245
class FlowState extends Class {
248
- FlowState ( ) { relevantState ( _, this ) }
246
+ FlowState ( ) { relevantState ( _, _ , this ) }
249
247
}
250
248
251
- predicate isSource ( DataFlow:: Node source , FlowState state ) { isSourceImpl ( source , state ) }
249
+ predicate isSource ( DataFlow:: Node source , FlowState state ) { relevantState ( source , _ , state ) }
252
250
253
251
predicate isBarrier ( DataFlow:: Node node ) { RelevantStateConfig:: isBarrier ( node ) }
254
252
0 commit comments