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