@@ -256,11 +256,11 @@ private class ArgNodeEx extends NodeEx {
256
256
private class ParamNodeEx extends NodeEx {
257
257
ParamNodeEx ( ) { this .asNode ( ) instanceof ParamNode }
258
258
259
- predicate isParameterOf ( DataFlowCallable c , int i ) {
260
- this .asNode ( ) .( ParamNode ) .isParameterOf ( c , i )
259
+ predicate isParameterOf ( DataFlowCallable c , ParameterPosition pos ) {
260
+ this .asNode ( ) .( ParamNode ) .isParameterOf ( c , pos )
261
261
}
262
262
263
- int getPosition ( ) { this .isParameterOf ( _, result ) }
263
+ ParameterPosition getPosition ( ) { this .isParameterOf ( _, result ) }
264
264
265
265
predicate allowParameterReturnInSelf ( ) { allowParameterReturnInSelfCached ( this .asNode ( ) ) }
266
266
}
@@ -1447,7 +1447,7 @@ private module Stage2 {
1447
1447
}
1448
1448
1449
1449
predicate parameterMayFlowThrough ( ParamNodeEx p , DataFlowCallable c , Ap ap , Configuration config ) {
1450
- exists ( RetNodeEx ret , Ap ap0 , ReturnKindExt kind , int pos |
1450
+ exists ( RetNodeEx ret , Ap ap0 , ReturnKindExt kind , ParameterPosition pos |
1451
1451
parameterFlow ( p , ap , ap0 , c , config ) and
1452
1452
c = ret .getEnclosingCallable ( ) and
1453
1453
revFlow ( pragma [ only_bind_into ] ( ret ) , true , apSome ( _) , pragma [ only_bind_into ] ( ap0 ) ,
@@ -2142,7 +2142,7 @@ private module Stage3 {
2142
2142
}
2143
2143
2144
2144
predicate parameterMayFlowThrough ( ParamNodeEx p , DataFlowCallable c , Ap ap , Configuration config ) {
2145
- exists ( RetNodeEx ret , Ap ap0 , ReturnKindExt kind , int pos |
2145
+ exists ( RetNodeEx ret , Ap ap0 , ReturnKindExt kind , ParameterPosition pos |
2146
2146
parameterFlow ( p , ap , ap0 , c , config ) and
2147
2147
c = ret .getEnclosingCallable ( ) and
2148
2148
revFlow ( pragma [ only_bind_into ] ( ret ) , true , apSome ( _) , pragma [ only_bind_into ] ( ap0 ) ,
@@ -2908,7 +2908,7 @@ private module Stage4 {
2908
2908
}
2909
2909
2910
2910
predicate parameterMayFlowThrough ( ParamNodeEx p , DataFlowCallable c , Ap ap , Configuration config ) {
2911
- exists ( RetNodeEx ret , Ap ap0 , ReturnKindExt kind , int pos |
2911
+ exists ( RetNodeEx ret , Ap ap0 , ReturnKindExt kind , ParameterPosition pos |
2912
2912
parameterFlow ( p , ap , ap0 , c , config ) and
2913
2913
c = ret .getEnclosingCallable ( ) and
2914
2914
revFlow ( pragma [ only_bind_into ] ( ret ) , true , apSome ( _) , pragma [ only_bind_into ] ( ap0 ) ,
@@ -2992,7 +2992,7 @@ private class SummaryCtxSome extends SummaryCtx, TSummaryCtxSome {
2992
2992
2993
2993
SummaryCtxSome ( ) { this = TSummaryCtxSome ( p , ap ) }
2994
2994
2995
- int getParameterPos ( ) { p .isParameterOf ( _, result ) }
2995
+ ParameterPosition getParameterPos ( ) { p .isParameterOf ( _, result ) }
2996
2996
2997
2997
ParamNodeEx getParamNode ( ) { result = p }
2998
2998
@@ -3639,39 +3639,40 @@ private predicate pathOutOfCallable(PathNodeMid mid, NodeEx out, CallContext cc)
3639
3639
*/
3640
3640
pragma [ noinline]
3641
3641
private predicate pathIntoArg (
3642
- PathNodeMid mid , int i , CallContext cc , DataFlowCall call , AccessPath ap , AccessPathApprox apa ,
3643
- Configuration config
3642
+ PathNodeMid mid , ParameterPosition ppos , CallContext cc , DataFlowCall call , AccessPath ap ,
3643
+ AccessPathApprox apa , Configuration config
3644
3644
) {
3645
- exists ( ArgNode arg |
3645
+ exists ( ArgNode arg , ArgumentPosition apos |
3646
3646
arg = mid .getNodeEx ( ) .asNode ( ) and
3647
3647
cc = mid .getCallContext ( ) and
3648
- arg .argumentOf ( call , i ) and
3648
+ arg .argumentOf ( call , apos ) and
3649
3649
ap = mid .getAp ( ) and
3650
3650
apa = ap .getApprox ( ) and
3651
- config = mid .getConfiguration ( )
3651
+ config = mid .getConfiguration ( ) and
3652
+ parameterMatch ( ppos , apos )
3652
3653
)
3653
3654
}
3654
3655
3655
3656
pragma [ nomagic]
3656
3657
private predicate parameterCand (
3657
- DataFlowCallable callable , int i , AccessPathApprox apa , Configuration config
3658
+ DataFlowCallable callable , ParameterPosition pos , AccessPathApprox apa , Configuration config
3658
3659
) {
3659
3660
exists ( ParamNodeEx p |
3660
3661
Stage4:: revFlow ( p , _, _, apa , config ) and
3661
- p .isParameterOf ( callable , i )
3662
+ p .isParameterOf ( callable , pos )
3662
3663
)
3663
3664
}
3664
3665
3665
3666
pragma [ nomagic]
3666
3667
private predicate pathIntoCallable0 (
3667
- PathNodeMid mid , DataFlowCallable callable , int i , CallContext outercc , DataFlowCall call ,
3668
- AccessPath ap , Configuration config
3668
+ PathNodeMid mid , DataFlowCallable callable , ParameterPosition pos , CallContext outercc ,
3669
+ DataFlowCall call , AccessPath ap , Configuration config
3669
3670
) {
3670
3671
exists ( AccessPathApprox apa |
3671
- pathIntoArg ( mid , pragma [ only_bind_into ] ( i ) , outercc , call , ap , pragma [ only_bind_into ] ( apa ) ,
3672
+ pathIntoArg ( mid , pragma [ only_bind_into ] ( pos ) , outercc , call , ap , pragma [ only_bind_into ] ( apa ) ,
3672
3673
pragma [ only_bind_into ] ( config ) ) and
3673
3674
callable = resolveCall ( call , outercc ) and
3674
- parameterCand ( callable , pragma [ only_bind_into ] ( i ) , pragma [ only_bind_into ] ( apa ) ,
3675
+ parameterCand ( callable , pragma [ only_bind_into ] ( pos ) , pragma [ only_bind_into ] ( apa ) ,
3675
3676
pragma [ only_bind_into ] ( config ) )
3676
3677
)
3677
3678
}
@@ -3686,9 +3687,9 @@ private predicate pathIntoCallable(
3686
3687
PathNodeMid mid , ParamNodeEx p , CallContext outercc , CallContextCall innercc , SummaryCtx sc ,
3687
3688
DataFlowCall call , Configuration config
3688
3689
) {
3689
- exists ( int i , DataFlowCallable callable , AccessPath ap |
3690
- pathIntoCallable0 ( mid , callable , i , outercc , call , ap , config ) and
3691
- p .isParameterOf ( callable , i ) and
3690
+ exists ( ParameterPosition pos , DataFlowCallable callable , AccessPath ap |
3691
+ pathIntoCallable0 ( mid , callable , pos , outercc , call , ap , config ) and
3692
+ p .isParameterOf ( callable , pos ) and
3692
3693
(
3693
3694
sc = TSummaryCtxSome ( p , ap )
3694
3695
or
@@ -3712,7 +3713,7 @@ private predicate paramFlowsThrough(
3712
3713
ReturnKindExt kind , CallContextCall cc , SummaryCtxSome sc , AccessPath ap , AccessPathApprox apa ,
3713
3714
Configuration config
3714
3715
) {
3715
- exists ( PathNodeMid mid , RetNodeEx ret , int pos |
3716
+ exists ( PathNodeMid mid , RetNodeEx ret , ParameterPosition pos |
3716
3717
mid .getNodeEx ( ) = ret and
3717
3718
kind = ret .getKind ( ) and
3718
3719
cc = mid .getCallContext ( ) and
@@ -4441,24 +4442,25 @@ private module FlowExploration {
4441
4442
4442
4443
pragma [ noinline]
4443
4444
private predicate partialPathIntoArg (
4444
- PartialPathNodeFwd mid , int i , CallContext cc , DataFlowCall call , PartialAccessPath ap ,
4445
- Configuration config
4445
+ PartialPathNodeFwd mid , ParameterPosition ppos , CallContext cc , DataFlowCall call ,
4446
+ PartialAccessPath ap , Configuration config
4446
4447
) {
4447
- exists ( ArgNode arg |
4448
+ exists ( ArgNode arg , ArgumentPosition apos |
4448
4449
arg = mid .getNodeEx ( ) .asNode ( ) and
4449
4450
cc = mid .getCallContext ( ) and
4450
- arg .argumentOf ( call , i ) and
4451
+ arg .argumentOf ( call , apos ) and
4451
4452
ap = mid .getAp ( ) and
4452
- config = mid .getConfiguration ( )
4453
+ config = mid .getConfiguration ( ) and
4454
+ parameterMatch ( ppos , apos )
4453
4455
)
4454
4456
}
4455
4457
4456
4458
pragma [ nomagic]
4457
4459
private predicate partialPathIntoCallable0 (
4458
- PartialPathNodeFwd mid , DataFlowCallable callable , int i , CallContext outercc ,
4460
+ PartialPathNodeFwd mid , DataFlowCallable callable , ParameterPosition pos , CallContext outercc ,
4459
4461
DataFlowCall call , PartialAccessPath ap , Configuration config
4460
4462
) {
4461
- partialPathIntoArg ( mid , i , outercc , call , ap , config ) and
4463
+ partialPathIntoArg ( mid , pos , outercc , call , ap , config ) and
4462
4464
callable = resolveCall ( call , outercc )
4463
4465
}
4464
4466
@@ -4467,9 +4469,9 @@ private module FlowExploration {
4467
4469
TSummaryCtx1 sc1 , TSummaryCtx2 sc2 , DataFlowCall call , PartialAccessPath ap ,
4468
4470
Configuration config
4469
4471
) {
4470
- exists ( int i , DataFlowCallable callable |
4471
- partialPathIntoCallable0 ( mid , callable , i , outercc , call , ap , config ) and
4472
- p .isParameterOf ( callable , i ) and
4472
+ exists ( ParameterPosition pos , DataFlowCallable callable |
4473
+ partialPathIntoCallable0 ( mid , callable , pos , outercc , call , ap , config ) and
4474
+ p .isParameterOf ( callable , pos ) and
4473
4475
sc1 = TSummaryCtx1Param ( p ) and
4474
4476
sc2 = TSummaryCtx2Some ( ap )
4475
4477
|
@@ -4633,22 +4635,23 @@ private module FlowExploration {
4633
4635
4634
4636
pragma [ nomagic]
4635
4637
private predicate revPartialPathFlowsThrough (
4636
- int pos , TRevSummaryCtx1Some sc1 , TRevSummaryCtx2Some sc2 , RevPartialAccessPath ap ,
4637
- Configuration config
4638
+ ArgumentPosition apos , TRevSummaryCtx1Some sc1 , TRevSummaryCtx2Some sc2 ,
4639
+ RevPartialAccessPath ap , Configuration config
4638
4640
) {
4639
- exists ( PartialPathNodeRev mid , ParamNodeEx p |
4641
+ exists ( PartialPathNodeRev mid , ParamNodeEx p , ParameterPosition ppos |
4640
4642
mid .getNodeEx ( ) = p and
4641
- p .getPosition ( ) = pos and
4643
+ p .getPosition ( ) = ppos and
4642
4644
sc1 = mid .getSummaryCtx1 ( ) and
4643
4645
sc2 = mid .getSummaryCtx2 ( ) and
4644
4646
ap = mid .getAp ( ) and
4645
- config = mid .getConfiguration ( )
4647
+ config = mid .getConfiguration ( ) and
4648
+ parameterMatch ( ppos , apos )
4646
4649
)
4647
4650
}
4648
4651
4649
4652
pragma [ nomagic]
4650
4653
private predicate revPartialPathThroughCallable0 (
4651
- DataFlowCall call , PartialPathNodeRev mid , int pos , RevPartialAccessPath ap ,
4654
+ DataFlowCall call , PartialPathNodeRev mid , ArgumentPosition pos , RevPartialAccessPath ap ,
4652
4655
Configuration config
4653
4656
) {
4654
4657
exists ( TRevSummaryCtx1Some sc1 , TRevSummaryCtx2Some sc2 |
@@ -4661,7 +4664,7 @@ private module FlowExploration {
4661
4664
private predicate revPartialPathThroughCallable (
4662
4665
PartialPathNodeRev mid , ArgNodeEx node , RevPartialAccessPath ap , Configuration config
4663
4666
) {
4664
- exists ( DataFlowCall call , int pos |
4667
+ exists ( DataFlowCall call , ArgumentPosition pos |
4665
4668
revPartialPathThroughCallable0 ( call , mid , pos , ap , config ) and
4666
4669
node .asNode ( ) .( ArgNode ) .argumentOf ( call , pos )
4667
4670
)
0 commit comments