@@ -1369,6 +1369,12 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
13691369
13701370 CcCall ccSomeCall ( ) ;
13711371
1372+ predicate instanceofCc ( Cc cc ) ;
1373+
1374+ predicate instanceofCcCall ( CcCall cc ) ;
1375+
1376+ predicate instanceofCcNoCall ( CcNoCall cc ) ;
1377+
13721378 class LocalCc ;
13731379
13741380 DataFlowCallable viableImplCallContextReduced ( DataFlowCall call , CcCall ctx ) ;
@@ -1386,8 +1392,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
13861392 bindingset [ call, c]
13871393 CcNoCall getCallContextReturn ( DataFlowCallable c , DataFlowCall call ) ;
13881394
1389- bindingset [ c , cc]
1390- LocalCc getLocalCc ( DataFlowCallable c , Cc cc ) ;
1395+ bindingset [ cc]
1396+ LocalCc getLocalCc ( Cc cc ) ;
13911397
13921398 bindingset [ node1, state1]
13931399 bindingset [ node2, state2]
@@ -1476,7 +1482,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
14761482 or
14771483 exists ( NodeEx mid , FlowState state0 , Typ t0 , LocalCc localCc |
14781484 fwdFlow ( mid , state0 , cc , summaryCtx , argT , argAp , t0 , ap , apa ) and
1479- localCc = getLocalCc ( mid . getEnclosingCallable ( ) , cc )
1485+ localCc = getLocalCc ( cc )
14801486 |
14811487 localStep ( mid , state0 , node , state , true , _, localCc ) and
14821488 t = t0
@@ -1613,7 +1619,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
16131619 ApOption argAp , Typ t , Ap ap , boolean emptyAp , ApApprox apa , boolean cc
16141620 ) {
16151621 fwdFlow ( arg , state , outercc , summaryCtx , argT , argAp , t , ap , apa ) and
1616- ( if outercc instanceof CcCall then cc = true else cc = false ) and
1622+ ( if instanceofCcCall ( outercc ) then cc = true else cc = false ) and
16171623 if ap instanceof ApNil then emptyAp = true else emptyAp = false
16181624 }
16191625
@@ -1669,6 +1675,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
16691675 DataFlowCall call , ArgNodeEx arg , CcCall ctx
16701676 ) {
16711677 callEdgeArgParamRestricted ( call , _, arg , _, _, _) and
1678+ instanceofCcCall ( ctx ) and
16721679 result = viableImplCallContextReducedInlineLate ( call , ctx )
16731680 }
16741681
@@ -1684,6 +1691,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
16841691 bindingset [ call, ctx]
16851692 pragma [ inline_late]
16861693 private predicate viableImplNotCallContextReducedInlineLate ( DataFlowCall call , Cc ctx ) {
1694+ instanceofCc ( ctx ) and
16871695 viableImplNotCallContextReduced ( call , ctx )
16881696 }
16891697
@@ -1693,6 +1701,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
16931701 DataFlowCall call , ArgNodeEx arg , Cc outercc
16941702 ) {
16951703 callEdgeArgParamRestricted ( call , _, arg , _, _, _) and
1704+ instanceofCc ( outercc ) and
16961705 viableImplNotCallContextReducedInlineLate ( call , outercc )
16971706 }
16981707
@@ -1837,6 +1846,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
18371846 RetNodeEx ret , FlowState state , CcNoCall cc , ParamNodeOption summaryCtx , TypOption argT ,
18381847 ApOption argAp , Typ t , Ap ap , ApApprox apa
18391848 ) {
1849+ instanceofCcNoCall ( cc ) and
18401850 fwdFlow ( ret , state , cc , summaryCtx , argT , argAp , t , ap , apa )
18411851 }
18421852
@@ -1896,6 +1906,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
18961906
18971907 pragma [ nomagic]
18981908 private predicate fwdFlow1Param ( ParamNodeEx p , FlowState state , CcCall cc , Typ t0 , Ap ap ) {
1909+ instanceofCcCall ( cc ) and
18991910 fwdFlow1 ( p , state , cc , _, _, _, t0 , _, ap , _)
19001911 }
19011912
@@ -1962,6 +1973,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
19621973 ApApprox argApa , Typ t , Ap ap , ApApprox apa
19631974 ) {
19641975 exists ( ReturnKindExt kind |
1976+ instanceofCcCall ( ccc ) and
19651977 fwdFlow ( pragma [ only_bind_into ] ( ret ) , state , ccc ,
19661978 TParamNodeSome ( pragma [ only_bind_into ] ( summaryCtx .asNode ( ) ) ) , TypOption:: some ( argT ) ,
19671979 pragma [ only_bind_into ] ( apSome ( argAp ) ) , t , ap , pragma [ only_bind_into ] ( apa ) ) and
@@ -2527,10 +2539,16 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
25272539
25282540 CcCall ccSomeCall ( ) { result = true }
25292541
2542+ predicate instanceofCc ( Cc cc ) { any ( ) }
2543+
2544+ predicate instanceofCcCall ( CcCall cc ) { any ( ) }
2545+
2546+ predicate instanceofCcNoCall ( CcNoCall cc ) { any ( ) }
2547+
25302548 class LocalCc = Unit ;
25312549
2532- bindingset [ c , cc]
2533- LocalCc getLocalCc ( DataFlowCallable c , Cc cc ) { any ( ) }
2550+ bindingset [ cc]
2551+ LocalCc getLocalCc ( Cc cc ) { any ( ) }
25342552
25352553 DataFlowCallable viableImplCallContextReduced ( DataFlowCall call , CcCall ctx ) { none ( ) }
25362554
@@ -4081,7 +4099,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
40814099 state = mid .getState ( ) and
40824100 cc = mid .getCallContext ( ) and
40834101 sc = mid .getSummaryCtx ( ) and
4084- localCC = PrunedCallContextSensitivityStage5:: getLocalCc ( midnode . getEnclosingCallable ( ) , cc ) and
4102+ localCC = PrunedCallContextSensitivityStage5:: getLocalCc ( cc ) and
40854103 t = mid .getType ( ) and
40864104 ap = mid .getAp ( ) and
40874105 summaryLabel = mid .getSummaryLabel ( )
@@ -5144,7 +5162,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
51445162 boolean isStoreStep
51455163 ) {
51465164 not isUnreachableInCall1 ( node ,
5147- CachedCallContextSensitivity:: LocalCallContext:: getLocalCc ( node . getEnclosingCallable ( ) , cc ) ) and
5165+ CachedCallContextSensitivity:: LocalCallContext:: getLocalCc ( cc ) ) and
51485166 (
51495167 localFlowStepEx ( mid .getNodeEx ( ) , node , _) and
51505168 state = mid .getState ( ) and
0 commit comments