Skip to content

Commit d8b453f

Browse files
author
Paolo Tranquilli
committed
Rust: add consistency query printing AST classes of nodes with wrong toString
1 parent 5012332 commit d8b453f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rust/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ private import codeql.dataflow.internal.DataFlowImplConsistency
1414
private module Input implements InputSig<Location, RustDataFlow> { }
1515

1616
import MakeConsistency<Location, RustDataFlow, RustTaintTracking, Input>
17+
18+
/**
19+
* This adds `AstNode` class names to the results of `uniqueNodeToString`, if any.
20+
*/
21+
query predicate uniqueNodeToStringClasses(Node n, string cls) {
22+
uniqueNodeToString(n, _) and
23+
cls = n.getCfgNode().getAstNode().getPrimaryQlClasses()
24+
}

0 commit comments

Comments
 (0)