@@ -343,7 +343,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
343
343
bindingset [ n, cc]
344
344
pragma [ inline_late]
345
345
private predicate isUnreachableInCall1 ( NodeEx n , LocalCallContextSpecificCall cc ) {
346
- cc .unreachable ( n . asNode ( ) )
346
+ cc .unreachable ( n )
347
347
}
348
348
349
349
/**
@@ -423,7 +423,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
423
423
424
424
pragma [ nomagic]
425
425
private predicate readSetEx ( NodeEx node1 , ContentSet c , NodeEx node2 ) {
426
- readSet ( pragma [ only_bind_into ] ( node1 . asNode ( ) ) , c , pragma [ only_bind_into ] ( node2 . asNode ( ) ) ) and
426
+ readEx ( node1 , c , node2 ) and
427
427
stepFilter ( node1 , node2 )
428
428
or
429
429
exists ( Node n |
@@ -450,44 +450,33 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
450
450
bindingset [ c]
451
451
private predicate expectsContentEx ( NodeEx n , Content c ) {
452
452
exists ( ContentSet cs |
453
- expectsContentCached ( n . asNode ( ) , cs ) and
453
+ expectsContentSet ( n , cs ) and
454
454
pragma [ only_bind_out ] ( c ) = pragma [ only_bind_into ] ( cs ) .getAReadContent ( )
455
455
)
456
456
}
457
457
458
458
pragma [ nomagic]
459
- private predicate notExpectsContent ( NodeEx n ) { not expectsContentCached ( n . asNode ( ) , _) }
459
+ private predicate notExpectsContent ( NodeEx n ) { not expectsContentSet ( n , _) }
460
460
461
461
pragma [ nomagic]
462
- private predicate storeExUnrestricted (
462
+ private predicate storeUnrestricted (
463
463
NodeEx node1 , Content c , NodeEx node2 , DataFlowType contentType , DataFlowType containerType
464
464
) {
465
- store ( pragma [ only_bind_into ] ( node1 .asNode ( ) ) , c , pragma [ only_bind_into ] ( node2 .asNode ( ) ) ,
466
- contentType , containerType ) and
465
+ storeEx ( node1 , c , node2 , contentType , containerType ) and
467
466
stepFilter ( node1 , node2 )
468
467
}
469
468
470
469
pragma [ nomagic]
471
470
private predicate hasReadStep ( Content c ) { read ( _, c , _) }
472
471
473
472
pragma [ nomagic]
474
- private predicate storeEx (
473
+ private predicate store (
475
474
NodeEx node1 , Content c , NodeEx node2 , DataFlowType contentType , DataFlowType containerType
476
475
) {
477
- storeExUnrestricted ( node1 , c , node2 , contentType , containerType ) and
476
+ storeUnrestricted ( node1 , c , node2 , contentType , containerType ) and
478
477
hasReadStep ( c )
479
478
}
480
479
481
- pragma [ nomagic]
482
- private predicate viableReturnPosOutEx ( DataFlowCall call , ReturnPosition pos , NodeEx out ) {
483
- viableReturnPosOut ( call , pos , out .asNode ( ) )
484
- }
485
-
486
- pragma [ nomagic]
487
- private predicate viableParamArgEx ( DataFlowCall call , ParamNodeEx p , ArgNodeEx arg ) {
488
- viableParamArg ( call , p .asNode ( ) , arg .asNode ( ) )
489
- }
490
-
491
480
/**
492
481
* Holds if field flow should be used for the given configuration.
493
482
*/
@@ -520,7 +509,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
520
509
exists ( ParameterPosition pos | p .isParameterOf ( _, pos ) |
521
510
not kind .( ParamUpdateReturnKind ) .getPosition ( ) = pos
522
511
or
523
- allowParameterReturnInSelfCached ( p . asNode ( ) )
512
+ allowParameterReturnInSelfEx ( p )
524
513
)
525
514
}
526
515
@@ -558,7 +547,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
558
547
exists ( NodeEx mid |
559
548
useFieldFlow ( ) and
560
549
fwdFlow ( mid , cc ) and
561
- storeEx ( mid , _, node , _, _)
550
+ store ( mid , _, node , _, _)
562
551
)
563
552
or
564
553
// read
@@ -653,7 +642,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
653
642
not fullBarrier ( node ) and
654
643
useFieldFlow ( ) and
655
644
fwdFlow ( mid , _) and
656
- storeEx ( mid , c , node , _, _)
645
+ store ( mid , c , node , _, _)
657
646
)
658
647
}
659
648
@@ -796,7 +785,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
796
785
exists ( NodeEx mid |
797
786
revFlow ( mid , toReturn ) and
798
787
fwdFlowConsCand ( c ) and
799
- storeEx ( node , c , mid , _, _)
788
+ store ( node , c , mid , _, _)
800
789
)
801
790
}
802
791
@@ -893,7 +882,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
893
882
) {
894
883
revFlowIsReadAndStored ( c ) and
895
884
revFlow ( node2 ) and
896
- storeEx ( node1 , c , node2 , contentType , containerType ) and
885
+ store ( node1 , c , node2 , contentType , containerType ) and
897
886
exists ( ap1 )
898
887
}
899
888
@@ -1152,7 +1141,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1152
1141
flowOutOfCallNodeCand1 ( call , ret , _, out ) and
1153
1142
c = ret .getEnclosingCallable ( )
1154
1143
|
1155
- scope = getSecondLevelScopeCached ( ret . asNode ( ) )
1144
+ scope = getSecondLevelScopeEx ( ret )
1156
1145
or
1157
1146
ret = TParamReturnNode ( _, scope )
1158
1147
)
@@ -1496,7 +1485,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1496
1485
PrevStage:: revFlow ( node , state , apa ) and
1497
1486
filter ( node , state , t0 , ap , t ) and
1498
1487
(
1499
- if castingNodeEx ( node )
1488
+ if node instanceof CastingNodeEx
1500
1489
then
1501
1490
ap instanceof ApNil or
1502
1491
compatibleContainer ( getHeadContent ( ap ) , node .getDataFlowType ( ) ) or
@@ -2627,10 +2616,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2627
2616
FlowCheckNode ( ) {
2628
2617
revFlow ( this , _, _) and
2629
2618
(
2630
- castNode ( this .asNode ( ) ) or
2631
- clearsContentCached ( this .asNode ( ) , _) or
2632
- expectsContentCached ( this .asNode ( ) , _) or
2633
- neverSkipInPathGraph ( this .asNode ( ) ) or
2619
+ flowCheckNode ( this ) or
2634
2620
Config:: neverSkip ( this .asNode ( ) )
2635
2621
)
2636
2622
}
@@ -2665,7 +2651,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2665
2651
or
2666
2652
node instanceof ParamNodeEx
2667
2653
or
2668
- node . asNode ( ) instanceof OutNodeExt
2654
+ node instanceof OutNodeEx
2669
2655
or
2670
2656
storeStepCand ( _, _, _, node , _, _)
2671
2657
or
@@ -2899,15 +2885,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
2899
2885
2900
2886
predicate isHidden ( ) {
2901
2887
not Config:: includeHiddenNodes ( ) and
2902
- (
2903
- hiddenNode ( this .getNodeEx ( ) .asNode ( ) ) and
2904
- not this .isSource ( ) and
2905
- not this instanceof PathNodeSink
2906
- or
2907
- this .getNodeEx ( ) instanceof TNodeImplicitRead
2908
- or
2909
- hiddenNode ( this .getNodeEx ( ) .asParamReturnNode ( ) )
2910
- )
2888
+ hiddenNode ( this .getNodeEx ( ) ) and
2889
+ not this .isSource ( ) and
2890
+ not this instanceof PathNodeSink
2911
2891
}
2912
2892
2913
2893
/** Gets a textual representation of this element. */
@@ -3770,11 +3750,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3770
3750
3771
3751
private module Stage2 = MkStage< Stage1 > :: Stage< Stage2Param > ;
3772
3752
3773
- pragma [ nomagic]
3774
- private predicate castingNodeEx ( NodeEx node ) {
3775
- node .asNode ( ) instanceof CastingNode or exists ( node .asParamReturnNode ( ) )
3776
- }
3777
-
3778
3753
private module Stage3Param implements MkStage< Stage2 > :: StageParam {
3779
3754
private module PrevStage = Stage2;
3780
3755
@@ -3888,7 +3863,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3888
3863
3889
3864
bindingset [ node, t0]
3890
3865
private predicate strengthenType ( NodeEx node , DataFlowType t0 , DataFlowType t ) {
3891
- if castingNodeEx ( node )
3866
+ if node instanceof CastingNodeEx
3892
3867
then
3893
3868
exists ( DataFlowType nt | nt = node .getDataFlowType ( ) |
3894
3869
if typeStrongerThanFilter ( nt , t0 )
@@ -3945,7 +3920,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3945
3920
pragma [ nomagic]
3946
3921
private predicate clearSet ( NodeEx node , ContentSet c ) {
3947
3922
PrevStage:: revFlow ( node ) and
3948
- clearsContentCached ( node . asNode ( ) , c )
3923
+ clearsContentSet ( node , c )
3949
3924
}
3950
3925
3951
3926
pragma [ nomagic]
@@ -5024,7 +4999,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5024
4999
bindingset [ c]
5025
5000
private predicate clearsContentEx ( NodeEx n , Content c ) {
5026
5001
exists ( ContentSet cs |
5027
- clearsContentCached ( n . asNode ( ) , cs ) and
5002
+ clearsContentSet ( n , cs ) and
5028
5003
pragma [ only_bind_out ] ( c ) = pragma [ only_bind_into ] ( cs ) .getAReadContent ( )
5029
5004
)
5030
5005
}
@@ -5377,7 +5352,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5377
5352
midNode = mid .getNodeEx ( ) and
5378
5353
t1 = mid .getType ( ) and
5379
5354
ap1 = mid .getAp ( ) and
5380
- storeExUnrestricted ( midNode , c , node , contentType , t2 ) and
5355
+ storeUnrestricted ( midNode , c , node , contentType , t2 ) and
5381
5356
ap2 .getHead ( ) = c and
5382
5357
ap2 .len ( ) = unbindInt ( ap1 .len ( ) + 1 ) and
5383
5358
compatibleTypesFilter ( t1 , contentType )
@@ -5442,9 +5417,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5442
5417
PartialAccessPath ap
5443
5418
) {
5444
5419
exists ( ReturnKindExt kind , DataFlowCall call |
5445
- partialPathOutOfCallable1 ( mid , call , kind , state , cc , t , ap )
5446
- |
5447
- out .asNode ( ) = kind .getAnOutNode ( call )
5420
+ partialPathOutOfCallable1 ( mid , call , kind , state , cc , t , ap ) and
5421
+ out = kind .getAnOutNodeEx ( call )
5448
5422
)
5449
5423
}
5450
5424
@@ -5529,7 +5503,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5529
5503
) {
5530
5504
exists ( DataFlowCall call , ReturnKindExt kind |
5531
5505
partialPathThroughCallable0 ( call , mid , kind , state , cc , t , ap ) and
5532
- out . asNode ( ) = kind .getAnOutNode ( call )
5506
+ out = kind .getAnOutNodeEx ( call )
5533
5507
)
5534
5508
}
5535
5509
@@ -5549,7 +5523,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5549
5523
not outBarrier ( node , state ) and
5550
5524
// if a node is not the target of a store, we can check `clearsContent` immediately
5551
5525
(
5552
- storeExUnrestricted ( _, _, node , _, _)
5526
+ storeUnrestricted ( _, _, node , _, _)
5553
5527
or
5554
5528
not clearsContentEx ( node , ap .getHead ( ) )
5555
5529
)
@@ -5690,7 +5664,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5690
5664
exists ( NodeEx midNode |
5691
5665
midNode = mid .getNodeEx ( ) and
5692
5666
ap = mid .getAp ( ) and
5693
- storeExUnrestricted ( node , c , midNode , _, _) and
5667
+ storeUnrestricted ( node , c , midNode , _, _) and
5694
5668
ap .getHead ( ) = c
5695
5669
)
5696
5670
}
@@ -5745,7 +5719,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
5745
5719
) {
5746
5720
exists ( DataFlowCall call , ArgumentPosition pos |
5747
5721
revPartialPathThroughCallable0 ( call , mid , pos , state , ap ) and
5748
- node .asNode ( ) . ( ArgNode ) . argumentOf ( call , pos )
5722
+ node .argumentOf ( call , pos )
5749
5723
)
5750
5724
}
5751
5725
0 commit comments