mirror of
https://github.com/hohn/codeql-workshop-dataflow-c.git
synced 2025-12-16 10:33:04 +01:00
simplify graph
This commit is contained in:
@@ -21,10 +21,12 @@ query predicate nodes(DataFlow::Node n1, string key, string value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query predicate edges(DataFlow::Node n1, DataFlow::Node n2) {
|
query predicate edges(DataFlow::Node n1, DataFlow::Node n2) {
|
||||||
exists(Function f1 |
|
// Find all nodes that flow into the conditional expression of an if-statement.
|
||||||
f1.hasName("copy_mem") and
|
exists(ConditionalStmt cond, DataFlow::Node n3 |
|
||||||
n1.getFunction() = f1 and
|
cond.getControllingExpr().getAChild() = n3.asExpr() and
|
||||||
|
DataFlow::localFlow(n1, n3) and
|
||||||
DataFlow::localFlowStep(n1, n2) and
|
DataFlow::localFlowStep(n1, n2) and
|
||||||
|
n1 != n2 and
|
||||||
n2.getLocation().getStartLine() < 46
|
n2.getLocation().getStartLine() < 46
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user