@@ -339,7 +339,7 @@ private module Cached {
339
339
// read
340
340
exists ( Node mid |
341
341
parameterValueFlowCand ( p , mid , false ) and
342
- readStep ( mid , _, node ) and
342
+ read ( mid , _, node ) and
343
343
read = true
344
344
)
345
345
or
@@ -658,7 +658,7 @@ private module Cached {
658
658
Node node1 , Content c , Node node2 , DataFlowType contentType , DataFlowType containerType
659
659
) {
660
660
storeStep ( node1 , c , node2 ) and
661
- readStep ( _, c , _) and
661
+ read ( _, c , _) and
662
662
contentType = getNodeDataFlowType ( node1 ) and
663
663
containerType = getNodeDataFlowType ( node2 )
664
664
or
@@ -668,12 +668,15 @@ private module Cached {
668
668
|
669
669
argumentValueFlowsThrough ( n2 , TReadStepTypesSome ( containerType , c , contentType ) , n1 )
670
670
or
671
- readStep ( n2 , c , n1 ) and
671
+ read ( n2 , c , n1 ) and
672
672
contentType = getNodeDataFlowType ( n1 ) and
673
673
containerType = getNodeDataFlowType ( n2 )
674
674
)
675
675
}
676
676
677
+ cached
678
+ predicate read ( Node node1 , Content c , Node node2 ) { readStep ( node1 , c , node2 ) }
679
+
677
680
/**
678
681
* Holds if data can flow from `node1` to `node2` via a direct assignment to
679
682
* `f`.
@@ -789,14 +792,14 @@ class CastingNode extends Node {
789
792
// For reads, `x.f`, we want to check that the tracked type after the read (which
790
793
// is obtained by popping the head of the access path stack) is compatible with
791
794
// the type of `x.f`.
792
- readStep ( _, _, this )
795
+ read ( _, _, this )
793
796
}
794
797
}
795
798
796
799
private predicate readStepWithTypes (
797
800
Node n1 , DataFlowType container , Content c , Node n2 , DataFlowType content
798
801
) {
799
- readStep ( n1 , c , n2 ) and
802
+ read ( n1 , c , n2 ) and
800
803
container = getNodeDataFlowType ( n1 ) and
801
804
content = getNodeDataFlowType ( n2 )
802
805
}
@@ -1087,8 +1090,6 @@ DataFlowCallable resolveCall(DataFlowCall call, CallContext cc) {
1087
1090
result = viableCallableExt ( call ) and cc instanceof CallContextReturn
1088
1091
}
1089
1092
1090
- predicate read = readStep / 3 ;
1091
-
1092
1093
/** An optional Boolean value. */
1093
1094
class BooleanOption extends TBooleanOption {
1094
1095
string toString ( ) {
0 commit comments