Skip to content

Commit 7c9b44b

Browse files
smowtonaschackmull
authored andcommitted
Don't include arg -> param edges in PathGraph::edges whose arg is not reachable
This avoids lots of missing-node warnings from `codeql bqrs interpret` as it discards the nodes that occur in the `edges` relation but not `nodes`. The problem arises because subpaths introduced two variants of `reach`, one of which is more restrictive than simply `reach(succ) and succ = pred.getASuccessor()`, so it no longer suffices to just check that the successor is reachable.
1 parent c41ec1f commit 7c9b44b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3742,7 +3742,7 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
37423742
*/
37433743
module PathGraph {
37443744
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
3745-
query predicate edges(PathNode a, PathNode b) { a.getASuccessor() = b and reach(b) }
3745+
query predicate edges(PathNode a, PathNode b) { a.getASuccessor() = b and reach(a) and reach(b) }
37463746

37473747
/** Holds if `n` is a node in the graph of data flow path explanations. */
37483748
query predicate nodes(PathNode n, string key, string val) {

0 commit comments

Comments
 (0)