@@ -99,37 +99,42 @@ predicate hasNonlocalValue(FieldRead fr) {
99
99
)
100
100
}
101
101
102
- /**
103
- * Holds if data can flow from `node1` to `node2` in one local step.
104
- */
105
102
cached
106
- predicate localFlowStep ( Node node1 , Node node2 ) {
107
- simpleLocalFlowStep0 ( node1 , node2 )
108
- or
109
- adjacentUseUse ( node1 .asExpr ( ) , node2 .asExpr ( ) )
110
- or
111
- // Simple flow through library code is included in the exposed local
112
- // step relation, even though flow is technically inter-procedural
113
- FlowSummaryImpl:: Private:: Steps:: summaryThroughStepValue ( node1 , node2 )
114
- }
103
+ private module Cached {
104
+ /**
105
+ * Holds if data can flow from `node1` to `node2` in one local step.
106
+ */
107
+ cached
108
+ predicate localFlowStep ( Node node1 , Node node2 ) {
109
+ simpleLocalFlowStep0 ( node1 , node2 )
110
+ or
111
+ adjacentUseUse ( node1 .asExpr ( ) , node2 .asExpr ( ) )
112
+ or
113
+ // Simple flow through library code is included in the exposed local
114
+ // step relation, even though flow is technically inter-procedural
115
+ FlowSummaryImpl:: Private:: Steps:: summaryThroughStepValue ( node1 , node2 )
116
+ }
115
117
116
- /**
117
- * INTERNAL: do not use.
118
- *
119
- * This is the local flow predicate that's used as a building block in global
120
- * data flow. It may have less flow than the `localFlowStep` predicate.
121
- */
122
- cached
123
- predicate simpleLocalFlowStep ( Node node1 , Node node2 ) {
124
- simpleLocalFlowStep0 ( node1 , node2 )
125
- or
126
- any ( AdditionalValueStep a ) .step ( node1 , node2 ) and
127
- pragma [ only_bind_out ] ( node1 .getEnclosingCallable ( ) ) =
128
- pragma [ only_bind_out ] ( node2 .getEnclosingCallable ( ) ) and
129
- // prevent recursive call
130
- ( any ( AdditionalValueStep a ) .step ( _, _) implies any ( ) )
118
+ /**
119
+ * INTERNAL: do not use.
120
+ *
121
+ * This is the local flow predicate that's used as a building block in global
122
+ * data flow. It may have less flow than the `localFlowStep` predicate.
123
+ */
124
+ cached
125
+ predicate simpleLocalFlowStep ( Node node1 , Node node2 ) {
126
+ simpleLocalFlowStep0 ( node1 , node2 )
127
+ or
128
+ any ( AdditionalValueStep a ) .step ( node1 , node2 ) and
129
+ pragma [ only_bind_out ] ( node1 .getEnclosingCallable ( ) ) =
130
+ pragma [ only_bind_out ] ( node2 .getEnclosingCallable ( ) ) and
131
+ // prevent recursive call
132
+ ( any ( AdditionalValueStep a ) .step ( _, _) implies any ( ) )
133
+ }
131
134
}
132
135
136
+ import Cached
137
+
133
138
private predicate simpleLocalFlowStep0 ( Node node1 , Node node2 ) {
134
139
TaintTrackingUtil:: forceCachingInSameStage ( ) and
135
140
// Variable flow steps through adjacent def-use and use-use pairs.
0 commit comments