@@ -230,6 +230,7 @@ module MakeImpl<InputSig Lang> {
230
230
)
231
231
}
232
232
233
+ pragma [ nomagic]
233
234
private predicate inBarrier ( NodeEx node , FlowState state ) {
234
235
exists ( Node n |
235
236
node .asNode ( ) = n and
@@ -249,6 +250,7 @@ module MakeImpl<InputSig Lang> {
249
250
)
250
251
}
251
252
253
+ pragma [ nomagic]
252
254
private predicate outBarrier ( NodeEx node , FlowState state ) {
253
255
exists ( Node n |
254
256
node .asNode ( ) = n and
@@ -2518,6 +2520,7 @@ module MakeImpl<InputSig Lang> {
2518
2520
LocalCallContext cc
2519
2521
) {
2520
2522
not isUnreachableInCall1 ( node2 , cc ) and
2523
+ not inBarrier ( node2 , state ) and
2521
2524
(
2522
2525
localFlowEntry ( node1 , pragma [ only_bind_into ] ( state ) ) and
2523
2526
(
@@ -2532,18 +2535,21 @@ module MakeImpl<InputSig Lang> {
2532
2535
) and
2533
2536
node1 != node2 and
2534
2537
cc .relevantFor ( node1 .getEnclosingCallable ( ) ) and
2535
- not isUnreachableInCall1 ( node1 , cc )
2538
+ not isUnreachableInCall1 ( node1 , cc ) and
2539
+ not outBarrier ( node1 , state )
2536
2540
or
2537
2541
exists ( NodeEx mid |
2538
2542
localFlowStepPlus ( node1 , pragma [ only_bind_into ] ( state ) , mid , preservesValue , t , cc ) and
2539
2543
localFlowStepNodeCand1 ( mid , node2 ) and
2544
+ not outBarrier ( mid , state ) and
2540
2545
not mid instanceof FlowCheckNode and
2541
2546
Stage2:: revFlow ( node2 , pragma [ only_bind_into ] ( state ) )
2542
2547
)
2543
2548
or
2544
2549
exists ( NodeEx mid |
2545
2550
localFlowStepPlus ( node1 , state , mid , _, _, cc ) and
2546
2551
additionalLocalFlowStepNodeCand2 ( mid , state , node2 , state ) and
2552
+ not outBarrier ( mid , state ) and
2547
2553
not mid instanceof FlowCheckNode and
2548
2554
preservesValue = false and
2549
2555
t = node2 .getDataFlowType ( )
@@ -3610,11 +3616,14 @@ module MakeImpl<InputSig Lang> {
3610
3616
}
3611
3617
3612
3618
override PathNodeImpl getASuccessorImpl ( ) {
3613
- // an intermediate step to another intermediate node
3614
- result = this .getSuccMid ( )
3615
- or
3616
- // a final step to a sink
3617
- result = this .getSuccMid ( ) .projectToSink ( )
3619
+ not outBarrier ( node , state ) and
3620
+ (
3621
+ // an intermediate step to another intermediate node
3622
+ result = this .getSuccMid ( )
3623
+ or
3624
+ // a final step to a sink
3625
+ result = this .getSuccMid ( ) .projectToSink ( )
3626
+ )
3618
3627
}
3619
3628
3620
3629
override predicate isSource ( ) {
@@ -3740,7 +3749,8 @@ module MakeImpl<InputSig Lang> {
3740
3749
exists ( DataFlowType t0 |
3741
3750
pathStep0 ( mid , node , state , cc , sc , t0 , ap ) and
3742
3751
Stage5:: revFlow ( node , state , ap .getApprox ( ) ) and
3743
- strengthenType ( node , t0 , t )
3752
+ strengthenType ( node , t0 , t ) and
3753
+ not inBarrier ( node , state )
3744
3754
)
3745
3755
}
3746
3756
@@ -3838,11 +3848,15 @@ module MakeImpl<InputSig Lang> {
3838
3848
PathNodeMid mid , ReturnPosition pos , FlowState state , CallContext innercc ,
3839
3849
AccessPathApprox apa
3840
3850
) {
3841
- pos = mid .getNodeEx ( ) .( RetNodeEx ) .getReturnPosition ( ) and
3842
- state = mid .getState ( ) and
3843
- innercc = mid .getCallContext ( ) and
3844
- innercc instanceof CallContextNoCall and
3845
- apa = mid .getAp ( ) .getApprox ( )
3851
+ exists ( RetNodeEx retNode |
3852
+ retNode = mid .getNodeEx ( ) and
3853
+ pos = retNode .getReturnPosition ( ) and
3854
+ state = mid .getState ( ) and
3855
+ not outBarrier ( retNode , state ) and
3856
+ innercc = mid .getCallContext ( ) and
3857
+ innercc instanceof CallContextNoCall and
3858
+ apa = mid .getAp ( ) .getApprox ( )
3859
+ )
3846
3860
}
3847
3861
3848
3862
pragma [ nomagic]
@@ -3874,7 +3888,8 @@ module MakeImpl<InputSig Lang> {
3874
3888
private predicate pathOutOfCallable ( PathNodeMid mid , NodeEx out , FlowState state , CallContext cc ) {
3875
3889
exists ( ReturnKindExt kind , DataFlowCall call , AccessPathApprox apa |
3876
3890
pathOutOfCallable1 ( mid , call , kind , state , cc , apa ) and
3877
- out = getAnOutNodeFlow ( kind , call , apa )
3891
+ out = getAnOutNodeFlow ( kind , call , apa ) and
3892
+ not inBarrier ( out , state )
3878
3893
)
3879
3894
}
3880
3895
@@ -3888,6 +3903,7 @@ module MakeImpl<InputSig Lang> {
3888
3903
) {
3889
3904
exists ( ArgNodeEx arg , ArgumentPosition apos |
3890
3905
pathNode ( mid , arg , state , cc , _, t , ap , _) and
3906
+ not outBarrier ( arg , state ) and
3891
3907
arg .asNode ( ) .( ArgNode ) .argumentOf ( call , apos ) and
3892
3908
apa = ap .getApprox ( ) and
3893
3909
parameterMatch ( ppos , apos )
@@ -3930,6 +3946,7 @@ module MakeImpl<InputSig Lang> {
3930
3946
exists ( ParameterPosition pos , DataFlowCallable callable , DataFlowType t , AccessPath ap |
3931
3947
pathIntoCallable0 ( mid , callable , pos , state , outercc , call , t , ap ) and
3932
3948
p .isParameterOf ( callable , pos ) and
3949
+ not inBarrier ( p , state ) and
3933
3950
(
3934
3951
sc = TSummaryCtxSome ( p , state , t , ap )
3935
3952
or
0 commit comments