@@ -3292,7 +3292,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
32923292 exists ( AccessPathApprox apa0 |
32933293 Stage5:: parameterMayFlowThrough ( p , _) and
32943294 Stage5:: revFlow ( n , state , TReturnCtxMaybeFlowThrough ( _) , _, apa0 ) and
3295- Stage5:: fwdFlow ( n , state , any ( CallContextCall ccc ) , TParamNodeSome ( p .asNode ( ) ) , _,
3295+ Stage5:: fwdFlow ( n , state , any ( Stage5Param :: CcCall ccc ) , TParamNodeSome ( p .asNode ( ) ) , _,
32963296 TAccessPathApproxSome ( apa ) , _, apa0 , _)
32973297 )
32983298 }
@@ -3486,8 +3486,18 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
34863486 import LocalCallContext
34873487 }
34883488
3489+ private class CallContext = PrunedCallContextSensitivityStage5:: Cc ;
3490+
3491+ private class CallContextCall = PrunedCallContextSensitivityStage5:: CcCall ;
3492+
3493+ private class CallContextNoCall = PrunedCallContextSensitivityStage5:: CcNoCall ;
3494+
3495+ private predicate callContextNone = PrunedCallContextSensitivityStage5:: ccNone / 0 ;
3496+
3497+ private predicate callContextSomeCall = PrunedCallContextSensitivityStage5:: ccSomeCall / 0 ;
3498+
34893499 private predicate sourceCallCtx ( CallContext cc ) {
3490- if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
3500+ if hasSourceCallCtx ( ) then cc = callContextSomeCall ( ) else cc = callContextNone ( )
34913501 }
34923502
34933503 private newtype TPathNode =
@@ -4071,9 +4081,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
40714081 state = mid .getState ( ) and
40724082 cc = mid .getCallContext ( ) and
40734083 sc = mid .getSummaryCtx ( ) and
4074- localCC =
4075- getLocalCallContext ( pragma [ only_bind_into ] ( pragma [ only_bind_out ] ( cc ) ) ,
4076- midnode .getEnclosingCallable ( ) ) and
4084+ localCC = PrunedCallContextSensitivityStage5:: getLocalCc ( midnode .getEnclosingCallable ( ) , cc ) and
40774085 t = mid .getType ( ) and
40784086 ap = mid .getAp ( ) and
40794087 summaryLabel = mid .getSummaryLabel ( )
@@ -4119,7 +4127,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
41194127 or
41204128 jumpStepEx ( mid .getNodeExOutgoing ( ) , node ) and
41214129 state = mid .getState ( ) and
4122- cc instanceof CallContextAny and
4130+ cc = callContextNone ( ) and
41234131 sc instanceof SummaryCtxNone and
41244132 t = mid .getType ( ) and
41254133 ap = mid .getAp ( ) and
@@ -4129,7 +4137,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
41294137 or
41304138 additionalJumpStep ( mid .getNodeExOutgoing ( ) , node , label ) and
41314139 state = mid .getState ( ) and
4132- cc instanceof CallContextAny and
4140+ cc = callContextNone ( ) and
41334141 sc instanceof SummaryCtxNone and
41344142 mid .getAp ( ) instanceof AccessPathNil and
41354143 t = node .getDataFlowType ( ) and
@@ -4138,7 +4146,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
41384146 summaryLabel = "-"
41394147 or
41404148 additionalJumpStateStep ( mid .getNodeExOutgoing ( ) , mid .getState ( ) , node , state ) and
4141- cc instanceof CallContextAny and
4149+ cc = callContextNone ( ) and
41424150 sc instanceof SummaryCtxNone and
41434151 mid .getAp ( ) instanceof AccessPathNil and
41444152 t = node .getDataFlowType ( ) and
@@ -4673,22 +4681,32 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
46734681 private predicate flagDisable ( ) { none ( ) }
46744682
46754683 module FlowExplorationFwd< explorationLimitSig / 0 explorationLimit> {
4676- private import FlowExploration< explorationLimit / 0 , flagEnable / 0 , flagDisable / 0 >
4677- import Public
4684+ private import FlowExploration< explorationLimit / 0 , flagEnable / 0 , flagDisable / 0 > as F
4685+ import F :: Public
46784686
4679- predicate partialFlow = partialFlowFwd / 3 ;
4687+ predicate partialFlow = F :: partialFlowFwd / 3 ;
46804688 }
46814689
46824690 module FlowExplorationRev< explorationLimitSig / 0 explorationLimit> {
4683- private import FlowExploration< explorationLimit / 0 , flagDisable / 0 , flagEnable / 0 >
4684- import Public
4691+ private import FlowExploration< explorationLimit / 0 , flagDisable / 0 , flagEnable / 0 > as F
4692+ import F :: Public
46854693
4686- predicate partialFlow = partialFlowRev / 3 ;
4694+ predicate partialFlow = F :: partialFlowRev / 3 ;
46874695 }
46884696
46894697 private module FlowExploration<
46904698 explorationLimitSig / 0 explorationLimit, flag / 0 flagFwd, flag / 0 flagRev>
46914699 {
4700+ class CallContext = CachedCallContextSensitivity:: Cc ;
4701+
4702+ class CallContextCall = CachedCallContextSensitivity:: CcCall ;
4703+
4704+ class CallContextNoCall = CachedCallContextSensitivity:: CcNoCall ;
4705+
4706+ predicate callContextNone = CachedCallContextSensitivity:: ccNone / 0 ;
4707+
4708+ predicate callContextSomeCall = CachedCallContextSensitivity:: ccSomeCall / 0 ;
4709+
46924710 private predicate callableStep ( DataFlowCallable c1 , DataFlowCallable c2 ) {
46934711 exists ( NodeEx node1 , NodeEx node2 |
46944712 jumpStepEx ( node1 , node2 )
@@ -4859,7 +4877,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
48594877 ) {
48604878 flagFwd ( ) and
48614879 sourceNode ( node , state ) and
4862- cc instanceof CallContextAny and
4880+ cc = callContextNone ( ) and
48634881 sc1 = TSummaryCtx1None ( ) and
48644882 sc2 = TSummaryCtx2None ( ) and
48654883 sc3 = TSummaryCtx3None ( ) and
@@ -5073,7 +5091,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
50735091
50745092 predicate isSource ( ) {
50755093 sourceNode ( node , state ) and
5076- cc instanceof CallContextAny and
5094+ cc = callContextNone ( ) and
50775095 sc1 = TSummaryCtx1None ( ) and
50785096 sc2 = TSummaryCtx2None ( ) and
50795097 sc3 = TSummaryCtx3None ( ) and
@@ -5125,10 +5143,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
51255143 TSummaryCtx2 sc2 , TSummaryCtx3 sc3 , TSummaryCtx4 sc4 , DataFlowType t , PartialAccessPath ap ,
51265144 boolean isStoreStep
51275145 ) {
5128- not exists ( NodeRegion nr |
5129- nr .contains ( node .asNode ( ) ) and
5130- isUnreachableInCallCached ( nr , cc .( CallContextSpecificCall ) .getCall ( ) )
5131- ) and
5146+ not isUnreachableInCall1 ( node ,
5147+ CachedCallContextSensitivity:: LocalCallContext:: getLocalCc ( node .getEnclosingCallable ( ) , cc ) ) and
51325148 (
51335149 localFlowStepEx ( mid .getNodeEx ( ) , node , _) and
51345150 state = mid .getState ( ) and
@@ -5165,7 +5181,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
51655181 or
51665182 jumpStepEx ( mid .getNodeEx ( ) , node ) and
51675183 state = mid .getState ( ) and
5168- cc instanceof CallContextAny and
5184+ cc = callContextNone ( ) and
51695185 sc1 = TSummaryCtx1None ( ) and
51705186 sc2 = TSummaryCtx2None ( ) and
51715187 sc3 = TSummaryCtx3None ( ) and
@@ -5176,7 +5192,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
51765192 or
51775193 additionalJumpStep ( mid .getNodeEx ( ) , node , _) and
51785194 state = mid .getState ( ) and
5179- cc instanceof CallContextAny and
5195+ cc = callContextNone ( ) and
51805196 sc1 = TSummaryCtx1None ( ) and
51815197 sc2 = TSummaryCtx2None ( ) and
51825198 sc3 = TSummaryCtx3None ( ) and
@@ -5187,7 +5203,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
51875203 isStoreStep = false
51885204 or
51895205 additionalJumpStateStep ( mid .getNodeEx ( ) , mid .getState ( ) , node , state ) and
5190- cc instanceof CallContextAny and
5206+ cc = callContextNone ( ) and
51915207 sc1 = TSummaryCtx1None ( ) and
51925208 sc2 = TSummaryCtx2None ( ) and
51935209 sc3 = TSummaryCtx3None ( ) and
0 commit comments