@@ -54,7 +54,7 @@ abstract class Configuration extends string {
54
54
/**
55
55
* Holds if `source` is a relevant data flow source.
56
56
*/
57
- abstract predicate isSource ( Node source ) ;
57
+ predicate isSource ( Node source ) { none ( ) }
58
58
59
59
/**
60
60
* Holds if `source` is a relevant data flow source with the given initial
@@ -65,7 +65,7 @@ abstract class Configuration extends string {
65
65
/**
66
66
* Holds if `sink` is a relevant data flow sink.
67
67
*/
68
- abstract predicate isSink ( Node sink ) ;
68
+ predicate isSink ( Node sink ) { none ( ) }
69
69
70
70
/**
71
71
* Holds if `sink` is a relevant data flow sink accepting `state`.
@@ -308,16 +308,18 @@ private class RetNodeEx extends NodeEx {
308
308
private predicate inBarrier ( NodeEx node , Configuration config ) {
309
309
exists ( Node n |
310
310
node .asNode ( ) = n and
311
- config .isBarrierIn ( n ) and
312
- ( config .isSource ( n ) or config .isSource ( n , _) )
311
+ config .isBarrierIn ( n )
312
+ |
313
+ config .isSource ( n ) or config .isSource ( n , _)
313
314
)
314
315
}
315
316
316
317
private predicate outBarrier ( NodeEx node , Configuration config ) {
317
318
exists ( Node n |
318
319
node .asNode ( ) = n and
319
- config .isBarrierOut ( n ) and
320
- ( config .isSink ( n ) or config .isSink ( n , _) )
320
+ config .isBarrierOut ( n )
321
+ |
322
+ config .isSink ( n ) or config .isSink ( n , _)
321
323
)
322
324
}
323
325
@@ -1586,9 +1588,11 @@ private module Stage2 {
1586
1588
pragma [ nomagic]
1587
1589
predicate revFlow ( NodeEx node , Configuration config ) { revFlow ( node , _, _, _, _, config ) }
1588
1590
1591
+ // use an alias as a workaround for bad functionality-induced joins
1589
1592
pragma [ nomagic]
1590
1593
predicate revFlowAlias ( NodeEx node , Configuration config ) { revFlow ( node , _, _, _, _, config ) }
1591
1594
1595
+ // use an alias as a workaround for bad functionality-induced joins
1592
1596
pragma [ nomagic]
1593
1597
predicate revFlowAlias (
1594
1598
NodeEx node , FlowState state , boolean toReturn , ApOption returnAp , Ap ap , Configuration config
@@ -2349,9 +2353,11 @@ private module Stage3 {
2349
2353
pragma [ nomagic]
2350
2354
predicate revFlow ( NodeEx node , Configuration config ) { revFlow ( node , _, _, _, _, config ) }
2351
2355
2356
+ // use an alias as a workaround for bad functionality-induced joins
2352
2357
pragma [ nomagic]
2353
2358
predicate revFlowAlias ( NodeEx node , Configuration config ) { revFlow ( node , _, _, _, _, config ) }
2354
2359
2360
+ // use an alias as a workaround for bad functionality-induced joins
2355
2361
pragma [ nomagic]
2356
2362
predicate revFlowAlias (
2357
2363
NodeEx node , FlowState state , boolean toReturn , ApOption returnAp , Ap ap , Configuration config
@@ -3175,9 +3181,11 @@ private module Stage4 {
3175
3181
pragma [ nomagic]
3176
3182
predicate revFlow ( NodeEx node , Configuration config ) { revFlow ( node , _, _, _, _, config ) }
3177
3183
3184
+ // use an alias as a workaround for bad functionality-induced joins
3178
3185
pragma [ nomagic]
3179
3186
predicate revFlowAlias ( NodeEx node , Configuration config ) { revFlow ( node , _, _, _, _, config ) }
3180
3187
3188
+ // use an alias as a workaround for bad functionality-induced joins
3181
3189
pragma [ nomagic]
3182
3190
predicate revFlowAlias (
3183
3191
NodeEx node , FlowState state , boolean toReturn , ApOption returnAp , Ap ap , Configuration config
@@ -3990,14 +3998,10 @@ private predicate pathIntoArg(
3990
3998
PathNodeMid mid , ParameterPosition ppos , FlowState state , CallContext cc , DataFlowCall call ,
3991
3999
AccessPath ap , AccessPathApprox apa , Configuration config
3992
4000
) {
3993
- exists ( ArgNode arg , ArgumentPosition apos |
3994
- arg = mid .getNodeEx ( ) .asNode ( ) and
3995
- state = mid .getState ( ) and
3996
- cc = mid .getCallContext ( ) and
3997
- arg .argumentOf ( call , apos ) and
3998
- ap = mid .getAp ( ) and
4001
+ exists ( ArgNodeEx arg , ArgumentPosition apos |
4002
+ pathNode ( mid , arg , state , cc , _, ap , config , _) and
4003
+ arg .asNode ( ) .( ArgNode ) .argumentOf ( call , apos ) and
3999
4004
apa = ap .getApprox ( ) and
4000
- config = mid .getConfiguration ( ) and
4001
4005
parameterMatch ( ppos , apos )
4002
4006
)
4003
4007
}
@@ -4063,13 +4067,8 @@ private predicate paramFlowsThrough(
4063
4067
AccessPathApprox apa , Configuration config
4064
4068
) {
4065
4069
exists ( PathNodeMid mid , RetNodeEx ret , ParameterPosition pos |
4066
- mid . getNodeEx ( ) = ret and
4070
+ pathNode ( mid , ret , state , cc , sc , ap , config , _ ) and
4067
4071
kind = ret .getKind ( ) and
4068
- state = mid .getState ( ) and
4069
- cc = mid .getCallContext ( ) and
4070
- sc = mid .getSummaryCtx ( ) and
4071
- config = mid .getConfiguration ( ) and
4072
- ap = mid .getAp ( ) and
4073
4072
apa = ap .getApprox ( ) and
4074
4073
pos = sc .getParameterPos ( ) and
4075
4074
// we don't expect a parameter to return stored in itself, unless explicitly allowed
@@ -4150,13 +4149,8 @@ private module Subpaths {
4150
4149
) {
4151
4150
exists ( SummaryCtxSome sc , CallContext innercc , ReturnKindExt kind , RetNodeEx retnode |
4152
4151
subpaths02 ( arg , par , sc , innercc , kind , out , sout , apout ) and
4153
- ret .getNodeEx ( ) = retnode and
4154
- kind = retnode .getKind ( ) and
4155
- innercc = ret .getCallContext ( ) and
4156
- sc = ret .getSummaryCtx ( ) and
4157
- ret .getConfiguration ( ) = unbindConf ( getPathNodeConf ( arg ) ) and
4158
- sout = ret .getState ( ) and
4159
- apout = ret .getAp ( )
4152
+ pathNode ( ret , retnode , sout , innercc , sc , apout , unbindConf ( getPathNodeConf ( arg ) ) , _) and
4153
+ kind = retnode .getKind ( )
4160
4154
)
4161
4155
}
4162
4156
0 commit comments