mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: add class printouts to AstConsistency.ql
This commit is contained in:
@@ -14,11 +14,3 @@ private import codeql.dataflow.internal.DataFlowImplConsistency
|
||||
private module Input implements InputSig<Location, RustDataFlow> { }
|
||||
|
||||
import MakeConsistency<Location, RustDataFlow, RustTaintTracking, Input>
|
||||
|
||||
/**
|
||||
* This adds `AstNode` class names to the results of `uniqueNodeToString`, if any.
|
||||
*/
|
||||
query predicate uniqueNodeToStringClasses(Node n, string cls) {
|
||||
uniqueNodeToString(n, _) and
|
||||
cls = n.getCfgNode().getAstNode().getPrimaryQlClasses()
|
||||
}
|
||||
|
||||
@@ -10,8 +10,9 @@ private predicate multipleToStrings(Element e) { strictcount(e.toString()) > 1 }
|
||||
/**
|
||||
* Holds if `e` has more than one `toString()` result.
|
||||
*/
|
||||
query predicate multipleToStrings(Element e, string s) {
|
||||
query predicate multipleToStrings(Element e, string cls, string s) {
|
||||
multipleToStrings(e) and
|
||||
cls = e.getPrimaryQlClasses() and
|
||||
s = strictconcat(e.toString(), ", ")
|
||||
}
|
||||
|
||||
@@ -39,9 +40,11 @@ private predicate multipleParents(Element child) { strictcount(getParent(child))
|
||||
/**
|
||||
* Holds if `child` has more than one AST parent.
|
||||
*/
|
||||
query predicate multipleParents(Element child, Element parent) {
|
||||
query predicate multipleParents(Element child, string childClass, Element parent, string parentClass) {
|
||||
multipleParents(child) and
|
||||
parent = getParent(child)
|
||||
childClass = child.getPrimaryQlClasses() and
|
||||
parent = getParent(child) and
|
||||
parentClass = parent.getPrimaryQlClasses()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user