mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Dataflow: Add flowFrom predicates to mirror flowTo.
This commit is contained in:
@@ -207,6 +207,28 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
|
|||||||
flowLocal(source, sink) and Config::observeOverlayInformedIncrementalMode()
|
flowLocal(source, sink) and Config::observeOverlayInformedIncrementalMode()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds if data can flow from `source` to some sink.
|
||||||
|
* This is a local predicate that only has results local to the overlay/base database.
|
||||||
|
*/
|
||||||
|
predicate flowFromLocal(Node source) = forceLocal(Flow::flowFrom/1)(source)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds if data can flow from `source` to some sink.
|
||||||
|
*/
|
||||||
|
predicate flowFrom(Node source) {
|
||||||
|
Flow::flowFrom(source)
|
||||||
|
or
|
||||||
|
// If we are overlay informed (i.e. we are not diff-informed), we
|
||||||
|
// merge in the local results which includes the base database results.
|
||||||
|
flowFromLocal(source) and Config::observeOverlayInformedIncrementalMode()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds if data can flow from `source` to some sink.
|
||||||
|
*/
|
||||||
|
predicate flowFromExpr(Lang::DataFlowExpr source) { flowFrom(exprNode(source)) }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds if data can flow from some source to `sink`.
|
* Holds if data can flow from some source to `sink`.
|
||||||
* This is a local predicate that only has results local to the overlay/base database.
|
* This is a local predicate that only has results local to the overlay/base database.
|
||||||
@@ -3501,6 +3523,16 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds if data can flow from `source` to some sink.
|
||||||
|
*/
|
||||||
|
predicate flowFrom(Node source) { exists(PathNode n | n.isSource() and n.getNode() = source) }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds if data can flow from `source` to some sink.
|
||||||
|
*/
|
||||||
|
predicate flowFromExpr(Expr source) { flowFrom(exprNode(source)) }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds if data can flow from some source to `sink`.
|
* Holds if data can flow from some source to `sink`.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user