@@ -1111,10 +1111,11 @@ private predicate flowOutOfCallNodeCand1(
1111
1111
DataFlowCall call , RetNodeEx ret , NodeEx out , boolean allowsFieldFlow , Configuration config
1112
1112
) {
1113
1113
flowOutOfCallNodeCand1 ( call , ret , out , config ) and
1114
- exists ( int b , int j |
1115
- b = branch ( ret , config ) and
1114
+ exists ( int j | // int b,
1115
+ // b = branch(ret, config) and
1116
1116
j = join ( out , config ) and
1117
- if b .minimum ( j ) <= config .fieldFlowBranchLimit ( )
1117
+ // if b.minimum(j) <= config.fieldFlowBranchLimit()
1118
+ if j <= config .fieldFlowBranchLimit ( )
1118
1119
then allowsFieldFlow = true
1119
1120
else allowsFieldFlow = false
1120
1121
)
@@ -1130,10 +1131,11 @@ private predicate flowIntoCallNodeCand1(
1130
1131
DataFlowCall call , ArgNodeEx arg , ParamNodeEx p , boolean allowsFieldFlow , Configuration config
1131
1132
) {
1132
1133
flowIntoCallNodeCand1 ( call , arg , p , config ) and
1133
- exists ( int b , int j |
1134
+ exists ( int b | // , int j |
1134
1135
b = branch ( arg , config ) and
1135
- j = join ( p , config ) and
1136
- if b .minimum ( j ) <= config .fieldFlowBranchLimit ( )
1136
+ // j = join(p, config) and
1137
+ // if b.minimum(j) <= config.fieldFlowBranchLimit()
1138
+ if b <= config .fieldFlowBranchLimit ( )
1137
1139
then allowsFieldFlow = true
1138
1140
else allowsFieldFlow = false
1139
1141
)
@@ -1383,8 +1385,9 @@ private module MkStage<StageSig PrevStage> {
1383
1385
exists ( ArgNodeEx arg , boolean allowsFieldFlow |
1384
1386
fwdFlow ( arg , state , outercc , argAp , ap , config ) and
1385
1387
flowIntoCall ( call , arg , p , allowsFieldFlow , config ) and
1386
- innercc = getCallContextCall ( call , p .getEnclosingCallable ( ) , outercc ) and
1387
- if allowsFieldFlow = false then ap instanceof ApNil else any ( )
1388
+ innercc = getCallContextCall ( call , p .getEnclosingCallable ( ) , outercc )
1389
+ // and
1390
+ // if allowsFieldFlow = false then ap instanceof ApNil else any()
1388
1391
)
1389
1392
}
1390
1393
@@ -1399,8 +1402,9 @@ private module MkStage<StageSig PrevStage> {
1399
1402
fwdFlow ( ret , state , innercc , argAp , ap , config ) and
1400
1403
flowOutOfCall ( call , ret , out , allowsFieldFlow , config ) and
1401
1404
inner = ret .getEnclosingCallable ( ) and
1402
- ccOut = getCallContextReturn ( inner , call , innercc ) and
1403
- if allowsFieldFlow = false then ap instanceof ApNil else any ( )
1405
+ ccOut = getCallContextReturn ( inner , call , innercc )
1406
+ // and
1407
+ // if allowsFieldFlow = false then ap instanceof ApNil else any()
1404
1408
)
1405
1409
}
1406
1410
@@ -1411,7 +1415,7 @@ private module MkStage<StageSig PrevStage> {
1411
1415
exists ( RetNodeEx ret , boolean allowsFieldFlow , CcCall ccc |
1412
1416
fwdFlow ( ret , state , ccc , apSome ( argAp ) , ap , config ) and
1413
1417
flowThroughOutOfCall ( call , ccc , ret , out , allowsFieldFlow , config ) and
1414
- if allowsFieldFlow = false then ap instanceof ApNil else any ( )
1418
+ if allowsFieldFlow = false then ap instanceof ApNil and argAp instanceof ApNil else any ( )
1415
1419
)
1416
1420
}
1417
1421
@@ -1597,8 +1601,9 @@ private module MkStage<StageSig PrevStage> {
1597
1601
) {
1598
1602
exists ( NodeEx out , boolean allowsFieldFlow |
1599
1603
revFlow ( out , state , toReturn , returnAp , ap , config ) and
1600
- flowOutOfCall ( call , ret , out , allowsFieldFlow , config ) and
1601
- if allowsFieldFlow = false then ap instanceof ApNil else any ( )
1604
+ flowOutOfCall ( call , ret , out , allowsFieldFlow , config )
1605
+ // and
1606
+ // if allowsFieldFlow = false then ap instanceof ApNil else any()
1602
1607
)
1603
1608
}
1604
1609
@@ -1608,8 +1613,9 @@ private module MkStage<StageSig PrevStage> {
1608
1613
) {
1609
1614
exists ( ParamNodeEx p , boolean allowsFieldFlow |
1610
1615
revFlow ( p , state , false , returnAp , ap , config ) and
1611
- flowIntoCall ( _, arg , p , allowsFieldFlow , config ) and
1612
- if allowsFieldFlow = false then ap instanceof ApNil else any ( )
1616
+ flowIntoCall ( _, arg , p , allowsFieldFlow , config )
1617
+ // and
1618
+ // if allowsFieldFlow = false then ap instanceof ApNil else any()
1613
1619
)
1614
1620
}
1615
1621
@@ -1620,7 +1626,7 @@ private module MkStage<StageSig PrevStage> {
1620
1626
exists ( ParamNodeEx p , boolean allowsFieldFlow |
1621
1627
revFlow ( p , state , true , apSome ( returnAp ) , ap , config ) and
1622
1628
flowThroughIntoCall ( call , arg , p , allowsFieldFlow , config ) and
1623
- if allowsFieldFlow = false then ap instanceof ApNil else any ( )
1629
+ if allowsFieldFlow = false then ap instanceof ApNil and returnAp instanceof ApNil else any ( )
1624
1630
)
1625
1631
}
1626
1632
0 commit comments