From 1cffd45d5f43d719b1e9f71fbfe80c962a8c4fa7 Mon Sep 17 00:00:00 2001 From: Michael Hohn Date: Fri, 28 Mar 2025 09:40:50 -0700 Subject: [PATCH] simplify graph --- graphs/dfg.ql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/graphs/dfg.ql b/graphs/dfg.ql index 70ddba4..c3aa88f 100644 --- a/graphs/dfg.ql +++ b/graphs/dfg.ql @@ -21,10 +21,12 @@ query predicate nodes(DataFlow::Node n1, string key, string value) { } query predicate edges(DataFlow::Node n1, DataFlow::Node n2) { - exists(Function f1 | - f1.hasName("copy_mem") and - n1.getFunction() = f1 and + // Find all nodes that flow into the conditional expression of an if-statement. + exists(ConditionalStmt cond, DataFlow::Node n3 | + cond.getControllingExpr().getAChild() = n3.asExpr() and + DataFlow::localFlow(n1, n3) and DataFlow::localFlowStep(n1, n2) and + n1 != n2 and n2.getLocation().getStartLine() < 46 ) }