@@ -1565,7 +1565,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1565
1565
fwdFlowIn ( node , apa , state , cc , t , ap , allowsFlowThrough ) and
1566
1566
if allowsFlowThrough = true
1567
1567
then (
1568
- summaryCtx = TSummaryCtxSome ( node , t , ap )
1568
+ summaryCtx = TSummaryCtxSome ( node , state , t , ap )
1569
1569
) else (
1570
1570
summaryCtx = TSummaryCtxNone ( ) and
1571
1571
// When the call contexts of source and sink needs to match then there's
@@ -1592,7 +1592,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1592
1592
1593
1593
private newtype TSummaryCtx =
1594
1594
TSummaryCtxNone ( ) or
1595
- TSummaryCtxSome ( ParamNodeEx p , Typ t , Ap ap ) { fwdFlowIn ( p , _, _, _, t , ap , true ) }
1595
+ TSummaryCtxSome ( ParamNodeEx p , FlowState state , Typ t , Ap ap ) {
1596
+ fwdFlowIn ( p , _, state , _, t , ap , true )
1597
+ }
1596
1598
1597
1599
/**
1598
1600
* A context for generating flow summaries. This represents flow entry through
@@ -1616,10 +1618,11 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1616
1618
/** A summary context from which a flow summary can be generated. */
1617
1619
private class SummaryCtxSome extends SummaryCtx , TSummaryCtxSome {
1618
1620
private ParamNodeEx p ;
1621
+ private FlowState state ;
1619
1622
private Typ t ;
1620
1623
private Ap ap ;
1621
1624
1622
- SummaryCtxSome ( ) { this = TSummaryCtxSome ( p , t , ap ) }
1625
+ SummaryCtxSome ( ) { this = TSummaryCtxSome ( p , state , t , ap ) }
1623
1626
1624
1627
ParamNodeEx getParamNode ( ) { result = p }
1625
1628
@@ -2074,7 +2077,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2074
2077
fwdFlow ( pragma [ only_bind_into ] ( ret ) , state , ccc , summaryCtx , t , ap ,
2075
2078
pragma [ only_bind_into ] ( apa ) ) and
2076
2079
summaryCtx =
2077
- TSummaryCtxSome ( pragma [ only_bind_into ] ( p ) , _, pragma [ only_bind_into ] ( argAp ) ) and
2080
+ TSummaryCtxSome ( pragma [ only_bind_into ] ( p ) , _, _ , pragma [ only_bind_into ] ( argAp ) ) and
2078
2081
not outBarrier ( ret , state ) and
2079
2082
kind = ret .getKind ( ) and
2080
2083
parameterFlowThroughAllowed ( p , kind ) and
@@ -2110,9 +2113,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2110
2113
pragma [ nomagic]
2111
2114
private predicate fwdFlowIsEntered0 (
2112
2115
DataFlowCall call , ArgNodeEx arg , Cc cc , CcCall innerCc , SummaryCtx summaryCtx ,
2113
- ParamNodeEx p , Typ t , Ap ap
2116
+ ParamNodeEx p , FlowState state , Typ t , Ap ap
2114
2117
) {
2115
- FwdFlowIn< FwdFlowThroughRestriction > :: fwdFlowIn ( call , arg , _, p , _ , cc , innerCc ,
2118
+ FwdFlowIn< FwdFlowThroughRestriction > :: fwdFlowIn ( call , arg , _, p , state , cc , innerCc ,
2116
2119
summaryCtx , t , ap , _, _, true )
2117
2120
}
2118
2121
@@ -2125,9 +2128,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2125
2128
DataFlowCall call , ArgNodeEx arg , Cc cc , CcCall innerCc , SummaryCtx summaryCtx ,
2126
2129
SummaryCtxSome innerSummaryCtx
2127
2130
) {
2128
- exists ( ParamNodeEx p , Typ t , Ap ap |
2129
- fwdFlowIsEntered0 ( call , arg , cc , innerCc , summaryCtx , p , t , ap ) and
2130
- innerSummaryCtx = TSummaryCtxSome ( p , t , ap )
2131
+ exists ( ParamNodeEx p , FlowState state , Typ t , Ap ap |
2132
+ fwdFlowIsEntered0 ( call , arg , cc , innerCc , summaryCtx , p , state , t , ap ) and
2133
+ innerSummaryCtx = TSummaryCtxSome ( p , state , t , ap )
2131
2134
)
2132
2135
}
2133
2136
@@ -2160,7 +2163,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2160
2163
Ap argAp , ApApprox argApa , Ap ap
2161
2164
) {
2162
2165
exists ( DataFlowCall call , ApApprox apa , boolean allowsFieldFlow |
2163
- returnFlowsThrough0 ( call , state , ccc , ap , apa , ret , TSummaryCtxSome ( p , argT , argAp ) ,
2166
+ returnFlowsThrough0 ( call , state , ccc , ap , apa , ret , TSummaryCtxSome ( p , _ , argT , argAp ) ,
2164
2167
argApa ) and
2165
2168
flowThroughOutOfCall ( call , ccc , ret , _, allowsFieldFlow , argApa , apa ) and
2166
2169
pos = ret .getReturnPosition ( ) and
@@ -2522,7 +2525,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2522
2525
exists ( Ap ap0 |
2523
2526
parameterMayFlowThrough ( p , _) and
2524
2527
revFlow ( n , state , TReturnCtxMaybeFlowThrough ( _) , _, ap0 ) and
2525
- fwdFlow ( n , state , any ( CcCall ccc ) , TSummaryCtxSome ( p , _, ap ) , _, ap0 , _)
2528
+ fwdFlow ( n , state , any ( CcCall ccc ) , TSummaryCtxSome ( p , _, _ , ap ) , _, ap0 , _)
2526
2529
)
2527
2530
}
2528
2531
@@ -3114,8 +3117,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3114
3117
|
3115
3118
fwdFlowThroughStep0 ( call , arg , cc , state , ccc , summaryCtx , t , ap , apa , ret ,
3116
3119
innerSummaryCtx , innerArgApa ) and
3117
- innerSummaryCtx = TSummaryCtxSome ( p , innerArgT , innerArgAp ) and
3118
- revFlow ( arg , state0 , _, _, _) and
3120
+ innerSummaryCtx = TSummaryCtxSome ( p , state0 , innerArgT , innerArgAp ) and
3119
3121
pn1 = mkPathNode ( arg , state0 , cc , summaryCtx , innerArgT , innerArgAp ) and
3120
3122
pn2 = typeStrengthenToPathNode ( p , state0 , ccc , innerSummaryCtx , innerArgT , innerArgAp ) and
3121
3123
pn3 = mkPathNode ( ret , state , ccc , innerSummaryCtx , t , ap )
@@ -3244,7 +3246,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3244
3246
fwdFlowInStep ( arg , node , state , outercc , cc , outerSummaryCtx , t , ap , allowsFlowThrough ) and
3245
3247
label = "" and
3246
3248
if allowsFlowThrough = true
3247
- then summaryCtx = TSummaryCtxSome ( node , t , ap )
3249
+ then summaryCtx = TSummaryCtxSome ( node , state , t , ap )
3248
3250
else summaryCtx = TSummaryCtxNone ( )
3249
3251
)
3250
3252
or
0 commit comments