File tree Expand file tree Collapse file tree 2 files changed +33
-21
lines changed Expand file tree Collapse file tree 2 files changed +33
-21
lines changed Original file line number Diff line number Diff line change 1- import rust
2- import codeql.rust.elements.internal.generated.ParentChild
3-
4- query predicate multipleToString ( Element e , string s ) {
5- s = strictconcat ( e .toString ( ) , "," ) and
6- strictcount ( e .toString ( ) ) > 1
7- }
8-
9- query predicate multipleLocations ( Locatable e ) { strictcount ( e .getLocation ( ) ) > 1 }
10-
11- query predicate multiplePrimaryQlClasses ( Element e , string s ) {
12- s = e .getPrimaryQlClasses ( ) and
13- strictcount ( e .getAPrimaryQlClass ( ) ) > 1
14- }
15-
16- private Element getParent ( Element child ) { child = getChildAndAccessor ( result , _, _) }
17-
18- query predicate multipleParents ( Element child , Element parent ) {
19- parent = getParent ( child ) and
20- strictcount ( getParent ( child ) ) > 1
21- }
1+ /**
2+ * @name Abstract syntax tree inconsistencies
3+ * @description Lists the abstract syntax tree inconsistencies in the database. This query is intended for internal use.
4+ * @kind table
5+ * @id rust/diagnostics/ast-consistency
6+ */
7+
8+ import codeql.rust.AstConsistency
Original file line number Diff line number Diff line change 1+ /**
2+ * Provides classes for recognizing control flow graph inconsistencies.
3+ */
4+
5+ private import rust
6+ private import codeql.rust.elements.internal.generated.ParentChild
7+
8+ query predicate multipleToString ( Element e , string s ) {
9+ s = strictconcat ( e .toString ( ) , "," ) and
10+ strictcount ( e .toString ( ) ) > 1
11+ }
12+
13+ query predicate multipleLocations ( Locatable e ) { strictcount ( e .getLocation ( ) ) > 1 }
14+
15+ query predicate multiplePrimaryQlClasses ( Element e , string s ) {
16+ s = e .getPrimaryQlClasses ( ) and
17+ strictcount ( e .getAPrimaryQlClass ( ) ) > 1
18+ }
19+
20+ private Element getParent ( Element child ) { child = getChildAndAccessor ( result , _, _) }
21+
22+ query predicate multipleParents ( Element child , Element parent ) {
23+ parent = getParent ( child ) and
24+ strictcount ( getParent ( child ) ) > 1
25+ }
You can’t perform that action at this time.
0 commit comments