File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed
shared/typetracking/codeql/typetracking Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,12 @@ signature module TypeTrackingInput {
113
113
* themselves.
114
114
*/
115
115
predicate hasFeatureBacktrackStoreTarget ( ) ;
116
+
117
+ /**
118
+ * Holds if a non-standard `flowsTo` predicate is needed, i.e., one that is not
119
+ * simply `simpleLocalSmallStep*(localSource, dst)`.
120
+ */
121
+ default predicate nonStandardFlowsTo ( LocalSourceNode localSource , Node dst ) { none ( ) }
116
122
}
117
123
118
124
private import internal.TypeTrackingImpl as Impl
Original file line number Diff line number Diff line change @@ -249,18 +249,15 @@ module TypeTracking<TypeTrackingInput I> {
249
249
pragma [ inline]
250
250
private predicate isLocalSourceNode ( LocalSourceNode n ) { any ( ) }
251
251
252
- /**
253
- * Holds if there is flow from `localSource` to `dst` using zero or more
254
- * `simpleLocalSmallStep`s.
255
- */
256
252
cached
257
- predicate flowsTo ( Node localSource , Node dst ) {
253
+ predicate standardFlowsTo ( Node localSource , Node dst ) {
254
+ not nonStandardFlowsTo ( _, _) and
258
255
// explicit type check in base case to avoid repeated type tests in recursive case
259
256
isLocalSourceNode ( localSource ) and
260
257
dst = localSource
261
258
or
262
259
exists ( Node mid |
263
- flowsTo ( localSource , mid ) and
260
+ standardFlowsTo ( localSource , mid ) and
264
261
simpleLocalSmallStep ( mid , dst )
265
262
)
266
263
}
@@ -278,6 +275,16 @@ module TypeTracking<TypeTrackingInput I> {
278
275
279
276
import Cached
280
277
278
+ /**
279
+ * Holds if there is flow from `localSource` to `dst` using zero or more
280
+ * `simpleLocalSmallStep`s.
281
+ */
282
+ predicate flowsTo ( LocalSourceNode localSource , Node dst ) {
283
+ nonStandardFlowsTo ( localSource , dst )
284
+ or
285
+ standardFlowsTo ( localSource , dst )
286
+ }
287
+
281
288
/**
282
289
* A description of a step on an inter-procedural data flow path.
283
290
*/
You can’t perform that action at this time.
0 commit comments