@@ -1535,14 +1535,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1535
1535
fwdFlow1 ( _, _, _, _, _, _, t0 , t , ap , _) and t0 != t
1536
1536
}
1537
1537
1538
- bindingset [ storeSource, c, readTarget]
1539
- pragma [ inline_late]
1540
- private predicate storeMayReachReadInlineLate (
1541
- NodeEx storeSource , Content c , NodeEx readTarget
1542
- ) {
1543
- Param:: storeMayReachRead ( storeSource , c , readTarget )
1544
- }
1545
-
1546
1538
pragma [ nomagic]
1547
1539
private predicate fwdFlow0 (
1548
1540
NodeEx node , FlowState state , Cc cc , ParamNodeOption summaryCtx , TypOption argT ,
@@ -1731,7 +1723,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1731
1723
(
1732
1724
exists ( NodeEx storeSource |
1733
1725
fwdFlowConsCandStoreReadMatchingEnabled ( storeSource , t1 , ap1 , c , t2 , ap2 ) and
1734
- storeMayReachReadInlineLate ( storeSource , c , node2 )
1726
+ storeMayReachRead ( storeSource , c , node2 )
1735
1727
)
1736
1728
or
1737
1729
fwdFlowConsCandStoreReadMatchingDisabled ( t1 , ap1 , c , t2 , ap2 )
@@ -2276,7 +2268,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2276
2268
|
2277
2269
exists ( NodeEx readTarget |
2278
2270
revFlowConsCandStoreReadMatchingEnabled ( readTarget , ap0 , c , ap ) and
2279
- storeMayReachReadInlineLate ( node , c , readTarget )
2271
+ storeMayReachRead ( node , c , readTarget )
2280
2272
)
2281
2273
or
2282
2274
revFlowConsCandStoreReadMatchingDisabled ( ap0 , c , ap )
@@ -3430,6 +3422,27 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3430
3422
private module StoreReadMatchingInput implements StoreReadMatchingInputSig {
3431
3423
class NodeEx = NodeExAlias ;
3432
3424
3425
+ predicate nodeRange ( NodeEx node , boolean fromArg ) {
3426
+ exists ( PrevStage:: Ap ap |
3427
+ PrevStage:: revFlowAp ( node , ap ) and
3428
+ (
3429
+ ap = true
3430
+ or
3431
+ PrevStage:: storeStepCand ( node , ap , _, _, _, _)
3432
+ or
3433
+ PrevStage:: readStepCand ( _, _, node )
3434
+ )
3435
+ |
3436
+ exists ( PrevStage:: Cc cc | PrevStage:: fwdFlow ( node , _, cc , _, _, _, _, ap , _) |
3437
+ PrevStage:: instanceofCcCall ( cc ) and
3438
+ fromArg = true
3439
+ or
3440
+ PrevStage:: instanceofCcNoCall ( cc ) and
3441
+ fromArg = false
3442
+ )
3443
+ )
3444
+ }
3445
+
3433
3446
predicate localValueStep ( NodeEx node1 , NodeEx node2 ) {
3434
3447
exists ( FlowState state , PrevStage:: ApOption returnAp |
3435
3448
PrevStage:: revFlow ( node1 , pragma [ only_bind_into ] ( state ) , _,
@@ -3442,12 +3455,23 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3442
3455
3443
3456
predicate jumpValueStep = jumpStepEx / 2 ;
3444
3457
3458
+ pragma [ nomagic]
3459
+ private predicate flowThroughOutOfCall ( RetNodeEx ret , NodeEx out ) {
3460
+ exists ( DataFlowCall call , CcCall ccc , ReturnKindExt kind |
3461
+ PrevStage:: callEdgeReturn ( call , _, ret , kind , out , true , true ) and
3462
+ PrevStage:: callMayFlowThroughRev ( call ) and
3463
+ PrevStage:: returnMayFlowThrough ( ret , _, true , kind ) and
3464
+ matchesCall ( ccc , call )
3465
+ )
3466
+ }
3467
+
3445
3468
predicate callEdgeArgParam ( NodeEx arg , NodeEx param ) {
3446
- PrevStage:: callEdgeArgParam ( _, _, arg , param , true , _ )
3469
+ PrevStage:: callEdgeArgParam ( _, _, arg , param , true , true )
3447
3470
}
3448
3471
3449
- predicate callEdgeReturn ( NodeEx ret , NodeEx out ) {
3450
- PrevStage:: callEdgeReturn ( _, _, ret , _, out , true , _)
3472
+ predicate callEdgeReturn ( NodeEx ret , NodeEx out , boolean mayFlowThrough ) {
3473
+ PrevStage:: callEdgeReturn ( _, _, ret , _, out , true , true ) and
3474
+ if flowThroughOutOfCall ( ret , out ) then mayFlowThrough = true else mayFlowThrough = false
3451
3475
}
3452
3476
3453
3477
predicate readContentStep = PrevStage:: readStepCand / 3 ;
0 commit comments