@@ -1479,26 +1479,27 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1479
1479
*/
1480
1480
pragma [ nomagic]
1481
1481
additional predicate fwdFlow (
1482
- NodeEx node , FlowState state , Cc cc , SummaryCtx summaryCtx , Typ t , Ap ap , ApApprox apa ,
1483
- TypOption stored
1482
+ NodeEx node , FlowState state , Cc cc , SummaryCtx summaryCtx , Typ t , Ap ap , TypOption stored
1484
1483
) {
1485
- fwdFlow1 ( node , state , cc , summaryCtx , _, t , ap , apa , stored )
1484
+ fwdFlow1 ( node , state , cc , summaryCtx , _, t , ap , stored )
1486
1485
}
1487
1486
1488
1487
private predicate fwdFlow1 (
1489
1488
NodeEx node , FlowState state , Cc cc , SummaryCtx summaryCtx , Typ t0 , Typ t , Ap ap ,
1490
- ApApprox apa , TypOption stored
1489
+ TypOption stored
1491
1490
) {
1492
- fwdFlow0 ( node , state , cc , summaryCtx , t0 , ap , apa , stored ) and
1493
- PrevStage:: revFlow ( node , state , apa ) and
1494
- filter ( node , state , t0 , ap , t ) and
1495
- (
1496
- if node instanceof CastingNodeEx
1497
- then
1498
- ap instanceof ApNil or
1499
- compatibleContainer ( getHeadContent ( ap ) , node .getDataFlowType ( ) ) or
1500
- topTypeContent ( getHeadContent ( ap ) )
1501
- else any ( )
1491
+ exists ( ApApprox apa |
1492
+ fwdFlow0 ( node , state , cc , summaryCtx , t0 , ap , apa , stored ) and
1493
+ PrevStage:: revFlow ( node , state , apa ) and
1494
+ filter ( node , state , t0 , ap , t ) and
1495
+ (
1496
+ if node instanceof CastingNodeEx
1497
+ then
1498
+ ap instanceof ApNil or
1499
+ compatibleContainer ( getHeadContent ( ap ) , node .getDataFlowType ( ) ) or
1500
+ topTypeContent ( getHeadContent ( ap ) )
1501
+ else any ( )
1502
+ )
1502
1503
)
1503
1504
}
1504
1505
@@ -1516,7 +1517,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1516
1517
stored .isNone ( )
1517
1518
or
1518
1519
exists ( NodeEx mid , FlowState state0 , Typ t0 , LocalCc localCc |
1519
- fwdFlow ( mid , state0 , cc , summaryCtx , t0 , ap , apa , stored ) and
1520
+ fwdFlow ( mid , state0 , cc , summaryCtx , t0 , ap , stored ) and
1521
+ apa = getApprox ( ap ) and
1520
1522
localCc = getLocalCc ( cc )
1521
1523
|
1522
1524
localStep ( mid , state0 , node , state , true , _, localCc , _) and
@@ -1526,7 +1528,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1526
1528
ap instanceof ApNil
1527
1529
)
1528
1530
or
1529
- fwdFlowJump ( node , state , t , ap , apa , stored ) and
1531
+ fwdFlowJump ( node , state , t , ap , stored ) and
1532
+ apa = getApprox ( ap ) and
1530
1533
cc = ccNone ( ) and
1531
1534
summaryCtx = TSummaryCtxNone ( )
1532
1535
or
@@ -1615,23 +1618,21 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1615
1618
override Location getLocation ( ) { result = p .getLocation ( ) }
1616
1619
}
1617
1620
1618
- private predicate fwdFlowJump (
1619
- NodeEx node , FlowState state , Typ t , Ap ap , ApApprox apa , TypOption stored
1620
- ) {
1621
+ private predicate fwdFlowJump ( NodeEx node , FlowState state , Typ t , Ap ap , TypOption stored ) {
1621
1622
exists ( NodeEx mid |
1622
- fwdFlow ( mid , state , _, _, t , ap , apa , stored ) and
1623
+ fwdFlow ( mid , state , _, _, t , ap , stored ) and
1623
1624
jumpStepEx ( mid , node )
1624
1625
)
1625
1626
or
1626
1627
exists ( NodeEx mid |
1627
- fwdFlow ( mid , state , _, _, _, ap , apa , stored ) and
1628
+ fwdFlow ( mid , state , _, _, _, ap , stored ) and
1628
1629
additionalJumpStep ( mid , node , _) and
1629
1630
t = getNodeTyp ( node ) and
1630
1631
ap instanceof ApNil
1631
1632
)
1632
1633
or
1633
1634
exists ( NodeEx mid , FlowState state0 |
1634
- fwdFlow ( mid , state0 , _, _, _, ap , apa , stored ) and
1635
+ fwdFlow ( mid , state0 , _, _, _, ap , stored ) and
1635
1636
additionalJumpStateStep ( mid , state0 , node , state , _) and
1636
1637
t = getNodeTyp ( node ) and
1637
1638
ap instanceof ApNil
@@ -1644,7 +1645,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1644
1645
NodeEx node2 , FlowState state , Cc cc , SummaryCtx summaryCtx
1645
1646
) {
1646
1647
exists ( DataFlowType contentType , DataFlowType containerType |
1647
- fwdFlow ( node1 , state , cc , summaryCtx , t1 , ap1 , _ , stored1 ) and
1648
+ fwdFlow ( node1 , state , cc , summaryCtx , t1 , ap1 , stored1 ) and
1648
1649
not outBarrier ( node1 , state ) and
1649
1650
not inBarrier ( node2 , state ) and
1650
1651
PrevStage:: storeStepCand ( node1 , c , node2 , contentType , containerType ) and
@@ -1685,7 +1686,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1685
1686
Cc cc , SummaryCtx summaryCtx
1686
1687
) {
1687
1688
exists ( ApHeadContent apc |
1688
- fwdFlow ( node1 , state , cc , summaryCtx , t , ap , _ , stored ) and
1689
+ fwdFlow ( node1 , state , cc , summaryCtx , t , ap , stored ) and
1689
1690
not outBarrier ( node1 , state ) and
1690
1691
not inBarrier ( node2 , state ) and
1691
1692
apc = getHeadContent ( ap ) and
@@ -1716,7 +1717,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1716
1717
ArgNodeEx arg , FlowState state , Cc outercc , SummaryCtx summaryCtx , Typ t , Ap ap ,
1717
1718
boolean emptyAp , TypOption stored , boolean cc
1718
1719
) {
1719
- fwdFlow ( arg , state , outercc , summaryCtx , t , ap , _ , stored ) and
1720
+ fwdFlow ( arg , state , outercc , summaryCtx , t , ap , stored ) and
1720
1721
( if instanceofCcCall ( outercc ) then cc = true else cc = false ) and
1721
1722
if ap instanceof ApNil then emptyAp = true else emptyAp = false
1722
1723
}
@@ -1940,7 +1941,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1940
1941
) {
1941
1942
instanceofCcNoCall ( cc ) and
1942
1943
not outBarrier ( ret , state ) and
1943
- fwdFlow ( ret , state , cc , summaryCtx , t , ap , _ , stored )
1944
+ fwdFlow ( ret , state , cc , summaryCtx , t , ap , stored )
1944
1945
}
1945
1946
1946
1947
pragma [ nomagic]
@@ -2003,7 +2004,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2003
2004
ParamNodeEx p , FlowState state , CcCall cc , Typ t0 , Ap ap , TypOption stored
2004
2005
) {
2005
2006
instanceofCcCall ( cc ) and
2006
- fwdFlow1 ( p , state , cc , _, t0 , _, ap , _ , stored )
2007
+ fwdFlow1 ( p , state , cc , _, t0 , _, ap , stored )
2007
2008
}
2008
2009
2009
2010
pragma [ nomagic]
@@ -2026,7 +2027,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2026
2027
private predicate fwdFlow1Out (
2027
2028
NodeEx node , FlowState state , Cc cc , Typ t0 , Ap ap , TypOption stored
2028
2029
) {
2029
- fwdFlow1 ( node , state , cc , _, t0 , _, ap , _ , stored ) and
2030
+ fwdFlow1 ( node , state , cc , _, t0 , _, ap , stored ) and
2030
2031
PrevStage:: callEdgeReturn ( _, _, _, _, node , _)
2031
2032
}
2032
2033
@@ -2048,7 +2049,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2048
2049
or
2049
2050
exists ( NodeEx node |
2050
2051
cc = false and
2051
- fwdFlowJump ( node , _, _, _, _, _ ) and
2052
+ fwdFlowJump ( node , _, _, _, _) and
2052
2053
c = node .getEnclosingCallable ( )
2053
2054
)
2054
2055
}
@@ -2070,7 +2071,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2070
2071
) {
2071
2072
exists ( ReturnKindExt kind , ParamNodeEx p , Ap argAp |
2072
2073
instanceofCcCall ( ccc ) and
2073
- fwdFlow ( pragma [ only_bind_into ] ( ret ) , state , ccc , summaryCtx , t , ap , _ , stored ) and
2074
+ fwdFlow ( pragma [ only_bind_into ] ( ret ) , state , ccc , summaryCtx , t , ap , stored ) and
2074
2075
summaryCtx =
2075
2076
TSummaryCtxSome ( pragma [ only_bind_into ] ( p ) , _, _, pragma [ only_bind_into ] ( argAp ) , _) and
2076
2077
not outBarrier ( ret , state ) and
@@ -2164,7 +2165,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2164
2165
returnFlowsThrough ( _, _, _, _, pragma [ only_bind_into ] ( p ) , pragma [ only_bind_into ] ( argT ) ,
2165
2166
pragma [ only_bind_into ] ( argAp ) , pragma [ only_bind_into ] ( argStored ) , ap ) and
2166
2167
flowIntoCallApaTaken ( call , _, pragma [ only_bind_into ] ( arg ) , p , emptyArgAp ) and
2167
- fwdFlow ( arg , _, _, _, pragma [ only_bind_into ] ( argT ) , pragma [ only_bind_into ] ( argAp ) , _ ,
2168
+ fwdFlow ( arg , _, _, _, pragma [ only_bind_into ] ( argT ) , pragma [ only_bind_into ] ( argAp ) ,
2168
2169
pragma [ only_bind_into ] ( argStored ) ) and
2169
2170
if argAp instanceof ApNil then emptyArgAp = true else emptyArgAp = false
2170
2171
)
@@ -2176,7 +2177,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2176
2177
) {
2177
2178
exists ( boolean emptyAp |
2178
2179
flowIntoCallApaTaken ( call , c , arg , p , emptyAp ) and
2179
- fwdFlow ( arg , _, _, _, _, ap , _, _ ) and
2180
+ fwdFlow ( arg , _, _, _, _, ap , _) and
2180
2181
if ap instanceof ApNil then emptyAp = true else emptyAp = false
2181
2182
)
2182
2183
}
@@ -2187,7 +2188,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2187
2188
Ap ap , boolean allowsFieldFlow
2188
2189
) {
2189
2190
PrevStage:: callEdgeReturn ( call , c , ret , _, out , allowsFieldFlow ) and
2190
- fwdFlow ( ret , _, _, _, _, ap , _, _ ) and
2191
+ fwdFlow ( ret , _, _, _, _, ap , _) and
2191
2192
pos = ret .getReturnPosition ( ) and
2192
2193
( if allowsFieldFlow = false then ap instanceof ApNil else any ( ) ) and
2193
2194
(
@@ -2210,14 +2211,14 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2210
2211
NodeEx node , FlowState state , ReturnCtx returnCtx , ApOption returnAp , Ap ap
2211
2212
) {
2212
2213
revFlow0 ( node , state , returnCtx , returnAp , ap ) and
2213
- fwdFlow ( node , state , _, _, _, ap , _, _ )
2214
+ fwdFlow ( node , state , _, _, _, ap , _)
2214
2215
}
2215
2216
2216
2217
pragma [ nomagic]
2217
2218
private predicate revFlow0 (
2218
2219
NodeEx node , FlowState state , ReturnCtx returnCtx , ApOption returnAp , Ap ap
2219
2220
) {
2220
- fwdFlow ( node , state , _, _, _, ap , _, _ ) and
2221
+ fwdFlow ( node , state , _, _, _, ap , _) and
2221
2222
sinkNode ( node , state ) and
2222
2223
(
2223
2224
if hasSinkCallCtx ( )
@@ -2345,7 +2346,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2345
2346
2346
2347
predicate dataFlowNonCallEntry ( DataFlowCallable c , boolean cc ) {
2347
2348
exists ( NodeEx node , FlowState state , ApNil nil |
2348
- fwdFlow ( node , state , _, _, _, nil , _, _ ) and
2349
+ fwdFlow ( node , state , _, _, _, nil , _) and
2349
2350
sinkNode ( node , state ) and
2350
2351
( if hasSinkCallCtx ( ) then cc = true else cc = false ) and
2351
2352
c = node .getEnclosingCallable ( )
@@ -2520,7 +2521,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2520
2521
exists ( Ap ap0 |
2521
2522
parameterMayFlowThrough ( p , _) and
2522
2523
revFlow ( n , state , TReturnCtxMaybeFlowThrough ( _) , _, ap0 ) and
2523
- fwdFlow ( n , state , any ( CcCall ccc ) , TSummaryCtxSome ( p , _, _, ap , _) , _, ap0 , _, _ )
2524
+ fwdFlow ( n , state , any ( CcCall ccc ) , TSummaryCtxSome ( p , _, _, ap , _) , _, ap0 , _)
2524
2525
)
2525
2526
}
2526
2527
@@ -2812,7 +2813,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2812
2813
NodeEx node , FlowState state , Cc cc , SummaryCtx summaryCtx , Typ t , Ap ap ,
2813
2814
TypOption stored
2814
2815
) {
2815
- fwdFlow ( node , state , cc , summaryCtx , t , ap , _ , stored ) and
2816
+ fwdFlow ( node , state , cc , summaryCtx , t , ap , stored ) and
2816
2817
revFlow ( node , state , _, _, ap )
2817
2818
} or
2818
2819
TPathNodeSink ( NodeEx node , FlowState state ) {
@@ -3148,7 +3149,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3148
3149
TypOption stored
3149
3150
) {
3150
3151
exists ( Typ t |
3151
- fwdFlow1 ( node , state , cc , summaryCtx , t0 , t , ap , _ , stored ) and
3152
+ fwdFlow1 ( node , state , cc , summaryCtx , t0 , t , ap , stored ) and
3152
3153
result = TPathNodeMid ( node , state , cc , summaryCtx , t , ap , stored )
3153
3154
)
3154
3155
}
@@ -3598,13 +3599,13 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3598
3599
int tfnodes , int tftuples
3599
3600
) {
3600
3601
fwd = true and
3601
- nodes = count ( NodeEx node | fwdFlow ( node , _, _, _, _, _, _, _ ) ) and
3602
+ nodes = count ( NodeEx node | fwdFlow ( node , _, _, _, _, _, _) ) and
3602
3603
fields = count ( Content f0 | fwdConsCand ( f0 , _) ) and
3603
3604
conscand = count ( Content f0 , Ap ap | fwdConsCand ( f0 , ap ) ) and
3604
- states = count ( FlowState state | fwdFlow ( _, state , _, _, _, _, _, _ ) ) and
3605
+ states = count ( FlowState state | fwdFlow ( _, state , _, _, _, _, _) ) and
3605
3606
tuples =
3606
3607
count ( NodeEx n , FlowState state , Cc cc , SummaryCtx summaryCtx , Typ t , Ap ap ,
3607
- TypOption stored | fwdFlow ( n , state , cc , summaryCtx , t , ap , _ , stored ) ) and
3608
+ TypOption stored | fwdFlow ( n , state , cc , summaryCtx , t , ap , stored ) ) and
3608
3609
calledges =
3609
3610
count ( DataFlowCall call , DataFlowCallable c |
3610
3611
FwdTypeFlowInput:: dataFlowTakenCallEdgeIn ( call , c , _) or
0 commit comments