@@ -3292,7 +3292,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3292
3292
exists ( AccessPathApprox apa0 |
3293
3293
Stage5:: parameterMayFlowThrough ( p , _) and
3294
3294
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 ( ) ) , _,
3296
3296
TAccessPathApproxSome ( apa ) , _, apa0 , _)
3297
3297
)
3298
3298
}
@@ -3486,8 +3486,18 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3486
3486
import LocalCallContext
3487
3487
}
3488
3488
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
+
3489
3499
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 ( )
3491
3501
}
3492
3502
3493
3503
private newtype TPathNode =
@@ -4071,9 +4081,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
4071
4081
state = mid .getState ( ) and
4072
4082
cc = mid .getCallContext ( ) and
4073
4083
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
4077
4085
t = mid .getType ( ) and
4078
4086
ap = mid .getAp ( ) and
4079
4087
summaryLabel = mid .getSummaryLabel ( )
@@ -4119,7 +4127,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
4119
4127
or
4120
4128
jumpStepEx ( mid .getNodeExOutgoing ( ) , node ) and
4121
4129
state = mid .getState ( ) and
4122
- cc instanceof CallContextAny and
4130
+ cc = callContextNone ( ) and
4123
4131
sc instanceof SummaryCtxNone and
4124
4132
t = mid .getType ( ) and
4125
4133
ap = mid .getAp ( ) and
@@ -4129,7 +4137,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
4129
4137
or
4130
4138
additionalJumpStep ( mid .getNodeExOutgoing ( ) , node , label ) and
4131
4139
state = mid .getState ( ) and
4132
- cc instanceof CallContextAny and
4140
+ cc = callContextNone ( ) and
4133
4141
sc instanceof SummaryCtxNone and
4134
4142
mid .getAp ( ) instanceof AccessPathNil and
4135
4143
t = node .getDataFlowType ( ) and
@@ -4138,7 +4146,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
4138
4146
summaryLabel = "-"
4139
4147
or
4140
4148
additionalJumpStateStep ( mid .getNodeExOutgoing ( ) , mid .getState ( ) , node , state ) and
4141
- cc instanceof CallContextAny and
4149
+ cc = callContextNone ( ) and
4142
4150
sc instanceof SummaryCtxNone and
4143
4151
mid .getAp ( ) instanceof AccessPathNil and
4144
4152
t = node .getDataFlowType ( ) and
@@ -4673,22 +4681,32 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
4673
4681
private predicate flagDisable ( ) { none ( ) }
4674
4682
4675
4683
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
4678
4686
4679
- predicate partialFlow = partialFlowFwd / 3 ;
4687
+ predicate partialFlow = F :: partialFlowFwd / 3 ;
4680
4688
}
4681
4689
4682
4690
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
4685
4693
4686
- predicate partialFlow = partialFlowRev / 3 ;
4694
+ predicate partialFlow = F :: partialFlowRev / 3 ;
4687
4695
}
4688
4696
4689
4697
private module FlowExploration<
4690
4698
explorationLimitSig / 0 explorationLimit, flag / 0 flagFwd, flag / 0 flagRev>
4691
4699
{
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
+
4692
4710
private predicate callableStep ( DataFlowCallable c1 , DataFlowCallable c2 ) {
4693
4711
exists ( NodeEx node1 , NodeEx node2 |
4694
4712
jumpStepEx ( node1 , node2 )
@@ -4859,7 +4877,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
4859
4877
) {
4860
4878
flagFwd ( ) and
4861
4879
sourceNode ( node , state ) and
4862
- cc instanceof CallContextAny and
4880
+ cc = callContextNone ( ) and
4863
4881
sc1 = TSummaryCtx1None ( ) and
4864
4882
sc2 = TSummaryCtx2None ( ) and
4865
4883
sc3 = TSummaryCtx3None ( ) and
@@ -5073,7 +5091,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5073
5091
5074
5092
predicate isSource ( ) {
5075
5093
sourceNode ( node , state ) and
5076
- cc instanceof CallContextAny and
5094
+ cc = callContextNone ( ) and
5077
5095
sc1 = TSummaryCtx1None ( ) and
5078
5096
sc2 = TSummaryCtx2None ( ) and
5079
5097
sc3 = TSummaryCtx3None ( ) and
@@ -5125,10 +5143,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5125
5143
TSummaryCtx2 sc2 , TSummaryCtx3 sc3 , TSummaryCtx4 sc4 , DataFlowType t , PartialAccessPath ap ,
5126
5144
boolean isStoreStep
5127
5145
) {
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
5132
5148
(
5133
5149
localFlowStepEx ( mid .getNodeEx ( ) , node , _) and
5134
5150
state = mid .getState ( ) and
@@ -5165,7 +5181,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5165
5181
or
5166
5182
jumpStepEx ( mid .getNodeEx ( ) , node ) and
5167
5183
state = mid .getState ( ) and
5168
- cc instanceof CallContextAny and
5184
+ cc = callContextNone ( ) and
5169
5185
sc1 = TSummaryCtx1None ( ) and
5170
5186
sc2 = TSummaryCtx2None ( ) and
5171
5187
sc3 = TSummaryCtx3None ( ) and
@@ -5176,7 +5192,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5176
5192
or
5177
5193
additionalJumpStep ( mid .getNodeEx ( ) , node , _) and
5178
5194
state = mid .getState ( ) and
5179
- cc instanceof CallContextAny and
5195
+ cc = callContextNone ( ) and
5180
5196
sc1 = TSummaryCtx1None ( ) and
5181
5197
sc2 = TSummaryCtx2None ( ) and
5182
5198
sc3 = TSummaryCtx3None ( ) and
@@ -5187,7 +5203,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5187
5203
isStoreStep = false
5188
5204
or
5189
5205
additionalJumpStateStep ( mid .getNodeEx ( ) , mid .getState ( ) , node , state ) and
5190
- cc instanceof CallContextAny and
5206
+ cc = callContextNone ( ) and
5191
5207
sc1 = TSummaryCtx1None ( ) and
5192
5208
sc2 = TSummaryCtx2None ( ) and
5193
5209
sc3 = TSummaryCtx3None ( ) and
0 commit comments