@@ -241,7 +241,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
241
241
242
242
private predicate inBarrier ( NodeEx node ) {
243
243
exists ( Node n |
244
- node .asNode ( ) = n and
244
+ [ node .asNode ( ) , node . asNodeReverse ( ) ] = n and
245
245
Config:: isBarrierIn ( n ) and
246
246
isRelevantSource ( n , _)
247
247
)
@@ -250,15 +250,15 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
250
250
pragma [ nomagic]
251
251
private predicate inBarrier ( NodeEx node , FlowState state ) {
252
252
exists ( Node n |
253
- node .asNode ( ) = n and
253
+ [ node .asNode ( ) , node . asNodeReverse ( ) ] = n and
254
254
Config:: isBarrierIn ( n , state ) and
255
255
isRelevantSource ( n , state )
256
256
)
257
257
}
258
258
259
259
private predicate outBarrier ( NodeEx node ) {
260
260
exists ( Node n |
261
- node .asNodeOrImplicitRead ( ) = n and
261
+ [ node .asNodeOrImplicitRead ( ) , node . asNodeReverse ( ) ] = n and
262
262
Config:: isBarrierOut ( n )
263
263
|
264
264
isRelevantSink ( n , _)
@@ -270,7 +270,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
270
270
pragma [ nomagic]
271
271
private predicate outBarrier ( NodeEx node , FlowState state ) {
272
272
exists ( Node n |
273
- node .asNodeOrImplicitRead ( ) = n and
273
+ [ node .asNodeOrImplicitRead ( ) , node . asNodeReverse ( ) ] = n and
274
274
Config:: isBarrierOut ( n , state )
275
275
|
276
276
isRelevantSink ( n , state )
@@ -281,7 +281,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
281
281
282
282
pragma [ nomagic]
283
283
private predicate fullBarrier ( NodeEx node ) {
284
- exists ( Node n | node .asNode ( ) = n |
284
+ exists ( Node n | [ node .asNode ( ) , node . asNodeReverse ( ) ] = n |
285
285
Config:: isBarrier ( n )
286
286
or
287
287
Config:: isBarrierIn ( n ) and
@@ -295,7 +295,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
295
295
296
296
pragma [ nomagic]
297
297
private predicate stateBarrier ( NodeEx node , FlowState state ) {
298
- exists ( Node n | node .asNode ( ) = n |
298
+ exists ( Node n | [ node .asNode ( ) , node . asNodeReverse ( ) ] = n |
299
299
Config:: isBarrier ( n , state )
300
300
or
301
301
Config:: isBarrierIn ( n , state ) and
@@ -506,8 +506,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
506
506
*/
507
507
bindingset [ p, kind]
508
508
private predicate parameterFlowThroughAllowed ( ParamNodeEx p , ReturnKindExt kind ) {
509
- exists ( ParameterPosition pos | p .isParameterOf ( _, pos ) |
510
- not kind .( ParamUpdateReturnKind ) .getPosition ( ) = pos
509
+ exists ( ParameterPositionEx pos | p .isParameterOf ( _, pos ) |
510
+ not kind .( ParamUpdateReturnKind ) .getPosition ( ) = pos . asParameterPosition ( )
511
511
or
512
512
allowParameterReturnInSelfEx ( p )
513
513
)
@@ -1143,7 +1143,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1143
1143
|
1144
1144
scope = getSecondLevelScopeEx ( ret )
1145
1145
or
1146
- ret = TParamReturnNode ( _, scope )
1146
+ // ret = TParamReturnNode(_, scope)
1147
+ ret = TParamReturnNode ( _) and
1148
+ scope .isNone ( ) // todo
1147
1149
)
1148
1150
}
1149
1151
@@ -2651,8 +2653,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2651
2653
FlowCheckNode ( ) {
2652
2654
revFlow ( this , _, _) and
2653
2655
(
2654
- flowCheckNode ( this ) or
2655
- Config:: neverSkip ( this .asNode ( ) )
2656
+ flowCheckNode ( this )
2657
+ or
2658
+ Config:: neverSkip ( [ this .asNode ( ) , this .asNodeReverse ( ) ] )
2656
2659
)
2657
2660
}
2658
2661
}
@@ -5445,23 +5448,23 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5445
5448
5446
5449
pragma [ noinline]
5447
5450
private predicate partialPathIntoArg (
5448
- PartialPathNodeFwd mid , ParameterPosition ppos , FlowState state , CallContext cc ,
5451
+ PartialPathNodeFwd mid , ParameterPositionEx ppos , FlowState state , CallContext cc ,
5449
5452
DataFlowCall call , DataFlowType t , PartialAccessPath ap
5450
5453
) {
5451
- exists ( ArgNode arg , ArgumentPosition apos |
5452
- arg = mid .getNodeEx ( ) . asNode ( ) and
5454
+ exists ( ArgNodeEx arg , ArgumentPositionEx apos |
5455
+ arg = mid .getNodeEx ( ) and
5453
5456
state = mid .getState ( ) and
5454
5457
cc = mid .getCallContext ( ) and
5455
5458
arg .argumentOf ( call , apos ) and
5456
5459
t = mid .getType ( ) and
5457
5460
ap = mid .getAp ( ) and
5458
- parameterMatch ( ppos , apos )
5461
+ parameterMatchEx ( ppos , apos )
5459
5462
)
5460
5463
}
5461
5464
5462
5465
pragma [ nomagic]
5463
5466
private predicate partialPathIntoCallable0 (
5464
- PartialPathNodeFwd mid , DataFlowCallable callable , ParameterPosition pos , FlowState state ,
5467
+ PartialPathNodeFwd mid , DataFlowCallable callable , ParameterPositionEx pos , FlowState state ,
5465
5468
CallContext outercc , DataFlowCall call , DataFlowType t , PartialAccessPath ap
5466
5469
) {
5467
5470
partialPathIntoArg ( mid , pos , state , outercc , call , t , ap ) and
@@ -5473,7 +5476,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5473
5476
CallContextCall innercc , TSummaryCtx1 sc1 , TSummaryCtx2 sc2 , TSummaryCtx3 sc3 ,
5474
5477
TSummaryCtx4 sc4 , DataFlowCall call , DataFlowType t , PartialAccessPath ap
5475
5478
) {
5476
- exists ( ParameterPosition pos , DataFlowCallable callable |
5479
+ exists ( ParameterPositionEx pos , DataFlowCallable callable |
5477
5480
partialPathIntoCallable0 ( mid , callable , pos , state , outercc , call , t , ap ) and
5478
5481
p .isParameterOf ( callable , pos ) and
5479
5482
sc1 = TSummaryCtx1Param ( p ) and
@@ -5708,24 +5711,24 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5708
5711
5709
5712
pragma [ nomagic]
5710
5713
private predicate revPartialPathFlowsThrough (
5711
- ArgumentPosition apos , FlowState state , TRevSummaryCtx1Some sc1 , TRevSummaryCtx2Some sc2 ,
5714
+ ArgumentPositionEx apos , FlowState state , TRevSummaryCtx1Some sc1 , TRevSummaryCtx2Some sc2 ,
5712
5715
TRevSummaryCtx3Some sc3 , PartialAccessPath ap
5713
5716
) {
5714
- exists ( PartialPathNodeRev mid , ParamNodeEx p , ParameterPosition ppos |
5717
+ exists ( PartialPathNodeRev mid , ParamNodeEx p , ParameterPositionEx ppos |
5715
5718
mid .getNodeEx ( ) = p and
5716
5719
mid .getState ( ) = state and
5717
5720
p .getPosition ( ) = ppos and
5718
5721
sc1 = mid .getSummaryCtx1 ( ) and
5719
5722
sc2 = mid .getSummaryCtx2 ( ) and
5720
5723
sc3 = mid .getSummaryCtx3 ( ) and
5721
5724
ap = mid .getAp ( ) and
5722
- parameterMatch ( ppos , apos )
5725
+ parameterMatchEx ( ppos , apos )
5723
5726
)
5724
5727
}
5725
5728
5726
5729
pragma [ nomagic]
5727
5730
private predicate revPartialPathThroughCallable0 (
5728
- DataFlowCall call , PartialPathNodeRev mid , ArgumentPosition pos , FlowState state ,
5731
+ DataFlowCall call , PartialPathNodeRev mid , ArgumentPositionEx pos , FlowState state ,
5729
5732
PartialAccessPath ap
5730
5733
) {
5731
5734
exists ( TRevSummaryCtx1Some sc1 , TRevSummaryCtx2Some sc2 , TRevSummaryCtx3Some sc3 |
@@ -5738,7 +5741,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5738
5741
private predicate revPartialPathThroughCallable (
5739
5742
PartialPathNodeRev mid , ArgNodeEx node , FlowState state , PartialAccessPath ap
5740
5743
) {
5741
- exists ( DataFlowCall call , ArgumentPosition pos |
5744
+ exists ( DataFlowCall call , ArgumentPositionEx pos |
5742
5745
revPartialPathThroughCallable0 ( call , mid , pos , state , ap ) and
5743
5746
node .argumentOf ( call , pos )
5744
5747
)
0 commit comments