mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
JavaScript: Add explicit nodes query predicate in PathGraph.
This is needed to correctly handle the case where `edges` is empty.
This commit is contained in:
@@ -827,9 +827,14 @@ class SinkPathNode extends PathNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the query predicate needed to include a graph in a path-problem query.
|
||||
* Provides the query predicates needed to include a graph in a path-problem query.
|
||||
*/
|
||||
module PathGraph {
|
||||
/** Holds if `nd` is a node in the graph of data flow path explanations. */
|
||||
query predicate nodes(PathNode nd) {
|
||||
any()
|
||||
}
|
||||
|
||||
/** Holds if `pred` → `succ` is an edge in the graph of data flow path explanations. */
|
||||
query predicate edges(PathNode pred, PathNode succ) {
|
||||
pred.getASuccessor() = succ
|
||||
|
||||
Reference in New Issue
Block a user