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 {
113113 * themselves.
114114 */
115115 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 ( ) }
116122}
117123
118124private import internal.TypeTrackingImpl as Impl
Original file line number Diff line number Diff line change @@ -249,18 +249,15 @@ module TypeTracking<TypeTrackingInput I> {
249249 pragma [ inline]
250250 private predicate isLocalSourceNode ( LocalSourceNode n ) { any ( ) }
251251
252- /**
253- * Holds if there is flow from `localSource` to `dst` using zero or more
254- * `simpleLocalSmallStep`s.
255- */
256252 cached
257- predicate flowsTo ( Node localSource , Node dst ) {
253+ predicate standardFlowsTo ( Node localSource , Node dst ) {
254+ not nonStandardFlowsTo ( _, _) and
258255 // explicit type check in base case to avoid repeated type tests in recursive case
259256 isLocalSourceNode ( localSource ) and
260257 dst = localSource
261258 or
262259 exists ( Node mid |
263- flowsTo ( localSource , mid ) and
260+ standardFlowsTo ( localSource , mid ) and
264261 simpleLocalSmallStep ( mid , dst )
265262 )
266263 }
@@ -278,6 +275,16 @@ module TypeTracking<TypeTrackingInput I> {
278275
279276 import Cached
280277
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+
281288 /**
282289 * A description of a step on an inter-procedural data flow path.
283290 */
You can’t perform that action at this time.
0 commit comments