From ccbe77eb099b9200ae8100f2bc89c6020cb6214f Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 11:08:10 -0400 Subject: [PATCH 001/240] Java: move original files --- ...StaticInnerClassMissingNestedAnnotation.md | 64 +++++++++++++++++++ ...StaticInnerClassMissingNestedAnnotation.ql | 30 +++++++++ .../Frameworks/JUnit/AnnotationTest.java | 44 +++++++++++++ ...InnerClassMissingNestedAnnotation.expected | 1 + ...ticInnerClassMissingNestedAnnotation.qlref | 1 + .../Likely Bugs/Frameworks/JUnit/options | 1 + .../org/junit/jupiter/api/Nested.java | 4 ++ 7 files changed, 145 insertions(+) create mode 100644 java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md create mode 100644 java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/options create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md new file mode 100644 index 000000000000..78719b295564 --- /dev/null +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md @@ -0,0 +1,64 @@ +# J-T-004: Non-static inner class defined in a JUnit 5 is missing a `@Nested` annotation + +A non-static inner class defined in a JUnit 5 test missing a `@Nested` annotation will be excluded from execution and it may indicate a misunderstanding from the programmer. + +## Overview + +JUnit tests are grouped in a class, and starting from JUnit 5 users can group the test classes in a bigger class so they can share the local environment of the enclosing class. While this helps to organize the unit tests and foster code reuse, if the inner class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. + +Note that static classes, whether static or not, behave as independent sets of unit tests. Thus, inner static classes do not share the information provided by the outer class with other inner classes. Thus, this rule only applies to non-static JUnit 5 inner classes. + +## Recommendation + +If you want the tests defined in an inner class to be recognized by the build plugin and be executed, annotate with `@Nested`, imported from `org.junit.jupiter.api`. + +## Example + +```java +import org.junit.jupiter.api.Nested; +import static org.junit.Assert.assertEquals; + +public class IntegerOperationTest { + private int i; // Shared variable among the inner classes. + + @BeforeEach + public void initTest() { i = 0; } + + @Nested + public class AdditionTest { // COMPLIANT: Inner test class annotated with `@Nested`. + @Test + public void addTest1() { // Test of an inner class, implying `AdditionTest` is a test class. + assertEquals(1, i+1); + } + } + + public class SubtractionTest { // NON_COMPLIANT: Inner test class missing `@Nested`. + @Test + public void addTest1() { // Test of an inner class, implying `SubtractionTest` is a test class. + assertEquals(-1, i-1); + } + } + + static public class MultiplicationTest { // COMPLIANT: static test class should not be annotated as `@Nested`. + ... + } +} +``` + +## Implementation Notes + +The `@Nested` annotation does not apply to inner static classes, since the meaning of the annotation is to mark a class as "a *non-static* inner class containing `@Test` methods to be picked up by a build system". Therefore, this rule does not aim to target static inner test classes with a `@Nested` annotation, nor does it try to enforce such correct usage of `@Nested`. Therefore, any code that resembles below is not non-compliant to this rule. + +``` java +@Nested +public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope + @Test + public void test() { + } +} +``` + +## References + +- JUnit: [Documentation on `@Nested`](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/Nested.html). +- Baeldung: [JUnit 5 @Nested Test Classes](https://www.baeldung.com/junit-5-nested-test-classes). diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql new file mode 100644 index 000000000000..cb1988dca052 --- /dev/null +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql @@ -0,0 +1,30 @@ +/** + * @id java/junit5-non-static-inner-class-missing-nested-annotation + * @name J-T-004: Non-static inner class defined in a JUnit5 test is missing a `@Nested` annotation + * @description A non-static inner class defined in a JUnit5 test missing a `@Nested` annotation + * will be excluded from execution and it may indicate a misunderstanding from the + * programmer. + * @kind problem + * @precision very-high + * @problem.severity warning + * @tags maintainability + * correctness + */ + +import java + +class JUnit5TestClass extends Class { + JUnit5TestClass() { + this.getAMethod().getAnAnnotation().getType().hasQualifiedName("org.junit.jupiter.api", "Test") + } +} + +from JUnit5TestClass testClass // `TestClass` by definition should have at least one @Test method. +where + not testClass.isStatic() and + testClass instanceof InnerClass and // `InnerClass` is by definition a non-static nested class. + not exists(Annotation annotation | + annotation.getType().hasQualifiedName("org.junit.jupiter.api", "Nested") and + annotation.getAnnotatedElement() = testClass + ) +select testClass, "This JUnit5 inner test class lacks a @Nested annotation." diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java new file mode 100644 index 000000000000..91dd1f5b597a --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -0,0 +1,44 @@ +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Nested; + +public class AnnotationTest { + @Nested + public class Test1 { // COMPLIANT: Inner test class has `@Nested` + @Test + public void test() { + } + } + + public class Test2 { // NON_COMPLIANT: Inner test class is missing a `@Nested` + @Test + public void test() { + } + } + + public class Test3 { // COMPLIANT: Since it is empty, it is not a test class + } + + public class Test4 { // COMPLIANT: Since no methods have `@Test`, it is not a test class + public void f() { + } + + public void g() { + } + + public void h() { + } + } + + public static class Test5 { // COMPLIANT: Static inner test classes don't need `@Nested` + @Test + public void test() { + } + } + + @Nested + public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope (see Implementation Details) + @Test + public void test() { + } + } +} diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected new file mode 100644 index 000000000000..0964e894cbd2 --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected @@ -0,0 +1 @@ +| AnnotationTest.java:12:16:12:20 | Test2 | This JUnit5 inner test class lacks a @Nested annotation. | diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref new file mode 100644 index 000000000000..4b0732a04c5b --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref @@ -0,0 +1 @@ +Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/options b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/options new file mode 100644 index 000000000000..8ad0239c5f0f --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/options @@ -0,0 +1 @@ +//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/junit-jupiter-api-5.2.0 diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java new file mode 100644 index 000000000000..c1ca1fe9163f --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java @@ -0,0 +1,4 @@ +package org.junit.jupiter.api; + +public @interface Nested { +} From f17e7266cfeb2bb0fe89ed96de5b5353dbab1922 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 15:22:59 -0400 Subject: [PATCH 002/240] Java: refactor QL --- java/ql/lib/semmle/code/java/UnitTests.qll | 8 ++++++ ...StaticInnerClassMissingNestedAnnotation.ql | 26 +++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll index 38f37fa4ff01..af1cd88f4f16 100644 --- a/java/ql/lib/semmle/code/java/UnitTests.qll +++ b/java/ql/lib/semmle/code/java/UnitTests.qll @@ -112,6 +112,14 @@ class JUnitJupiterTestMethod extends Method { } } +/** + * A JUnit test class that contains at least one method annotated with + * `org.junit.jupiter.api.Test`. + */ +class JUnit5TestClass extends Class { + JUnit5TestClass() { this.getAMethod() instanceof JUnitJupiterTestMethod } +} + /** * A JUnit `@Ignore` annotation. */ diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql index cb1988dca052..4b521567784a 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql @@ -1,30 +1,22 @@ /** * @id java/junit5-non-static-inner-class-missing-nested-annotation - * @name J-T-004: Non-static inner class defined in a JUnit5 test is missing a `@Nested` annotation - * @description A non-static inner class defined in a JUnit5 test missing a `@Nested` annotation + * @name Non-static inner class defined in a JUnit 5 test is missing a `@Nested` annotation + * @description A non-static inner class defined in a JUnit 5 test missing a `@Nested` annotation * will be excluded from execution and it may indicate a misunderstanding from the * programmer. * @kind problem * @precision very-high * @problem.severity warning - * @tags maintainability + * @tags quality + * maintainability * correctness */ import java -class JUnit5TestClass extends Class { - JUnit5TestClass() { - this.getAMethod().getAnAnnotation().getType().hasQualifiedName("org.junit.jupiter.api", "Test") - } -} - -from JUnit5TestClass testClass // `TestClass` by definition should have at least one @Test method. +from JUnit5TestClass testClass where - not testClass.isStatic() and - testClass instanceof InnerClass and // `InnerClass` is by definition a non-static nested class. - not exists(Annotation annotation | - annotation.getType().hasQualifiedName("org.junit.jupiter.api", "Nested") and - annotation.getAnnotatedElement() = testClass - ) -select testClass, "This JUnit5 inner test class lacks a @Nested annotation." + // `InnerClass` is a non-static, nested class. + testClass instanceof InnerClass and + not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") +select testClass, "This JUnit5 inner test class lacks a '@Nested' annotation." From b08c8d020de9429c94b21f98ca4fda55b4614526 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 15:33:15 -0400 Subject: [PATCH 003/240] Java: tests to inline expectations --- .../Likely Bugs/Frameworks/JUnit/AnnotationTest.java | 7 +++++-- ...nit5NonStaticInnerClassMissingNestedAnnotation.expected | 2 +- .../JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 91dd1f5b597a..4aeceb51f9e6 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -9,7 +9,8 @@ public void test() { } } - public class Test2 { // NON_COMPLIANT: Inner test class is missing a `@Nested` + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2 { // $ Alert @Test public void test() { } @@ -35,8 +36,10 @@ public void test() { } } + // COMPLIANT: Invalid to use `@Nested` on a static class, but + // this matter is out of scope (see QHelp Implementation Notes) @Nested - public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope (see Implementation Details) + public static class Test6 { @Test public void test() { } diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected index 0964e894cbd2..5133a3223319 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected @@ -1 +1 @@ -| AnnotationTest.java:12:16:12:20 | Test2 | This JUnit5 inner test class lacks a @Nested annotation. | +| AnnotationTest.java:13:16:13:20 | Test2 | This JUnit5 inner test class lacks a '@Nested' annotation. | diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref index 4b0732a04c5b..3a819b36f79c 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref @@ -1 +1,2 @@ -Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +query: Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql From ed57bc7858ab7436145c504e78b1dfa3bc98ddce Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 16:11:11 -0400 Subject: [PATCH 004/240] Java: exclude abstract classes --- ...5NonStaticInnerClassMissingNestedAnnotation.md | 11 +++++++++-- ...5NonStaticInnerClassMissingNestedAnnotation.ql | 4 +++- .../Frameworks/JUnit/AnnotationTest.java | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md index 78719b295564..7f336fd7c105 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md @@ -47,11 +47,18 @@ public class IntegerOperationTest { ## Implementation Notes -The `@Nested` annotation does not apply to inner static classes, since the meaning of the annotation is to mark a class as "a *non-static* inner class containing `@Test` methods to be picked up by a build system". Therefore, this rule does not aim to target static inner test classes with a `@Nested` annotation, nor does it try to enforce such correct usage of `@Nested`. Therefore, any code that resembles below is not non-compliant to this rule. +The `@Nested` annotation does not apply to inner static classes, since the meaning of the annotation is to mark a class as "a *non-static* inner class containing `@Test` methods to be picked up by a build system". It also does not apply to inner abstract classes since there is no use case for an `@Nested` annotation on an abstract class. Therefore, this rule does not aim to target static or abstract inner test classes with a `@Nested` annotation, nor does it try to enforce such correct usage of `@Nested`. Therefore, any code that resembles the below is not non-compliant to this rule. ``` java @Nested -public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope +public static class TestStatic { // COMPLIANT: Although invalid, this matter is out of the scope + @Test + public void test() { + } +} + +@Nested +public abstract class TestAbstract { // COMPLIANT: Although invalid, this matter is out of the scope @Test public void test() { } diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql index 4b521567784a..1c5b4234e758 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql @@ -18,5 +18,7 @@ from JUnit5TestClass testClass where // `InnerClass` is a non-static, nested class. testClass instanceof InnerClass and - not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") + not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") and + // An abstract class should not have a `@Nested` annotation + not testClass.isAbstract() select testClass, "This JUnit5 inner test class lacks a '@Nested' annotation." diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 4aeceb51f9e6..6c095e9e4ecd 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -44,4 +44,19 @@ public static class Test6 { public void test() { } } + + public abstract class Test7 { // COMPLIANT: Abstract inner test classes don't need `@Nested` + @Test + public void test() { + } + } + + // COMPLIANT: Invalid to use `@Nested` on an abstract class, but + // this matter is out of scope (see QHelp Implementation Notes) + @Nested + public abstract class Test8 { + @Test + public void test() { + } + } } From 640096c822cae7994dd53eaf509d540fbee7ffad Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 16:15:56 -0400 Subject: [PATCH 005/240] Java: change note --- .../2025-03-21-junit-missing-nested-annotation.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md diff --git a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md new file mode 100644 index 000000000000..b014655b42c5 --- /dev/null +++ b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md @@ -0,0 +1,4 @@ +--- +category: newQuery +--- +* Added a new quality query, `java/junit5-non-static-inner-class-missing-nested-annotation`, to detect missing `@Nested` annotations on non-static, inner JUnit 5 test classes. From 3e13f0ed41ec85e20d96e86e7fd7f1ff7c71b1c3 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 22:43:35 -0400 Subject: [PATCH 006/240] Java: remove redundant 'non-static' wording and update qhelp --- .../JUnit/JUnit5MissingNestedAnnotation.md | 45 ++++++++++++ ...on.ql => JUnit5MissingNestedAnnotation.ql} | 11 +-- ...StaticInnerClassMissingNestedAnnotation.md | 71 ------------------- ...5-03-21-junit-missing-nested-annotation.md | 2 +- .../Frameworks/JUnit/AnnotationTest.java | 4 +- .../JUnit5MissingNestedAnnotation.expected | 1 + .../JUnit/JUnit5MissingNestedAnnotation.qlref | 2 + ...InnerClassMissingNestedAnnotation.expected | 1 - ...ticInnerClassMissingNestedAnnotation.qlref | 2 - 9 files changed, 57 insertions(+), 82 deletions(-) create mode 100644 java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md rename java/ql/src/Likely Bugs/Frameworks/JUnit/{JUnit5NonStaticInnerClassMissingNestedAnnotation.ql => JUnit5MissingNestedAnnotation.ql} (50%) delete mode 100644 java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.qlref delete mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected delete mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md new file mode 100644 index 000000000000..2c4fbd7d61ee --- /dev/null +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md @@ -0,0 +1,45 @@ +## Overview + +JUnit tests are grouped in a class, and starting from JUnit 5 users can group the test classes in a bigger class so they can share the local environment of the enclosing class. While this helps to organize the unit tests and foster code reuse, if an inner test class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. + +## Recommendation + +If you want the tests defined in an inner class to be recognized by the build plugin and be executed, annotate the class with `@Nested`, imported from `org.junit.jupiter.api`. + +## Example + +```java +import org.junit.jupiter.api.Nested; +import static org.junit.Assert.assertEquals; + +public class IntegerOperationTest { + private int i; // Shared variable among the inner classes. + + @BeforeEach + public void initTest() { i = 0; } + + @Nested + public class AdditionTest { // COMPLIANT: Inner test class annotated with `@Nested`. + @Test + public void addTest1() { + assertEquals(1, i + 1); + } + } + + public class SubtractionTest { // NON_COMPLIANT: Inner test class missing `@Nested`. + @Test + public void addTest1() { + assertEquals(-1, i - 1); + } + } +} +``` + +## Implementation Notes + +This rule is focused on missing `@Nested` annotations on non-static nested (inner) test classes. Static nested test classes and abstract nested test classes should not be annotated with `@Nested`. As a result, the absence of a `@Nested` annotation on such classes is compliant. Identifying incorrect application of a `@Nested` annotation to static and abstract classes is out of scope for this rule. + +## References + +- JUnit 5 API Documentation: [Annotation Interface Nested](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/Nested.html). +- JUnit 5 User Guide: [Nested Tests](https://junit.org/junit5/docs/current/user-guide/#writing-tests-nested). diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql similarity index 50% rename from java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql rename to java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index 1c5b4234e758..a8cf5d14e3c0 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -1,8 +1,8 @@ /** - * @id java/junit5-non-static-inner-class-missing-nested-annotation - * @name Non-static inner class defined in a JUnit 5 test is missing a `@Nested` annotation - * @description A non-static inner class defined in a JUnit 5 test missing a `@Nested` annotation - * will be excluded from execution and it may indicate a misunderstanding from the + * @id java/junit5-missing-nested-annotation + * @name Missing `@Nested` annotation on JUnit 5 inner test class + * @description A JUnit 5 inner test class that is missing a `@Nested` annotation will be + * excluded from execution and it may indicate a misunderstanding from the * programmer. * @kind problem * @precision very-high @@ -10,6 +10,7 @@ * @tags quality * maintainability * correctness + * previous-id:java/junit5-non-static-inner-class-missing-nested-annotation */ import java @@ -21,4 +22,4 @@ where not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") and // An abstract class should not have a `@Nested` annotation not testClass.isAbstract() -select testClass, "This JUnit5 inner test class lacks a '@Nested' annotation." +select testClass, "This JUnit 5 inner test class lacks a '@Nested' annotation." diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md deleted file mode 100644 index 7f336fd7c105..000000000000 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md +++ /dev/null @@ -1,71 +0,0 @@ -# J-T-004: Non-static inner class defined in a JUnit 5 is missing a `@Nested` annotation - -A non-static inner class defined in a JUnit 5 test missing a `@Nested` annotation will be excluded from execution and it may indicate a misunderstanding from the programmer. - -## Overview - -JUnit tests are grouped in a class, and starting from JUnit 5 users can group the test classes in a bigger class so they can share the local environment of the enclosing class. While this helps to organize the unit tests and foster code reuse, if the inner class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. - -Note that static classes, whether static or not, behave as independent sets of unit tests. Thus, inner static classes do not share the information provided by the outer class with other inner classes. Thus, this rule only applies to non-static JUnit 5 inner classes. - -## Recommendation - -If you want the tests defined in an inner class to be recognized by the build plugin and be executed, annotate with `@Nested`, imported from `org.junit.jupiter.api`. - -## Example - -```java -import org.junit.jupiter.api.Nested; -import static org.junit.Assert.assertEquals; - -public class IntegerOperationTest { - private int i; // Shared variable among the inner classes. - - @BeforeEach - public void initTest() { i = 0; } - - @Nested - public class AdditionTest { // COMPLIANT: Inner test class annotated with `@Nested`. - @Test - public void addTest1() { // Test of an inner class, implying `AdditionTest` is a test class. - assertEquals(1, i+1); - } - } - - public class SubtractionTest { // NON_COMPLIANT: Inner test class missing `@Nested`. - @Test - public void addTest1() { // Test of an inner class, implying `SubtractionTest` is a test class. - assertEquals(-1, i-1); - } - } - - static public class MultiplicationTest { // COMPLIANT: static test class should not be annotated as `@Nested`. - ... - } -} -``` - -## Implementation Notes - -The `@Nested` annotation does not apply to inner static classes, since the meaning of the annotation is to mark a class as "a *non-static* inner class containing `@Test` methods to be picked up by a build system". It also does not apply to inner abstract classes since there is no use case for an `@Nested` annotation on an abstract class. Therefore, this rule does not aim to target static or abstract inner test classes with a `@Nested` annotation, nor does it try to enforce such correct usage of `@Nested`. Therefore, any code that resembles the below is not non-compliant to this rule. - -``` java -@Nested -public static class TestStatic { // COMPLIANT: Although invalid, this matter is out of the scope - @Test - public void test() { - } -} - -@Nested -public abstract class TestAbstract { // COMPLIANT: Although invalid, this matter is out of the scope - @Test - public void test() { - } -} -``` - -## References - -- JUnit: [Documentation on `@Nested`](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/Nested.html). -- Baeldung: [JUnit 5 @Nested Test Classes](https://www.baeldung.com/junit-5-nested-test-classes). diff --git a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md index b014655b42c5..c663ddc04f6d 100644 --- a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md +++ b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md @@ -1,4 +1,4 @@ --- category: newQuery --- -* Added a new quality query, `java/junit5-non-static-inner-class-missing-nested-annotation`, to detect missing `@Nested` annotations on non-static, inner JUnit 5 test classes. +* Added a new quality query, `java/junit5-missing-nested-annotation`, to detect missing `@Nested` annotations on JUnit 5 inner test classes. diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 6c095e9e4ecd..12b65294045e 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -30,7 +30,7 @@ public void h() { } } - public static class Test5 { // COMPLIANT: Static inner test classes don't need `@Nested` + public static class Test5 { // COMPLIANT: Static nested test classes don't need `@Nested` @Test public void test() { } @@ -45,7 +45,7 @@ public void test() { } } - public abstract class Test7 { // COMPLIANT: Abstract inner test classes don't need `@Nested` + public abstract class Test7 { // COMPLIANT: Abstract nested test classes don't need `@Nested` @Test public void test() { } diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected new file mode 100644 index 000000000000..bb7f1b036f3b --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected @@ -0,0 +1 @@ +| AnnotationTest.java:13:16:13:20 | Test2 | This JUnit 5 inner test class lacks a '@Nested' annotation. | diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.qlref b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.qlref new file mode 100644 index 000000000000..1d4c5febd14d --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.qlref @@ -0,0 +1,2 @@ +query: Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected deleted file mode 100644 index 5133a3223319..000000000000 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected +++ /dev/null @@ -1 +0,0 @@ -| AnnotationTest.java:13:16:13:20 | Test2 | This JUnit5 inner test class lacks a '@Nested' annotation. | diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref deleted file mode 100644 index 3a819b36f79c..000000000000 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref +++ /dev/null @@ -1,2 +0,0 @@ -query: Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql -postprocess: utils/test/InlineExpectationsTestQuery.ql From 4d7bed6181e5e35ed27bfa280bafaf657c18f673 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 14:31:11 -0400 Subject: [PATCH 007/240] Java: exclude anonymous, local, and private classes --- java/ql/lib/semmle/code/java/UnitTests.qll | 14 ++++++++++ .../JUnit/JUnit5MissingNestedAnnotation.ql | 4 +-- .../Frameworks/JUnit/AnnotationTest.java | 28 +++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll index af1cd88f4f16..810732356aff 100644 --- a/java/ql/lib/semmle/code/java/UnitTests.qll +++ b/java/ql/lib/semmle/code/java/UnitTests.qll @@ -120,6 +120,20 @@ class JUnit5TestClass extends Class { JUnit5TestClass() { this.getAMethod() instanceof JUnitJupiterTestMethod } } +/** + * A JUnit inner test class that is non-anonymous, non-local, + * and non-private. + */ +class JUnit5InnerTestClass extends JUnit5TestClass { + JUnit5InnerTestClass() { + // `InnerClass` is a non-static nested class. + this instanceof InnerClass and + not this.isAnonymous() and + not this.isLocal() and + not this.isPrivate() + } +} + /** * A JUnit `@Ignore` annotation. */ diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index a8cf5d14e3c0..2f69cea0c7a1 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -15,10 +15,8 @@ import java -from JUnit5TestClass testClass +from JUnit5InnerTestClass testClass where - // `InnerClass` is a non-static, nested class. - testClass instanceof InnerClass and not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") and // An abstract class should not have a `@Nested` annotation not testClass.isAbstract() diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 12b65294045e..ad229192fd4d 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -59,4 +59,32 @@ public abstract class Test8 { public void test() { } } + + interface Test9 { + } + + public void f() { + // COMPLIANT: anonymous classes are not considered as inner test + // classes by JUnit and therefore don't need `@Nested` + new Test9() { + @Test + public void test() { + } + }; + // COMPLIANT: local classes are not considered as inner test + // classes by JUnit and therefore don't need `@Nested` + class Test10 { + @Test + void test() { + } + } + } + + // COMPLIANT: private classes are not considered as inner test + // classes by JUnit and therefore don't need `@Nested` + private class Test11 { + @Test + public void test() { + } + } } From 35b647839c45f2b81cfa787243272d070d5682c0 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 16:36:08 -0400 Subject: [PATCH 008/240] Java: include RepeatedTest, ParameterizedTest, TestFactory, and TestTemplate when identifying JUnit 5 test methods --- java/ql/lib/semmle/code/java/UnitTests.qll | 31 +++++++++++++-- .../JUnit/JUnit5MissingNestedAnnotation.ql | 5 +-- .../Frameworks/JUnit/AnnotationTest.java | 38 ++++++++++++++++++- .../JUnit5MissingNestedAnnotation.expected | 6 ++- .../org/junit/jupiter/api/RepeatedTest.java | 25 ++++++++++++ .../org/junit/jupiter/api/TestFactory.java | 23 +++++++++++ .../org/junit/jupiter/api/TestTemplate.java | 23 +++++++++++ .../jupiter/params/ParameterizedTest.java | 26 +++++++++++++ .../jupiter/params/provider/ValueSource.java | 24 ++++++++++++ 9 files changed, 192 insertions(+), 9 deletions(-) create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/RepeatedTest.java create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestFactory.java create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestTemplate.java create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/ParameterizedTest.java create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/provider/ValueSource.java diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll index 810732356aff..84a2ce4d02b2 100644 --- a/java/ql/lib/semmle/code/java/UnitTests.qll +++ b/java/ql/lib/semmle/code/java/UnitTests.qll @@ -113,11 +113,36 @@ class JUnitJupiterTestMethod extends Method { } /** - * A JUnit test class that contains at least one method annotated with - * `org.junit.jupiter.api.Test`. + * A JUnit 5 test method. + * A test method is defined by JUnit as "any instance method + * that is directly annotated or meta-annotated with `@Test`, + * `@RepeatedTest`, `@ParameterizedTest`, `@TestFactory`, or + * `@TestTemplate`." + * See https://junit.org/junit5/docs/current/user-guide/#writing-tests-definitions + */ +class JUnit5TestMethod extends Method { + JUnit5TestMethod() { + this instanceof JUnitJupiterTestMethod or + this.getAnAnnotation() + .getType() + .hasQualifiedName("org.junit.jupiter.api", ["RepeatedTest", "TestFactory", "TestTemplate"]) or + this.getAnAnnotation() + .getType() + .hasQualifiedName("org.junit.jupiter.params", "ParameterizedTest") + } +} + +/** + * A JUnit 5 test class. + * A test class must contain at least one test method, and + * cannot be abstract. + * See https://junit.org/junit5/docs/current/user-guide/#writing-tests-definitions */ class JUnit5TestClass extends Class { - JUnit5TestClass() { this.getAMethod() instanceof JUnitJupiterTestMethod } + JUnit5TestClass() { + this.getAMethod() instanceof JUnit5TestMethod and + not this.isAbstract() + } } /** diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index 2f69cea0c7a1..f60ed0d4e04d 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -16,8 +16,5 @@ import java from JUnit5InnerTestClass testClass -where - not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") and - // An abstract class should not have a `@Nested` annotation - not testClass.isAbstract() +where not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") select testClass, "This JUnit 5 inner test class lacks a '@Nested' annotation." diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index ad229192fd4d..4ea60f4404c4 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -1,5 +1,11 @@ +import java.util.Collection; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.RepeatedTest; +import org.junit.jupiter.api.TestFactory; +import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.Nested; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; public class AnnotationTest { @Nested @@ -10,12 +16,42 @@ public void test() { } // NON_COMPLIANT: Inner test class is missing `@Nested` - public class Test2 { // $ Alert + public class Test2_Test { // $ Alert @Test public void test() { } } + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2_RepeatedTest { // $ Alert + @RepeatedTest(2) + public void test() { + } + } + + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2_ParameterizedTest { // $ Alert + @ParameterizedTest + @ValueSource(strings = { "" }) + public void test(String s) { + } + } + + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2_TestFactory { // $ Alert + @TestFactory + Collection test() { + return null; + } + } + + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2_TestTemplate { // $ Alert + @TestTemplate + public void test() { + } + } + public class Test3 { // COMPLIANT: Since it is empty, it is not a test class } diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected index bb7f1b036f3b..866afc0926a5 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected @@ -1 +1,5 @@ -| AnnotationTest.java:13:16:13:20 | Test2 | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:19:16:19:25 | Test2_Test | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:26:16:26:33 | Test2_RepeatedTest | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:33:16:33:38 | Test2_ParameterizedTest | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:41:16:41:32 | Test2_TestFactory | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:49:16:49:33 | Test2_TestTemplate | This JUnit 5 inner test class lacks a '@Nested' annotation. | diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/RepeatedTest.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/RepeatedTest.java new file mode 100644 index 000000000000..1ea7e576ab2b --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/RepeatedTest.java @@ -0,0 +1,25 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@TestTemplate +public @interface RepeatedTest { + int value(); +} diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestFactory.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestFactory.java new file mode 100644 index 000000000000..4da3585c8229 --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestFactory.java @@ -0,0 +1,23 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface TestFactory { +} diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestTemplate.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestTemplate.java new file mode 100644 index 000000000000..5ff7ca49131f --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestTemplate.java @@ -0,0 +1,23 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface TestTemplate { +} diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/ParameterizedTest.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/ParameterizedTest.java new file mode 100644 index 000000000000..3f8d0c4ba328 --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/ParameterizedTest.java @@ -0,0 +1,26 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.params; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.junit.jupiter.api.TestTemplate; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@TestTemplate +public @interface ParameterizedTest { +} diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/provider/ValueSource.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/provider/ValueSource.java new file mode 100644 index 000000000000..fd698ac98a07 --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/provider/ValueSource.java @@ -0,0 +1,24 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.params.provider; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ValueSource { + String[] strings() default {}; +} From 37092f4411cc6161c0a2e38ee34fbcdc35229493 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 16:39:22 -0400 Subject: [PATCH 009/240] Java: add 'testability' and 'frameworks/junit' tags --- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index f60ed0d4e04d..7b7786309cf0 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -10,6 +10,8 @@ * @tags quality * maintainability * correctness + * testability + * frameworks/junit * previous-id:java/junit5-non-static-inner-class-missing-nested-annotation */ From dca4c58b29639f75519c971aa3eae8a08c30d0df Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 16:43:44 -0400 Subject: [PATCH 010/240] Java: add to ccr/quality suite --- java/ql/src/codeql-suites/java-ccr.qls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/codeql-suites/java-ccr.qls b/java/ql/src/codeql-suites/java-ccr.qls index ac1f52624c4f..0ee1e8516e6d 100644 --- a/java/ql/src/codeql-suites/java-ccr.qls +++ b/java/ql/src/codeql-suites/java-ccr.qls @@ -11,4 +11,5 @@ - java/unused-container - java/input-resource-leak - java/output-resource-leak - - java/type-variable-hides-type \ No newline at end of file + - java/type-variable-hides-type + - java/junit5-missing-nested-annotation From 0f002624d60495fc4317258b650e05a6c9bab284 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 18:30:39 -0400 Subject: [PATCH 011/240] Java: remove mention of abstract classes from qhelp --- .../JUnit/JUnit5MissingNestedAnnotation.md | 2 +- .../Frameworks/JUnit/AnnotationTest.java | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md index 2c4fbd7d61ee..652f35e85cf8 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md @@ -37,7 +37,7 @@ public class IntegerOperationTest { ## Implementation Notes -This rule is focused on missing `@Nested` annotations on non-static nested (inner) test classes. Static nested test classes and abstract nested test classes should not be annotated with `@Nested`. As a result, the absence of a `@Nested` annotation on such classes is compliant. Identifying incorrect application of a `@Nested` annotation to static and abstract classes is out of scope for this rule. +This rule is focused on missing `@Nested` annotations on non-static nested (inner) test classes. Static nested test classes should not be annotated with `@Nested`. As a result, the absence of a `@Nested` annotation on such classes is compliant. Identifying incorrect application of a `@Nested` annotation to static nested classes is out of scope for this rule. ## References diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 4ea60f4404c4..0050d56dadee 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -87,29 +87,20 @@ public void test() { } } - // COMPLIANT: Invalid to use `@Nested` on an abstract class, but - // this matter is out of scope (see QHelp Implementation Notes) - @Nested - public abstract class Test8 { - @Test - public void test() { - } - } - - interface Test9 { + interface Test8 { } public void f() { // COMPLIANT: anonymous classes are not considered as inner test // classes by JUnit and therefore don't need `@Nested` - new Test9() { + new Test8() { @Test public void test() { } }; // COMPLIANT: local classes are not considered as inner test // classes by JUnit and therefore don't need `@Nested` - class Test10 { + class Test9 { @Test void test() { } @@ -118,7 +109,7 @@ void test() { // COMPLIANT: private classes are not considered as inner test // classes by JUnit and therefore don't need `@Nested` - private class Test11 { + private class Test10 { @Test public void test() { } From b9bf192c09c71664b35751a31d65ec44b87aeae8 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Mon, 24 Mar 2025 14:37:05 -0400 Subject: [PATCH 012/240] Java: previous-id property instead of tag, see #19097 --- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index 7b7786309cf0..db67a2c4843e 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -1,5 +1,6 @@ /** * @id java/junit5-missing-nested-annotation + * @previous-id java/junit5-non-static-inner-class-missing-nested-annotation * @name Missing `@Nested` annotation on JUnit 5 inner test class * @description A JUnit 5 inner test class that is missing a `@Nested` annotation will be * excluded from execution and it may indicate a misunderstanding from the @@ -12,7 +13,6 @@ * correctness * testability * frameworks/junit - * previous-id:java/junit5-non-static-inner-class-missing-nested-annotation */ import java From e169c21f8bef540103c1140f24c72e7d9e45a8ff Mon Sep 17 00:00:00 2001 From: Jami <57204504+jcogs33@users.noreply.github.com> Date: Tue, 25 Mar 2025 07:19:39 -0400 Subject: [PATCH 013/240] Apply suggestions from docs review Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> --- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.md | 2 +- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md index 652f35e85cf8..f8c604a7026d 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md @@ -1,6 +1,6 @@ ## Overview -JUnit tests are grouped in a class, and starting from JUnit 5 users can group the test classes in a bigger class so they can share the local environment of the enclosing class. While this helps to organize the unit tests and foster code reuse, if an inner test class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. +JUnit tests are grouped in a class, and starting from JUnit 5, users can group the test classes in a larger class so they can share the local environment of the enclosing class. While this helps organize the unit tests and foster code reuse, if an inner test class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. ## Recommendation diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index db67a2c4843e..3540ad8d9427 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -3,7 +3,7 @@ * @previous-id java/junit5-non-static-inner-class-missing-nested-annotation * @name Missing `@Nested` annotation on JUnit 5 inner test class * @description A JUnit 5 inner test class that is missing a `@Nested` annotation will be - * excluded from execution and it may indicate a misunderstanding from the + * excluded from execution and may indicate a mistake from the * programmer. * @kind problem * @precision very-high From 56ea9b65234d68f3c74dc4611967b1695d6020a8 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 08:21:15 -0400 Subject: [PATCH 014/240] Java: move original files --- .../Undesirable Calls/DoNotUseFinalizers.md | 34 +++++++++++++++++++ .../Undesirable Calls/DoNotUseFinalizers.ql | 25 ++++++++++++++ .../DoNotUseFinalizers.expected | 3 ++ .../DoNotUseFinalizers.qlref | 1 + .../query-tests/DoNotUseFinalizers/Test.java | 13 +++++++ 5 files changed, 76 insertions(+) create mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md create mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql create mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected create mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref create mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/Test.java diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md new file mode 100644 index 000000000000..70a1236e3a73 --- /dev/null +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md @@ -0,0 +1,34 @@ +# J-FIN-002: Calling garbage collection methods in application code may cause inconsistent program state + +Calling garbage collection or finalizer methods in application code may cause inconsistent program state or unpredicatable behavior. + +## Overview + +Triggering garbage collection explicitly may either have no effect or may trigger unnecessary garbage collection, leading to erratic behavior or deadlock. + +## Recommendation + +Avoid calling finalizers and garbage collection methods in application code. Allow the JVM to determine a garbage collection schedule instead. + +## Example + +```java +public class Test { + void f() throws Throwable { + System.gc(); // NON_COMPLIANT + Runtime.getRuntime().gc(); // NON_COMPLIANT + System.runFinalizersOnExit(true); //NON_COMPLIANT + this.finalize(); // NON_COMPLIANT + } +} + +``` + +# Implementation Notes + +This rule covers a concept related to J-FIN-001; this rule is focused on the use of existing finalizer invocations rather than attempts to write a custom implementation (J-FIN-001). + +## References + +- [Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers) +- [CWE-586](https://cwe.mitre.org/data/definitions/586) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql new file mode 100644 index 000000000000..b2e553024301 --- /dev/null +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql @@ -0,0 +1,25 @@ +/** + * @id java/do-not-use-finalizers + * @name J-D-004: Calling garbage collection methods in application code may cause inconsistent program state + * @description Calling garbage collection or finalizer methods in application code may cause + * inconsistent program state or unpredicatable behavior. + * @kind problem + * @precision high + * @problem.severity error + * @tags correctness + * external/cwe/cwe-586 + */ + +import java + +from MethodCall c, Method m +where + c.getMethod() = m and + ( + m.hasQualifiedName("java.lang", "System", ["gc", "runFinalizersOnExit"]) + or + m.hasQualifiedName("java.lang", "Runtime", "gc") + or + m.hasQualifiedName(_, _, "finalize") + ) +select c, "Call to prohibited method that may modify the JVM's garbage collection process." diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected new file mode 100644 index 000000000000..3a96af624f69 --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected @@ -0,0 +1,3 @@ +| Test.java:3:9:3:19 | gc(...) | Call to prohibited method that may modify the JVM's garbage collection process. | +| Test.java:4:9:4:33 | gc(...) | Call to prohibited method that may modify the JVM's garbage collection process. | +| Test.java:5:9:5:23 | finalize(...) | Call to prohibited method that may modify the JVM's garbage collection process. | diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref new file mode 100644 index 000000000000..e429708f146e --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref @@ -0,0 +1 @@ +rules/J-FIN-002/DoNotUseFinalizers.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/Test.java b/java/ql/test/query-tests/DoNotUseFinalizers/Test.java new file mode 100644 index 000000000000..cca4a6b8f21a --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalizers/Test.java @@ -0,0 +1,13 @@ +public class Test { + void f() throws Throwable { + System.gc(); // NON_COMPLIANT + Runtime.getRuntime().gc(); // NON_COMPLIANT + this.finalize(); // NON_COMPLIANT + // this is removed in Java 11 + //System.runFinalizersOnExit(true); // NON_COMPLIANT + } + + void f1() throws Throwable { + f(); // COMPLIANT + } +} From 9a6e241f540021744dca8154c0939a7a4b5a6f4f Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 08:58:48 -0400 Subject: [PATCH 015/240] Java: update to only find 'finalize' calls and add 'super.finalize' exclusion --- .../Undesirable Calls/DoNotUseFinalize.md | 27 +++++++++++++++ .../Undesirable Calls/DoNotUseFinalize.ql | 27 +++++++++++++++ .../Undesirable Calls/DoNotUseFinalizers.md | 34 ------------------- .../Undesirable Calls/DoNotUseFinalizers.ql | 25 -------------- .../DoNotUseFinalize.expected | 1 + .../DoNotUseFinalize/DoNotUseFinalize.qlref | 1 + .../query-tests/DoNotUseFinalize/Test.java | 9 +++++ .../DoNotUseFinalizers.expected | 3 -- .../DoNotUseFinalizers.qlref | 1 - .../query-tests/DoNotUseFinalizers/Test.java | 13 ------- 10 files changed, 65 insertions(+), 76 deletions(-) create mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md create mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql delete mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md delete mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql create mode 100644 java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected create mode 100644 java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref create mode 100644 java/ql/test/query-tests/DoNotUseFinalize/Test.java delete mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected delete mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref delete mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/Test.java diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md new file mode 100644 index 000000000000..7acb4186fe60 --- /dev/null +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md @@ -0,0 +1,27 @@ +## Overview + +Calling `finalize` in application code may cause inconsistent program state or unpredicatable behavior. + +## Recommendation + +Avoid calling `finalize` in application code. Allow the JVM to determine a garbage collection schedule instead. + +## Example + +```java +public class Test { + void f() throws Throwable { + this.finalize(); // NON_COMPLIANT + } +} + +``` + +# Implementation Notes + +This rule is focused on the use of existing `finalize` invocations rather than attempts to write a custom implementation. + +## References + +- Carnegie Mellon University, SEI CERT Oracle Coding Standard for Java: [MET12-J. Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers). +- Common Weakness Enumeration: [CWE-586](https://cwe.mitre.org/data/definitions/586). diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql new file mode 100644 index 000000000000..fe4203226355 --- /dev/null +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql @@ -0,0 +1,27 @@ +/** + * @id java/do-not-use-finalize + * @name Do not use `finalize` + * @description Calling `finalize` in application code may cause + * inconsistent program state or unpredicatable behavior. + * @kind problem + * @precision high + * @problem.severity error + * @tags correctness + * external/cwe/cwe-586 + */ + +import java + +from MethodCall mc, Method m +where + mc.getMethod() = m and + m.hasName("finalize") and + // The Java documentation for `finalize` states: "If a subclass overrides + // `finalize` it must invoke the superclass finalizer explicitly". Therefore, + // we do not alert on `super.finalize` calls that occur within a callable + // that overrides `finalize`. + not exists(Callable caller, FinalizeMethod fm | caller = mc.getCaller() | + caller.(Method).overrides(fm) and + mc.getQualifier() instanceof SuperAccess + ) +select mc, "Call to 'finalize'." diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md deleted file mode 100644 index 70a1236e3a73..000000000000 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md +++ /dev/null @@ -1,34 +0,0 @@ -# J-FIN-002: Calling garbage collection methods in application code may cause inconsistent program state - -Calling garbage collection or finalizer methods in application code may cause inconsistent program state or unpredicatable behavior. - -## Overview - -Triggering garbage collection explicitly may either have no effect or may trigger unnecessary garbage collection, leading to erratic behavior or deadlock. - -## Recommendation - -Avoid calling finalizers and garbage collection methods in application code. Allow the JVM to determine a garbage collection schedule instead. - -## Example - -```java -public class Test { - void f() throws Throwable { - System.gc(); // NON_COMPLIANT - Runtime.getRuntime().gc(); // NON_COMPLIANT - System.runFinalizersOnExit(true); //NON_COMPLIANT - this.finalize(); // NON_COMPLIANT - } -} - -``` - -# Implementation Notes - -This rule covers a concept related to J-FIN-001; this rule is focused on the use of existing finalizer invocations rather than attempts to write a custom implementation (J-FIN-001). - -## References - -- [Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers) -- [CWE-586](https://cwe.mitre.org/data/definitions/586) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql deleted file mode 100644 index b2e553024301..000000000000 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @id java/do-not-use-finalizers - * @name J-D-004: Calling garbage collection methods in application code may cause inconsistent program state - * @description Calling garbage collection or finalizer methods in application code may cause - * inconsistent program state or unpredicatable behavior. - * @kind problem - * @precision high - * @problem.severity error - * @tags correctness - * external/cwe/cwe-586 - */ - -import java - -from MethodCall c, Method m -where - c.getMethod() = m and - ( - m.hasQualifiedName("java.lang", "System", ["gc", "runFinalizersOnExit"]) - or - m.hasQualifiedName("java.lang", "Runtime", "gc") - or - m.hasQualifiedName(_, _, "finalize") - ) -select c, "Call to prohibited method that may modify the JVM's garbage collection process." diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected new file mode 100644 index 000000000000..5dd0c3cbdf57 --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected @@ -0,0 +1 @@ +| Test.java:3:9:3:23 | finalize(...) | Call to 'finalize'. | diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref new file mode 100644 index 000000000000..7b36e5a63d40 --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref @@ -0,0 +1 @@ +Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalize/Test.java b/java/ql/test/query-tests/DoNotUseFinalize/Test.java new file mode 100644 index 000000000000..6e039dffe8e7 --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalize/Test.java @@ -0,0 +1,9 @@ +public class Test { + void f() throws Throwable { + this.finalize(); // NON_COMPLIANT + } + + void f1() throws Throwable { + f(); // COMPLIANT + } +} diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected deleted file mode 100644 index 3a96af624f69..000000000000 --- a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected +++ /dev/null @@ -1,3 +0,0 @@ -| Test.java:3:9:3:19 | gc(...) | Call to prohibited method that may modify the JVM's garbage collection process. | -| Test.java:4:9:4:33 | gc(...) | Call to prohibited method that may modify the JVM's garbage collection process. | -| Test.java:5:9:5:23 | finalize(...) | Call to prohibited method that may modify the JVM's garbage collection process. | diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref deleted file mode 100644 index e429708f146e..000000000000 --- a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref +++ /dev/null @@ -1 +0,0 @@ -rules/J-FIN-002/DoNotUseFinalizers.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/Test.java b/java/ql/test/query-tests/DoNotUseFinalizers/Test.java deleted file mode 100644 index cca4a6b8f21a..000000000000 --- a/java/ql/test/query-tests/DoNotUseFinalizers/Test.java +++ /dev/null @@ -1,13 +0,0 @@ -public class Test { - void f() throws Throwable { - System.gc(); // NON_COMPLIANT - Runtime.getRuntime().gc(); // NON_COMPLIANT - this.finalize(); // NON_COMPLIANT - // this is removed in Java 11 - //System.runFinalizersOnExit(true); // NON_COMPLIANT - } - - void f1() throws Throwable { - f(); // COMPLIANT - } -} From d9482ae334f2ed817507f310a5aa637f72f0f389 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 13:38:08 -0400 Subject: [PATCH 016/240] Java: update tests to use inline expectations --- .../test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref | 3 ++- java/ql/test/query-tests/DoNotUseFinalize/Test.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref index 7b36e5a63d40..c47232fa1194 100644 --- a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref +++ b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +query: Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalize/Test.java b/java/ql/test/query-tests/DoNotUseFinalize/Test.java index 6e039dffe8e7..ecb30cb1b37d 100644 --- a/java/ql/test/query-tests/DoNotUseFinalize/Test.java +++ b/java/ql/test/query-tests/DoNotUseFinalize/Test.java @@ -1,6 +1,7 @@ public class Test { void f() throws Throwable { - this.finalize(); // NON_COMPLIANT + // NON_COMPLIANT + this.finalize(); // $ Alert } void f1() throws Throwable { From c689a0e9b718ff14fd5923e25c0b57224badf64b Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 20:36:21 -0400 Subject: [PATCH 017/240] Java: add more test cases --- .../DoNotUseFinalize/DoNotUseFinalize.expected | 3 ++- .../query-tests/DoNotUseFinalize/Test.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected index 5dd0c3cbdf57..2445343c293f 100644 --- a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected +++ b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected @@ -1 +1,2 @@ -| Test.java:3:9:3:23 | finalize(...) | Call to 'finalize'. | +| Test.java:4:9:4:23 | finalize(...) | Call to 'finalize'. | +| Test.java:25:9:25:33 | finalize(...) | Call to 'finalize'. | diff --git a/java/ql/test/query-tests/DoNotUseFinalize/Test.java b/java/ql/test/query-tests/DoNotUseFinalize/Test.java index ecb30cb1b37d..3ef4e74e4dc3 100644 --- a/java/ql/test/query-tests/DoNotUseFinalize/Test.java +++ b/java/ql/test/query-tests/DoNotUseFinalize/Test.java @@ -7,4 +7,22 @@ void f() throws Throwable { void f1() throws Throwable { f(); // COMPLIANT } + + @Override + protected void finalize() throws Throwable { + // COMPLIANT: If a subclass overrides `finalize` + // it must invoke the superclass finalizer explicitly. + super.finalize(); + } + + // Overload of `finalize` + protected void finalize(String s) throws Throwable { + System.out.println(s); + } + + // NON_COMPLIANT: call to overload of `finalize` + void f2() throws Throwable { + this.finalize("overload"); // $ Alert + } + } From dd57d1aec6c2a8de30d6b70e790cb5e93208f6ec Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 20:51:03 -0400 Subject: [PATCH 018/240] Java: add quality tag --- .../Undesirable Calls/DoNotUseFinalize.ql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql index fe4203226355..36ca6697fd66 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql @@ -6,7 +6,8 @@ * @kind problem * @precision high * @problem.severity error - * @tags correctness + * @tags quality + * correctness * external/cwe/cwe-586 */ From 44445dbeb8230e7a93c531e249e9dd95846e76d0 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 20:52:06 -0400 Subject: [PATCH 019/240] Java: minor refactor --- .../Undesirable Calls/DoNotUseFinalize.ql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql index 36ca6697fd66..720d72b6c201 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql @@ -13,10 +13,9 @@ import java -from MethodCall mc, Method m +from MethodCall mc where - mc.getMethod() = m and - m.hasName("finalize") and + mc.getMethod().hasName("finalize") and // The Java documentation for `finalize` states: "If a subclass overrides // `finalize` it must invoke the superclass finalizer explicitly". Therefore, // we do not alert on `super.finalize` calls that occur within a callable From 2e254981437cb42799c46611ef72f1a1e918e41f Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 21:23:23 -0400 Subject: [PATCH 020/240] Java: add change note --- java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md diff --git a/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md new file mode 100644 index 000000000000..27e4c530cbd2 --- /dev/null +++ b/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md @@ -0,0 +1,4 @@ +--- +category: newQuery +--- +* Added a new quality query, `java/do-not-use-finalize`, to detect calls to `finalize`. From f73eda0c38ab9c02407d9d2f1ce380d42a653401 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 18:17:26 -0400 Subject: [PATCH 021/240] Java: add previous-id and change 'use' to 'call' --- .../{DoNotUseFinalize.md => DoNotCallFinalize.md} | 0 .../{DoNotUseFinalize.ql => DoNotCallFinalize.ql} | 5 +++-- java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md | 4 ++++ java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md | 4 ---- .../DoNotCallFinalize.expected} | 0 .../query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref | 2 ++ .../{DoNotUseFinalize => DoNotCallFinalize}/Test.java | 0 .../test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref | 2 -- 8 files changed, 9 insertions(+), 8 deletions(-) rename java/ql/src/Violations of Best Practice/Undesirable Calls/{DoNotUseFinalize.md => DoNotCallFinalize.md} (100%) rename java/ql/src/Violations of Best Practice/Undesirable Calls/{DoNotUseFinalize.ql => DoNotCallFinalize.ql} (88%) create mode 100644 java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md delete mode 100644 java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md rename java/ql/test/query-tests/{DoNotUseFinalize/DoNotUseFinalize.expected => DoNotCallFinalize/DoNotCallFinalize.expected} (100%) create mode 100644 java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref rename java/ql/test/query-tests/{DoNotUseFinalize => DoNotCallFinalize}/Test.java (100%) delete mode 100644 java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md similarity index 100% rename from java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md rename to java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql similarity index 88% rename from java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql rename to java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 720d72b6c201..592a27ef6616 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -1,6 +1,7 @@ /** - * @id java/do-not-use-finalize - * @name Do not use `finalize` + * @id java/do-not-call-finalize + * @previous-id java/do-not-use-finalizers + * @name Do not call `finalize` * @description Calling `finalize` in application code may cause * inconsistent program state or unpredicatable behavior. * @kind problem diff --git a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md new file mode 100644 index 000000000000..101b94136a15 --- /dev/null +++ b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md @@ -0,0 +1,4 @@ +--- +category: newQuery +--- +* Added a new quality query, `java/do-not-call-finalize`, to detect calls to `finalize`. diff --git a/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md deleted file mode 100644 index 27e4c530cbd2..000000000000 --- a/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: newQuery ---- -* Added a new quality query, `java/do-not-use-finalize`, to detect calls to `finalize`. diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected similarity index 100% rename from java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected rename to java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected diff --git a/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref new file mode 100644 index 000000000000..b301797d5295 --- /dev/null +++ b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref @@ -0,0 +1,2 @@ +query: Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalize/Test.java b/java/ql/test/query-tests/DoNotCallFinalize/Test.java similarity index 100% rename from java/ql/test/query-tests/DoNotUseFinalize/Test.java rename to java/ql/test/query-tests/DoNotCallFinalize/Test.java diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref deleted file mode 100644 index c47232fa1194..000000000000 --- a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref +++ /dev/null @@ -1,2 +0,0 @@ -query: Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql -postprocess: utils/test/InlineExpectationsTestQuery.ql From ed22a16f32dfb1ba5c940dece2a1dfb105dd88cb Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 19:33:38 -0400 Subject: [PATCH 022/240] Java: exclude overloads of finalize --- .../Undesirable Calls/DoNotCallFinalize.md | 6 +++--- .../Undesirable Calls/DoNotCallFinalize.ql | 12 ++++++------ .../change-notes/2025-03-20-do-not-call-finalize.md | 2 +- .../DoNotCallFinalize/DoNotCallFinalize.expected | 3 +-- java/ql/test/query-tests/DoNotCallFinalize/Test.java | 6 +++--- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 7acb4186fe60..9c3e3ebd4a03 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -1,10 +1,10 @@ ## Overview -Calling `finalize` in application code may cause inconsistent program state or unpredicatable behavior. +Calling `finalize()` in application code may cause inconsistent program state or unpredicatable behavior. ## Recommendation -Avoid calling `finalize` in application code. Allow the JVM to determine a garbage collection schedule instead. +Avoid calling `finalize()` in application code. Allow the JVM to determine a garbage collection schedule instead. ## Example @@ -19,7 +19,7 @@ public class Test { # Implementation Notes -This rule is focused on the use of existing `finalize` invocations rather than attempts to write a custom implementation. +This rule is focused on the use of existing `finalize()` invocations rather than attempts to write a custom implementation. ## References diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 592a27ef6616..3b6be7b652dd 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -1,8 +1,8 @@ /** * @id java/do-not-call-finalize * @previous-id java/do-not-use-finalizers - * @name Do not call `finalize` - * @description Calling `finalize` in application code may cause + * @name Do not call `finalize()` + * @description Calling `finalize()` in application code may cause * inconsistent program state or unpredicatable behavior. * @kind problem * @precision high @@ -16,13 +16,13 @@ import java from MethodCall mc where - mc.getMethod().hasName("finalize") and - // The Java documentation for `finalize` states: "If a subclass overrides + mc.getMethod() instanceof FinalizeMethod and + // The Java documentation for `finalize()` states: "If a subclass overrides // `finalize` it must invoke the superclass finalizer explicitly". Therefore, - // we do not alert on `super.finalize` calls that occur within a callable + // we do not alert on `super.finalize()` calls that occur within a callable // that overrides `finalize`. not exists(Callable caller, FinalizeMethod fm | caller = mc.getCaller() | caller.(Method).overrides(fm) and mc.getQualifier() instanceof SuperAccess ) -select mc, "Call to 'finalize'." +select mc, "Call to 'finalize()'." diff --git a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md index 101b94136a15..8317dce595c1 100644 --- a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md +++ b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md @@ -1,4 +1,4 @@ --- category: newQuery --- -* Added a new quality query, `java/do-not-call-finalize`, to detect calls to `finalize`. +* Added a new quality query, `java/do-not-call-finalize`, to detect calls to `finalize()`. diff --git a/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected index 2445343c293f..ac3c4fa59c01 100644 --- a/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected +++ b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected @@ -1,2 +1 @@ -| Test.java:4:9:4:23 | finalize(...) | Call to 'finalize'. | -| Test.java:25:9:25:33 | finalize(...) | Call to 'finalize'. | +| Test.java:4:9:4:23 | finalize(...) | Call to 'finalize()'. | diff --git a/java/ql/test/query-tests/DoNotCallFinalize/Test.java b/java/ql/test/query-tests/DoNotCallFinalize/Test.java index 3ef4e74e4dc3..eb7ac19da593 100644 --- a/java/ql/test/query-tests/DoNotCallFinalize/Test.java +++ b/java/ql/test/query-tests/DoNotCallFinalize/Test.java @@ -10,7 +10,7 @@ void f1() throws Throwable { @Override protected void finalize() throws Throwable { - // COMPLIANT: If a subclass overrides `finalize` + // COMPLIANT: If a subclass overrides `finalize()` // it must invoke the superclass finalizer explicitly. super.finalize(); } @@ -20,9 +20,9 @@ protected void finalize(String s) throws Throwable { System.out.println(s); } - // NON_COMPLIANT: call to overload of `finalize` + // COMPLIANT: call to overload of `finalize` void f2() throws Throwable { - this.finalize("overload"); // $ Alert + this.finalize("overload"); } } From 3631df03c7faec4d2d4371f73217a783164cfb3f Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 19:38:10 -0400 Subject: [PATCH 023/240] Java: add to code-quality suite --- java/ql/src/codeql-suites/java-code-quality.qls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/codeql-suites/java-code-quality.qls b/java/ql/src/codeql-suites/java-code-quality.qls index ac1f52624c4f..552d803eec11 100644 --- a/java/ql/src/codeql-suites/java-code-quality.qls +++ b/java/ql/src/codeql-suites/java-code-quality.qls @@ -11,4 +11,5 @@ - java/unused-container - java/input-resource-leak - java/output-resource-leak - - java/type-variable-hides-type \ No newline at end of file + - java/type-variable-hides-type + - java/do-not-call-finalize From caf21a8202c3055273d5955e2fc273c58881fe82 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 20:20:48 -0400 Subject: [PATCH 024/240] Java: update qhelp and add 'performace' tag --- .../Undesirable Calls/DoNotCallFinalize.md | 5 +++-- .../Undesirable Calls/DoNotCallFinalize.ql | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 9c3e3ebd4a03..46dd0802b961 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -1,6 +1,6 @@ ## Overview -Calling `finalize()` in application code may cause inconsistent program state or unpredicatable behavior. +Triggering garbage collection by directly calling `finalize()` may either have no effect or may trigger unnecessary garbage collection, leading to erratic behavior, performance issues, or deadlock. ## Recommendation @@ -23,5 +23,6 @@ This rule is focused on the use of existing `finalize()` invocations rather than ## References -- Carnegie Mellon University, SEI CERT Oracle Coding Standard for Java: [MET12-J. Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers). +- SEI CERT Oracle Coding Standard for Java: [MET12-J. Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers). +- Java API Specification: [Object.finalize()](https://docs.oracle.com/javase/10/docs/api/java/lang/Object.html#finalize()). - Common Weakness Enumeration: [CWE-586](https://cwe.mitre.org/data/definitions/586). diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 3b6be7b652dd..8ee12909a6d7 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -9,6 +9,7 @@ * @problem.severity error * @tags quality * correctness + * performance * external/cwe/cwe-586 */ From 92cdddf6047c12d773845a2db35186bbce87937e Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 21:29:20 -0400 Subject: [PATCH 025/240] Java: resolve filename conflict --- java/ql/src/codeql-suites/{java-ccr.qls => java-code-quality.qls} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename java/ql/src/codeql-suites/{java-ccr.qls => java-code-quality.qls} (100%) diff --git a/java/ql/src/codeql-suites/java-ccr.qls b/java/ql/src/codeql-suites/java-code-quality.qls similarity index 100% rename from java/ql/src/codeql-suites/java-ccr.qls rename to java/ql/src/codeql-suites/java-code-quality.qls From 416643ce3906480834d6592b19a5fb1f3aaab37e Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Mon, 31 Mar 2025 21:09:21 -0400 Subject: [PATCH 026/240] Java: update qhelp recommendation and example --- .../Undesirable Calls/DoNotCallFinalize.md | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 46dd0802b961..26c46286cd5d 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -4,14 +4,43 @@ Triggering garbage collection by directly calling `finalize()` may either have n ## Recommendation -Avoid calling `finalize()` in application code. Allow the JVM to determine a garbage collection schedule instead. +Avoid calling `finalize()` in application code. Allow the JVM to determine a garbage collection schedule instead. If you need to explicitly release resources, provide a specific method to do so, such as by implementing the `AutoCloseable` interface and overriding its `close` method. You can then use a `try-with-resources` block to ensure that the resource is closed. ## Example ```java -public class Test { - void f() throws Throwable { - this.finalize(); // NON_COMPLIANT +class LocalCache { + private Collection cacheFiles = ...; + // ... +} + +void main() { + LocalCache cache = new LocalCache(); + // ... + cache.finalize(); // NON_COMPLIANT +} + +``` + +```java +import java.lang.AutoCloseable; +import java.lang.Override; + +class LocalCache implements AutoCloseable { + private Collection cacheFiles = ...; + // ... + + @Override + public void close() throws Exception { + // release resources here if required + } +} + +void main() { + // COMPLIANT: uses try-with-resources to ensure that + // a resource implementing AutoCloseable is closed. + try (LocalCache cache = new LocalCache()) { + // ... } } @@ -25,4 +54,6 @@ This rule is focused on the use of existing `finalize()` invocations rather than - SEI CERT Oracle Coding Standard for Java: [MET12-J. Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers). - Java API Specification: [Object.finalize()](https://docs.oracle.com/javase/10/docs/api/java/lang/Object.html#finalize()). +- Java API Specification: [Interface AutoCloseable](https://docs.oracle.com/javase/10/docs/api/java/lang/AutoCloseable.html). +- Java SE Documentation: [The try-with-resources Statement](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html). - Common Weakness Enumeration: [CWE-586](https://cwe.mitre.org/data/definitions/586). From 0ccbe3ef7fb3c97c877f36744b88be3c921cd683 Mon Sep 17 00:00:00 2001 From: Alex Eyers-Taylor Date: Tue, 25 Mar 2025 16:13:44 +0000 Subject: [PATCH 027/240] Ruby: Make module graph queries avoid relying on evalaution order. --- .../library-tests/modules/ancestors.expected | 20 +++++------ .../test/library-tests/modules/ancestors.ql | 35 ++++++++++++------- .../modules/superclasses.expected | 20 +++++------ .../library-tests/modules/superclasses.ql | 35 ++++++++++++------- 4 files changed, 66 insertions(+), 44 deletions(-) diff --git a/ruby/ql/test/library-tests/modules/ancestors.expected b/ruby/ql/test/library-tests/modules/ancestors.expected index 942bb00ccacc..b8ebd1d1a521 100644 --- a/ruby/ql/test/library-tests/modules/ancestors.expected +++ b/ruby/ql/test/library-tests/modules/ancestors.expected @@ -1,25 +1,21 @@ +#-----| BasicObject + #-----| Class #-----| super -> Module -#-----| EsotericInstanceMethods - -#-----| MyStruct - -#-----| Struct - -#-----| UnresolvedNamespace - -#-----| BasicObject - #-----| Complex #-----| super -> Numeric +#-----| EsotericInstanceMethods + #-----| FalseClass #-----| super -> Object #-----| Float #-----| super -> Numeric +#-----| MyStruct + #-----| NilClass #-----| super -> Object @@ -31,11 +27,15 @@ #-----| Rational #-----| super -> Numeric +#-----| Struct + #-----| Symbol #-----| TrueClass #-----| super -> Object +#-----| UnresolvedNamespace + #-----| UnresolvedNamespace::X1 #-----| UnresolvedNamespace::X1::X2 diff --git a/ruby/ql/test/library-tests/modules/ancestors.ql b/ruby/ql/test/library-tests/modules/ancestors.ql index 89f1c9ca256a..2c1e4e5af71a 100644 --- a/ruby/ql/test/library-tests/modules/ancestors.ql +++ b/ruby/ql/test/library-tests/modules/ancestors.ql @@ -5,22 +5,33 @@ import codeql.ruby.AST +int locationModuleRank(Module node) { + node = + rank[result](Module m, Location l | + l = m.getLocation() + | + m + order by + l.getFile().getBaseName(), l.getFile().getAbsolutePath(), l.getStartLine(), + l.getStartColumn(), l.getEndLine(), l.getEndColumn(), m.toString() + ) +} + +int stringModuleRank(Module node) { + node = rank[result](Module m | not exists(locationModuleRank(m)) | m order by m.toString()) +} + +int moduleRank(Module node) { + result = locationModuleRank(node) + max(stringModuleRank(_)) + or + result = stringModuleRank(node) +} + query predicate nodes(Module node, string key, string value) { key = "semmle.label" and value = node.toString() or key = "semmle.order" and - value = - any(int i | - node = - rank[i](Module m, Location l | - l = m.getLocation() - | - m - order by - l.getFile().getBaseName(), l.getFile().getAbsolutePath(), l.getStartLine(), - l.getStartColumn(), l.getEndLine(), l.getEndColumn(), m.toString() - ) - ).toString() + value = moduleRank(node).toString() } Module getATarget(Module source, string value) { diff --git a/ruby/ql/test/library-tests/modules/superclasses.expected b/ruby/ql/test/library-tests/modules/superclasses.expected index ca19e00a71ad..60acb625eaf2 100644 --- a/ruby/ql/test/library-tests/modules/superclasses.expected +++ b/ruby/ql/test/library-tests/modules/superclasses.expected @@ -1,25 +1,21 @@ +#-----| BasicObject + #-----| Class #-----| -> Module -#-----| EsotericInstanceMethods - -#-----| MyStruct - -#-----| Struct - -#-----| UnresolvedNamespace - -#-----| BasicObject - #-----| Complex #-----| -> Numeric +#-----| EsotericInstanceMethods + #-----| FalseClass #-----| -> Object #-----| Float #-----| -> Numeric +#-----| MyStruct + #-----| NilClass #-----| -> Object @@ -31,11 +27,15 @@ #-----| Rational #-----| -> Numeric +#-----| Struct + #-----| Symbol #-----| TrueClass #-----| -> Object +#-----| UnresolvedNamespace + #-----| UnresolvedNamespace::X1 #-----| UnresolvedNamespace::X1::X2 diff --git a/ruby/ql/test/library-tests/modules/superclasses.ql b/ruby/ql/test/library-tests/modules/superclasses.ql index e8f4fd027047..f3dfd43a80d7 100644 --- a/ruby/ql/test/library-tests/modules/superclasses.ql +++ b/ruby/ql/test/library-tests/modules/superclasses.ql @@ -5,22 +5,33 @@ import codeql.ruby.AST +int locationModuleRank(Module node) { + node = + rank[result](Module m, Location l | + l = m.getLocation() + | + m + order by + l.getFile().getBaseName(), l.getFile().getAbsolutePath(), l.getStartLine(), + l.getStartColumn(), l.getEndLine(), l.getEndColumn(), m.toString() + ) +} + +int stringModuleRank(Module node) { + node = rank[result](Module m | not exists(locationModuleRank(m)) | m order by m.toString()) +} + +int moduleRank(Module node) { + result = locationModuleRank(node) + max(stringModuleRank(_)) + or + result = stringModuleRank(node) +} + query predicate nodes(Module node, string key, string value) { key = "semmle.label" and value = node.toString() or key = "semmle.order" and - value = - any(int i | - node = - rank[i](Module m, Location l | - l = m.getLocation() - | - m - order by - l.getFile().getBaseName(), l.getFile().getAbsolutePath(), l.getStartLine(), - l.getStartColumn(), l.getEndLine(), l.getEndColumn(), m.toString() - ) - ).toString() + value = moduleRank(node).toString() } query predicate edges(Module source, Module target, string key, string value) { From faeb7ab8909eefb087cdc1cf235506c875bbf451 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Tue, 1 Apr 2025 14:54:46 -0400 Subject: [PATCH 028/240] Java: add blank lines to qldocs --- java/ql/lib/semmle/code/java/UnitTests.qll | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll index 25452d0fd514..f229440e4eed 100644 --- a/java/ql/lib/semmle/code/java/UnitTests.qll +++ b/java/ql/lib/semmle/code/java/UnitTests.qll @@ -127,10 +127,12 @@ class JUnitJupiterTestMethod extends Method { /** * A JUnit 5 test method. + * * A test method is defined by JUnit as "any instance method * that is directly annotated or meta-annotated with `@Test`, * `@RepeatedTest`, `@ParameterizedTest`, `@TestFactory`, or * `@TestTemplate`." + * * See https://junit.org/junit5/docs/current/user-guide/#writing-tests-definitions */ class JUnit5TestMethod extends Method { @@ -147,8 +149,10 @@ class JUnit5TestMethod extends Method { /** * A JUnit 5 test class. + * * A test class must contain at least one test method, and * cannot be abstract. + * * See https://junit.org/junit5/docs/current/user-guide/#writing-tests-definitions */ class JUnit5TestClass extends Class { From e621f9fd4903d60ca266e87afbd8f9969955bddc Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Tue, 1 Apr 2025 15:48:52 -0400 Subject: [PATCH 029/240] Java: update comments in tests --- java/ql/test/query-tests/DoNotCallFinalize/Test.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/ql/test/query-tests/DoNotCallFinalize/Test.java b/java/ql/test/query-tests/DoNotCallFinalize/Test.java index eb7ac19da593..b70d0e47581a 100644 --- a/java/ql/test/query-tests/DoNotCallFinalize/Test.java +++ b/java/ql/test/query-tests/DoNotCallFinalize/Test.java @@ -17,11 +17,11 @@ protected void finalize() throws Throwable { // Overload of `finalize` protected void finalize(String s) throws Throwable { - System.out.println(s); + // ... } - // COMPLIANT: call to overload of `finalize` void f2() throws Throwable { + // COMPLIANT: call to overload of `finalize` this.finalize("overload"); } From c4b83963334bb29137d921e3dbf4bf5a221bee01 Mon Sep 17 00:00:00 2001 From: Jami <57204504+jcogs33@users.noreply.github.com> Date: Tue, 1 Apr 2025 15:52:57 -0400 Subject: [PATCH 030/240] fix typo in query description Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com> --- .../Undesirable Calls/DoNotCallFinalize.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 8ee12909a6d7..80171e4d49e3 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -3,7 +3,7 @@ * @previous-id java/do-not-use-finalizers * @name Do not call `finalize()` * @description Calling `finalize()` in application code may cause - * inconsistent program state or unpredicatable behavior. + * inconsistent program state or unpredictable behavior. * @kind problem * @precision high * @problem.severity error From 1a2c34dd28d25eba9d1c214af07bf569f6c6a492 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Tue, 1 Apr 2025 16:24:13 -0400 Subject: [PATCH 031/240] Java: update qhelp implementation notes for clarity --- .../Undesirable Calls/DoNotCallFinalize.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 26c46286cd5d..b2bcfdae6127 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -48,7 +48,8 @@ void main() { # Implementation Notes -This rule is focused on the use of existing `finalize()` invocations rather than attempts to write a custom implementation. +This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on overrides of `finalize()`. + ## References From 6ade97892f3a43dddd60b3fe4402bba4c34d9d26 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Wed, 2 Apr 2025 19:06:02 -0400 Subject: [PATCH 032/240] Java: update maintainability tag to reliability instead --- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index 3540ad8d9427..8072a68c61db 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -9,7 +9,7 @@ * @precision very-high * @problem.severity warning * @tags quality - * maintainability + * reliability * correctness * testability * frameworks/junit From 05d7b9a19a1e84266fbb5f46505c3a577b7f99f8 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Wed, 2 Apr 2025 19:11:26 -0400 Subject: [PATCH 033/240] Java: add reliability tag --- .../Undesirable Calls/DoNotCallFinalize.ql | 1 + 1 file changed, 1 insertion(+) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 80171e4d49e3..1abe96f91857 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -8,6 +8,7 @@ * @precision high * @problem.severity error * @tags quality + * reliability * correctness * performance * external/cwe/cwe-586 From 0380279c39079c713a1d64a412669b18abccee7a Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Wed, 2 Apr 2025 19:43:33 -0400 Subject: [PATCH 034/240] Java: update qhelp implementation notes for more clarity --- .../Undesirable Calls/DoNotCallFinalize.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index b2bcfdae6127..46ce835d50d7 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -48,8 +48,7 @@ void main() { # Implementation Notes -This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on overrides of `finalize()`. - +This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on method overrides of `finalize()`. ## References From fc21abc7e4af6b6b1045c5b3e25e8a7114126680 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 3 Apr 2025 16:05:23 -0400 Subject: [PATCH 035/240] Java: update qhelp implementation notes to say 'method declarations' --- .../Undesirable Calls/DoNotCallFinalize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 46ce835d50d7..d6fd5cf76bd4 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -48,7 +48,7 @@ void main() { # Implementation Notes -This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on method overrides of `finalize()`. +This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on method declarations overriding `finalize()`. ## References From 77eeab33a6a985038b0b6c64ad90d93ca5a86bb5 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 4 Apr 2025 13:57:34 -0400 Subject: [PATCH 036/240] Java: remove change note --- .../2025-03-21-junit-missing-nested-annotation.md | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md diff --git a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md deleted file mode 100644 index c663ddc04f6d..000000000000 --- a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: newQuery ---- -* Added a new quality query, `java/junit5-missing-nested-annotation`, to detect missing `@Nested` annotations on JUnit 5 inner test classes. From 798907dc5045d644d67e15ac2130a5f48c4f66fe Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 4 Apr 2025 14:01:35 -0400 Subject: [PATCH 037/240] Java: remove change note --- java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md diff --git a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md deleted file mode 100644 index 8317dce595c1..000000000000 --- a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: newQuery ---- -* Added a new quality query, `java/do-not-call-finalize`, to detect calls to `finalize()`. From db9c908d1d8d7491fe1314cc3887e7e5305f10b2 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 14:30:00 +0200 Subject: [PATCH 038/240] Cargo: upgrade dependencies --- Cargo.lock | 282 +++++----- MODULE.bazel | 34 +- ...UILD.android_system_properties-0.1.5.bazel | 2 +- .../tree_sitter_extractors_deps/BUILD.bazel | 106 ++-- ...2.8.0.bazel => BUILD.bitflags-2.9.0.bazel} | 2 +- ...sh-1.5.3.bazel => BUILD.borsh-1.5.5.bazel} | 6 +- ...azel => BUILD.cargo_metadata-0.19.2.bazel} | 8 +- .../BUILD.chalk-ir-0.100.0.bazel | 2 +- .../BUILD.chalk-solve-0.100.0.bazel | 2 +- ...p-4.5.32.bazel => BUILD.clap-4.5.35.bazel} | 4 +- ....bazel => BUILD.clap_builder-4.5.35.bazel} | 2 +- .../BUILD.ena-0.14.3.bazel | 2 +- ...0.1.bazel => BUILD.equivalent-1.0.2.bazel} | 2 +- .../BUILD.filetime-0.2.25.bazel | 48 +- .../BUILD.fsevent-sys-4.1.0.bazel | 2 +- .../BUILD.generator-0.8.4.bazel | 50 +- .../BUILD.getrandom-0.3.1.bazel | 44 +- .../BUILD.globset-0.4.15.bazel | 2 +- .../BUILD.hashbrown-0.15.2.bazel | 2 +- ...2.7.0.bazel => BUILD.indexmap-2.9.0.bazel} | 4 +- .../BUILD.inotify-0.11.0.bazel | 4 +- .../BUILD.inotify-sys-0.1.5.bazel | 2 +- ...a-1.0.14.bazel => BUILD.itoa-1.0.15.bazel} | 2 +- .../BUILD.kqueue-1.0.8.bazel | 2 +- .../BUILD.kqueue-sys-1.0.4.bazel | 2 +- ...0.2.169.bazel => BUILD.libc-0.2.171.bazel} | 6 +- .../BUILD.libredox-0.1.3.bazel | 4 +- .../BUILD.log-0.3.9.bazel | 2 +- ...og-0.4.25.bazel => BUILD.log-0.4.27.bazel} | 2 +- .../BUILD.lz4_flex-0.11.3.bazel | 83 --- .../BUILD.mio-1.0.3.bazel | 52 +- .../BUILD.notify-8.0.0.bazel | 10 +- .../BUILD.num_cpus-1.16.0.bazel | 66 +-- ....1.4.bazel => BUILD.oorandom-11.1.5.bazel} | 2 +- .../BUILD.parking_lot_core-0.9.10.bazel | 48 +- .../BUILD.perf-event-0.4.7.bazel | 2 +- .../BUILD.perf-event-open-sys-1.0.1.bazel | 2 +- .../BUILD.petgraph-0.6.5.bazel | 2 +- .../BUILD.proc-macro2-1.0.94.bazel | 2 +- .../BUILD.ra-ap-rustc_abi-0.100.0.bazel | 2 +- ...ra-ap-rustc_pattern_analysis-0.100.0.bazel | 2 +- ...azel => BUILD.ra_ap_base_db-0.0.273.bazel} | 31 +- ...70.bazel => BUILD.ra_ap_cfg-0.0.273.bazel} | 10 +- ...azel => BUILD.ra_ap_edition-0.0.273.bazel} | 2 +- ...70.bazel => BUILD.ra_ap_hir-0.0.273.bazel} | 46 +- ...azel => BUILD.ra_ap_hir_def-0.0.273.bazel} | 54 +- ...l => BUILD.ra_ap_hir_expand-0.0.273.bazel} | 50 +- ...bazel => BUILD.ra_ap_hir_ty-0.0.273.bazel} | 46 +- ...bazel => BUILD.ra_ap_ide_db-0.0.273.bazel} | 45 +- ...bazel => BUILD.ra_ap_intern-0.0.273.bazel} | 2 +- ...l => BUILD.ra_ap_load-cargo-0.0.273.bazel} | 42 +- ...70.bazel => BUILD.ra_ap_mbe-0.0.273.bazel} | 29 +- ...bazel => BUILD.ra_ap_parser-0.0.273.bazel} | 6 +- ....bazel => BUILD.ra_ap_paths-0.0.273.bazel} | 2 +- ... BUILD.ra_ap_proc_macro_api-0.0.273.bazel} | 24 +- ...azel => BUILD.ra_ap_profile-0.0.273.bazel} | 12 +- ...> BUILD.ra_ap_project_model-0.0.273.bazel} | 36 +- ...ILD.ra_ap_query-group-macro-0.0.273.bazel} | 4 +- ...0.bazel => BUILD.ra_ap_span-0.0.273.bazel} | 18 +- ...0.bazel => BUILD.ra_ap_stdx-0.0.273.bazel} | 77 ++- ...bazel => BUILD.ra_ap_syntax-0.0.273.bazel} | 14 +- ...> BUILD.ra_ap_syntax-bridge-0.0.273.bazel} | 27 +- ...el => BUILD.ra_ap_toolchain-0.0.273.bazel} | 2 +- ...270.bazel => BUILD.ra_ap_tt-0.0.273.bazel} | 10 +- ...70.bazel => BUILD.ra_ap_vfs-0.0.273.bazel} | 12 +- ...l => BUILD.ra_ap_vfs-notify-0.0.273.bazel} | 14 +- .../BUILD.redox_syscall-0.5.8.bazel | 2 +- ...stc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel} | 8 +- .../BUILD.salsa-0.19.0.bazel | 2 +- ...1.0.24.bazel => BUILD.semver-1.0.26.bazel} | 6 +- .../BUILD.serde_json-1.0.140.bazel | 2 +- .../BUILD.serde_yaml-0.9.34+deprecated.bazel | 4 +- .../BUILD.syn-2.0.100.bazel | 2 +- .../BUILD.thin-vec-0.2.14.bazel | 87 +++ ....69.bazel => BUILD.thiserror-2.0.12.bazel} | 16 +- ...azel => BUILD.thiserror-impl-2.0.12.bazel} | 2 +- .../BUILD.toml_edit-0.22.24.bazel | 2 +- .../BUILD.tracing-log-0.2.0.bazel | 2 +- ...bazel => BUILD.unicode-ident-1.0.17.bazel} | 2 +- .../BUILD.wasm-bindgen-backend-0.2.99.bazel | 2 +- .../tree_sitter_extractors_deps/defs.bzl | 507 +++++++++--------- rust/ast-generator/Cargo.toml | 2 +- rust/extractor/Cargo.toml | 32 +- 83 files changed, 1133 insertions(+), 1067 deletions(-) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.bitflags-2.8.0.bazel => BUILD.bitflags-2.9.0.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.borsh-1.5.3.bazel => BUILD.borsh-1.5.5.bazel} (97%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.cargo_metadata-0.18.1.bazel => BUILD.cargo_metadata-0.19.2.bazel} (96%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.clap-4.5.32.bazel => BUILD.clap-4.5.35.bazel} (97%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.clap_builder-4.5.32.bazel => BUILD.clap_builder-4.5.35.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.equivalent-1.0.1.bazel => BUILD.equivalent-1.0.2.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.indexmap-2.7.0.bazel => BUILD.indexmap-2.9.0.bazel} (98%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.itoa-1.0.14.bazel => BUILD.itoa-1.0.15.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.libc-0.2.169.bazel => BUILD.libc-0.2.171.bazel} (97%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.log-0.4.25.bazel => BUILD.log-0.4.27.bazel} (99%) delete mode 100644 misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.lz4_flex-0.11.3.bazel rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.oorandom-11.1.4.bazel => BUILD.oorandom-11.1.5.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_base_db-0.0.270.bazel => BUILD.ra_ap_base_db-0.0.273.bazel} (80%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_cfg-0.0.270.bazel => BUILD.ra_ap_cfg-0.0.273.bazel} (93%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_edition-0.0.270.bazel => BUILD.ra_ap_edition-0.0.273.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_hir-0.0.270.bazel => BUILD.ra_ap_hir-0.0.273.bazel} (74%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_hir_def-0.0.270.bazel => BUILD.ra_ap_hir_def-0.0.273.bazel} (73%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_hir_expand-0.0.270.bazel => BUILD.ra_ap_hir_expand-0.0.273.bazel} (73%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_hir_ty-0.0.270.bazel => BUILD.ra_ap_hir_ty-0.0.273.bazel} (77%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_ide_db-0.0.270.bazel => BUILD.ra_ap_ide_db-0.0.273.bazel} (76%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_intern-0.0.270.bazel => BUILD.ra_ap_intern-0.0.273.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_load-cargo-0.0.270.bazel => BUILD.ra_ap_load-cargo-0.0.273.bazel} (75%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_mbe-0.0.270.bazel => BUILD.ra_ap_mbe-0.0.273.bazel} (80%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_parser-0.0.270.bazel => BUILD.ra_ap_parser-0.0.273.bazel} (96%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_paths-0.0.270.bazel => BUILD.ra_ap_paths-0.0.273.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_proc_macro_api-0.0.270.bazel => BUILD.ra_ap_proc_macro_api-0.0.273.bazel} (85%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_profile-0.0.270.bazel => BUILD.ra_ap_profile-0.0.273.bazel} (86%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_project_model-0.0.270.bazel => BUILD.ra_ap_project_model-0.0.273.bazel} (79%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_query-group-macro-0.0.270.bazel => BUILD.ra_ap_query-group-macro-0.0.273.bazel} (97%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_span-0.0.270.bazel => BUILD.ra_ap_span-0.0.273.bazel} (89%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_stdx-0.0.270.bazel => BUILD.ra_ap_stdx-0.0.273.bazel} (57%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_syntax-0.0.270.bazel => BUILD.ra_ap_syntax-0.0.273.bazel} (90%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_syntax-bridge-0.0.270.bazel => BUILD.ra_ap_syntax-bridge-0.0.273.bazel} (82%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_toolchain-0.0.270.bazel => BUILD.ra_ap_toolchain-0.0.273.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_tt-0.0.270.bazel => BUILD.ra_ap_tt-0.0.273.bazel} (93%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_vfs-0.0.270.bazel => BUILD.ra_ap_vfs-0.0.273.bazel} (92%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_vfs-notify-0.0.270.bazel => BUILD.ra_ap_vfs-notify-0.0.273.bazel} (91%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel => BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel} (96%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.semver-1.0.24.bazel => BUILD.semver-1.0.26.bazel} (97%) create mode 100644 misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thin-vec-0.2.14.bazel rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.thiserror-1.0.69.bazel => BUILD.thiserror-2.0.12.bazel} (94%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.thiserror-impl-1.0.69.bazel => BUILD.thiserror-impl-2.0.12.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.unicode-ident-1.0.16.bazel => BUILD.unicode-ident-1.0.17.bazel} (99%) diff --git a/Cargo.lock b/Cargo.lock index 7719e26ffd24..cd9023a315fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -154,15 +154,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "borsh" -version = "1.5.3" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" +checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" dependencies = [ "cfg_aliases", ] @@ -224,9 +224,9 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.18.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" dependencies = [ "camino", "cargo-platform", @@ -275,7 +275,7 @@ version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f114996bda14c0213f014a4ef31a7867dcf5f539a3900477fc6b20138e7a17b" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "chalk-derive", ] @@ -301,7 +301,7 @@ dependencies = [ "chalk-derive", "chalk-ir", "ena", - "indexmap 2.7.0", + "indexmap 2.9.0", "itertools 0.12.1", "petgraph", "rustc-hash 1.1.0", @@ -325,9 +325,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" dependencies = [ "clap_builder", "clap_derive", @@ -335,9 +335,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" dependencies = [ "anstream", "anstyle", @@ -622,7 +622,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" dependencies = [ - "log 0.4.25", + "log 0.4.27", ] [[package]] @@ -691,9 +691,9 @@ checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "figment" @@ -781,7 +781,7 @@ checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" dependencies = [ "cfg-if", "libc", - "log 0.4.25", + "log 0.4.27", "rustversion", "windows", ] @@ -812,7 +812,7 @@ checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", - "log 0.4.25", + "log 0.4.27", "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -918,9 +918,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -939,7 +939,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "inotify-sys", "libc", ] @@ -979,9 +979,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jod-thread" @@ -1033,9 +1033,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libredox" @@ -1043,7 +1043,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "libc", "redox_syscall", ] @@ -1074,14 +1074,14 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" dependencies = [ - "log 0.4.25", + "log 0.4.27", ] [[package]] name = "log" -version = "0.4.25" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "loom" @@ -1096,12 +1096,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "lz4_flex" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" - [[package]] name = "matchers" version = "0.1.0" @@ -1142,7 +1136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", - "log 0.4.25", + "log 0.4.27", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -1178,13 +1172,13 @@ version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "filetime", "fsevent-sys", "inotify", "kqueue", "libc", - "log 0.4.25", + "log 0.4.27", "mio", "notify-types", "walkdir", @@ -1240,9 +1234,9 @@ checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "oorandom" -version = "11.1.4" +version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "os_str_bytes" @@ -1331,7 +1325,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.7.0", + "indexmap 2.9.0", ] [[package]] @@ -1398,7 +1392,7 @@ version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1651b0f7e8c3eb7c27a88f39d277e69c32bfe58e3be174d286c1a24d6a7a4d8" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "ra-ap-rustc_hashes", "ra-ap-rustc_index", "tracing", @@ -1470,18 +1464,16 @@ dependencies = [ [[package]] name = "ra_ap_base_db" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4baa9734d254af14fd603528ad594650dea601b1764492bd39988da38598ae67" +checksum = "8fd761118bbafe29e2b187e694c6b8e800f2c7822bbc1d9d2db4ac21fb8b0365" dependencies = [ "dashmap 5.5.3", "la-arena", - "lz4_flex", "ra_ap_cfg", "ra_ap_intern", "ra_ap_query-group-macro", "ra_ap_span", - "ra_ap_stdx", "ra_ap_syntax", "ra_ap_vfs", "rustc-hash 2.1.1", @@ -1493,9 +1485,9 @@ dependencies = [ [[package]] name = "ra_ap_cfg" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef2ba45636c5e585040c0c4bee640737a6001b08309f1a25ca78cf04abfbf90" +checksum = "5ce74ce1af24afd86d3529dbbf5a849d026948b2d8ba51d199b6ea6db6e345b6" dependencies = [ "ra_ap_intern", "ra_ap_tt", @@ -1505,20 +1497,20 @@ dependencies = [ [[package]] name = "ra_ap_edition" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8955c1484d5e7274f755187788ba0d51eb149f870c69cdf0d87c3b7edea20ea0" +checksum = "f423b9fb19e3920e4c7039120d09d9c79070a26efe8ff9f787c7234b07f518c5" [[package]] name = "ra_ap_hir" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a51d7955beff2212701b149bea36d4cf2dc0f5cd129652c9bcf0cb5c0b021078" +checksum = "dd4aa8a568b80d288b90c4fa5dc8a3cc405914d261bfd33a3761c1ba41be358d" dependencies = [ "arrayvec", "either", - "indexmap 2.7.0", - "itertools 0.12.1", + "indexmap 2.9.0", + "itertools 0.14.0", "ra_ap_base_db", "ra_ap_cfg", "ra_ap_hir_def", @@ -1537,23 +1529,20 @@ dependencies = [ [[package]] name = "ra_ap_hir_def" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c97e617e4c585d24b3d4f668861452aedddfbe0262f4c53235dcea77e62f9b" +checksum = "acb18d9378a828a23ccf87b89199db005adb67ba2a05a37d7a3fcad4d1036e66" dependencies = [ "arrayvec", - "bitflags 2.8.0", + "bitflags 2.9.0", "cov-mark", - "dashmap 5.5.3", "drop_bomb", "either", "fst", - "hashbrown 0.14.5", - "indexmap 2.7.0", - "itertools 0.12.1", + "indexmap 2.9.0", + "itertools 0.14.0", "la-arena", "ra-ap-rustc_abi", - "ra-ap-rustc_hashes", "ra-ap-rustc_parse_format", "ra_ap_base_db", "ra_ap_cfg", @@ -1570,21 +1559,20 @@ dependencies = [ "salsa", "smallvec", "text-size", + "thin-vec", "tracing", "triomphe", ] [[package]] name = "ra_ap_hir_expand" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57c0d7e3f2180dd8ea584b11447f34060eadc06f0f6d559e2a790f6e91b6c5" +checksum = "094fa79d8f661f52cf3b7fb8b3d91c4be2ad9e71a3967d3dacd25429fa44b37d" dependencies = [ "cov-mark", "either", - "hashbrown 0.14.5", - "itertools 0.12.1", - "la-arena", + "itertools 0.14.0", "ra_ap_base_db", "ra_ap_cfg", "ra_ap_intern", @@ -1605,24 +1593,22 @@ dependencies = [ [[package]] name = "ra_ap_hir_ty" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f260f35748f3035b46a8afcdebda7cb75d95c24750105fad86101d09a9d387c8" +checksum = "093482d200d5db421db5692e7819bbb14fb717cc8cb0f91f93cce9fde85b3df2" dependencies = [ "arrayvec", - "bitflags 2.8.0", + "bitflags 2.9.0", "chalk-derive", "chalk-ir", "chalk-recursive", "chalk-solve", "cov-mark", - "dashmap 5.5.3", "either", "ena", - "indexmap 2.7.0", - "itertools 0.12.1", + "indexmap 2.9.0", + "itertools 0.14.0", "la-arena", - "nohash-hasher", "oorandom", "ra-ap-rustc_abi", "ra-ap-rustc_index", @@ -1647,19 +1633,18 @@ dependencies = [ [[package]] name = "ra_ap_ide_db" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0426263be26e27cb55a3b9ef88b120511b66fe7d9b418a2473d6d5f3ac2fe0a6" +checksum = "b655b92dfa9444db8129321b9217d9e4a83a58ee707aa1004a93052acfb43d57" dependencies = [ "arrayvec", - "bitflags 2.8.0", + "bitflags 2.9.0", "cov-mark", "crossbeam-channel", - "dashmap 5.5.3", "either", "fst", - "indexmap 2.7.0", - "itertools 0.12.1", + "indexmap 2.9.0", + "itertools 0.14.0", "line-index", "memchr", "nohash-hasher", @@ -1681,9 +1666,9 @@ dependencies = [ [[package]] name = "ra_ap_intern" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ea8c9615b3b0688cf557e7310dbd9432f43860c8ea766d54f4416cbecf3571" +checksum = "b4e528496b4d4c351806bb073d3d7f6526535741b9e8801776603c924bbec624" dependencies = [ "dashmap 5.5.3", "hashbrown 0.14.5", @@ -1693,17 +1678,16 @@ dependencies = [ [[package]] name = "ra_ap_load-cargo" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570907e16725c13a678bfd8050ce8839af2831da042a0878b75ee8c41b0f7b0c" +checksum = "1a97a5070b2f4b99f56683d91b2687aa0c530d8969cc5252ec2ae5644e428ffe" dependencies = [ "anyhow", "crossbeam-channel", - "itertools 0.12.1", + "itertools 0.14.0", "ra_ap_hir_expand", "ra_ap_ide_db", "ra_ap_intern", - "ra_ap_paths", "ra_ap_proc_macro_api", "ra_ap_project_model", "ra_ap_span", @@ -1715,9 +1699,9 @@ dependencies = [ [[package]] name = "ra_ap_mbe" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e893fe03b04b30c9b5a339ac2bf39ce32ac9c05a8b50121b7d89ce658346e164" +checksum = "b187ee5ee3fa726eeea5142242a0397e2200d77084026986a68324b9599f9046" dependencies = [ "arrayvec", "cov-mark", @@ -1726,19 +1710,17 @@ dependencies = [ "ra_ap_parser", "ra_ap_span", "ra_ap_stdx", - "ra_ap_syntax", "ra_ap_syntax-bridge", "ra_ap_tt", "rustc-hash 2.1.1", "smallvec", - "tracing", ] [[package]] name = "ra_ap_parser" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd9a264120968b14a66b6ba756cd7f99435385b5dbc2f0a611cf3a12221c385" +checksum = "2306e6c051e60483f3b317fac9dec6c883b7792eeb8db24ec6f39dbfa5430159" dependencies = [ "drop_bomb", "ra-ap-rustc_lexer", @@ -1748,20 +1730,20 @@ dependencies = [ [[package]] name = "ra_ap_paths" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f47817351651e36b56ff3afc483b41600053c9cb7e67d945467c0abe93416032" +checksum = "dcedd00499621bdd0f1fe01955c04e4b388197aa826744003afaf6cc2944bc80" dependencies = [ "camino", ] [[package]] name = "ra_ap_proc_macro_api" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96da3b8b9f6b813a98f5357eef303905450741f47ba90adaab8a5371b748416" +checksum = "7a2e49b550015cd4ad152bd78d92d73594497f2e44f61273f9fed3534ad4bbbe" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.9.0", "ra_ap_intern", "ra_ap_paths", "ra_ap_span", @@ -1776,9 +1758,9 @@ dependencies = [ [[package]] name = "ra_ap_profile" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13637377287c84f88a628e40229d271ef0081c0d683956bd99a6c8278a4f8b14" +checksum = "87cdbd27ebe02ec21fdae3df303f194bda036a019ecef80d47e0082646f06c54" dependencies = [ "cfg-if", "libc", @@ -1788,13 +1770,13 @@ dependencies = [ [[package]] name = "ra_ap_project_model" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c5207a638fc7a752c7a454bc952b28b0d02f0bf9f6d7ec785ec809579d8fa" +checksum = "5eaa3406c891a7840d20ce615f8decca32cbc9d3654b82dcbcc3a31257ce90b9" dependencies = [ "anyhow", "cargo_metadata", - "itertools 0.12.1", + "itertools 0.14.0", "la-arena", "ra_ap_base_db", "ra_ap_cfg", @@ -1814,22 +1796,20 @@ dependencies = [ [[package]] name = "ra_ap_query-group-macro" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1a38f07b442e47a234cbe2e8fd1b8a41ff0cc5123cb1cf994c5ce20edb5bd6" +checksum = "1fbc1748e4876a9b0ccfacfc7e2fe254f30e92ef58d98925282b3803e8b004ed" dependencies = [ - "heck", "proc-macro2", "quote", - "salsa", "syn", ] [[package]] name = "ra_ap_span" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8818680c6f7da3b32cb2bb0992940b24264b1aa90203aa94812e09ab34d362d1" +checksum = "ed1d036e738bf32a057d90698df85bcb83ed6263b5fe9fba132c99e8ec3aecaf" dependencies = [ "hashbrown 0.14.5", "la-arena", @@ -1843,12 +1823,12 @@ dependencies = [ [[package]] name = "ra_ap_stdx" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c10bee1b03fc48083862c13cf06bd3ed17760463ecce2734103a2f511e5ed4" +checksum = "6e3775954ab24408f71e97079a97558078a166a4082052e83256ae4c22dae18d" dependencies = [ "crossbeam-channel", - "itertools 0.12.1", + "itertools 0.14.0", "jod-thread", "libc", "miow", @@ -1858,14 +1838,12 @@ dependencies = [ [[package]] name = "ra_ap_syntax" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92bc32f3946fc5fcbdc79e61b7e26a8c2a3a56f3ef6ab27c7d298a9e21a462f2" +checksum = "b49b081f209a764700f688db91820a66c2ecfe5f138895d831361cf84f716691" dependencies = [ - "cov-mark", "either", - "indexmap 2.7.0", - "itertools 0.12.1", + "itertools 0.14.0", "ra-ap-rustc_lexer", "ra_ap_parser", "ra_ap_stdx", @@ -1878,9 +1856,9 @@ dependencies = [ [[package]] name = "ra_ap_syntax-bridge" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a42052c44c98c122c37aac476260c8f19d8fec495edc9c05835307c9ae86194d" +checksum = "f2740bbe603d527f2cf0aaf51629de7d072694fbbaaeda8264f7591be1493d1b" dependencies = [ "ra_ap_intern", "ra_ap_parser", @@ -1889,14 +1867,13 @@ dependencies = [ "ra_ap_syntax", "ra_ap_tt", "rustc-hash 2.1.1", - "tracing", ] [[package]] name = "ra_ap_toolchain" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75996e70b3a0c68cd5157ba01f018964c7c6a5d7b209047d449b393139d0b57f" +checksum = "efbff9f26f307ef958586357d1653d000861dcd3acbaf33a009651e024720c7e" dependencies = [ "camino", "home", @@ -1904,9 +1881,9 @@ dependencies = [ [[package]] name = "ra_ap_tt" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4ee31e93bfabe83e6720b7469db88d7ad7ec5c59a1f011efec4aa1327ffc5c" +checksum = "0b1ce3ac14765e414fa6031fda7dc35d3492c74de225aac689ba8b8bf037e1f8" dependencies = [ "arrayvec", "ra-ap-rustc_lexer", @@ -1917,13 +1894,13 @@ dependencies = [ [[package]] name = "ra_ap_vfs" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6aac1e277ac70bb073f40f8a3fc44e4b1bb9e4d4b1d0e0bd2f8269543560f80" +checksum = "29427a7c27ce8ddfefb52d77c952a4588c74d0a7ab064dc627129088a90423ca" dependencies = [ "crossbeam-channel", "fst", - "indexmap 2.7.0", + "indexmap 2.9.0", "nohash-hasher", "ra_ap_paths", "ra_ap_stdx", @@ -1933,9 +1910,9 @@ dependencies = [ [[package]] name = "ra_ap_vfs-notify" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd95285146049621ee8f7a512c982a008bf036321fcc9b01a95c1ad7e6aeae57" +checksum = "d5a0e3095b8216ecc131f38b4b0025cac324a646469a95d2670354aee7278078" dependencies = [ "crossbeam-channel", "notify", @@ -2005,7 +1982,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -2093,10 +2070,11 @@ checksum = "2febf9acc5ee5e99d1ad0afcdbccc02d87aa3f857a1f01f825b80eacf8edfcd1" [[package]] name = "rustc_apfloat" -version = "0.2.1+llvm-462a31f5a5ab" -source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=096d585100636bc2e9f09d7eefec38c5b334d47b#096d585100636bc2e9f09d7eefec38c5b334d47b" +version = "0.2.2+llvm-462a31f5a5ab" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.0", "smallvec", ] @@ -2123,7 +2101,7 @@ dependencies = [ "dashmap 6.1.0", "hashbrown 0.15.2", "hashlink", - "indexmap 2.7.0", + "indexmap 2.9.0", "parking_lot", "portable-atomic", "rayon", @@ -2176,9 +2154,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] @@ -2234,7 +2212,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.7.0", + "indexmap 2.9.0", "serde", "serde_derive", "serde_json", @@ -2260,7 +2238,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.9.0", "itoa", "ryu", "serde", @@ -2344,20 +2322,26 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f18aa187839b2bdb1ad2fa35ead8c4c2976b64e4363c386d45ac0f7ee85c9233" +[[package]] +name = "thin-vec" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "144f754d318415ac792f9d69fc87abbbfc043ce2ef041c60f16ad828f638717d" + [[package]] name = "thiserror" -version = "1.0.69" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", @@ -2432,7 +2416,7 @@ version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", @@ -2488,7 +2472,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "log 0.4.25", + "log 0.4.27", "once_cell", "tracing-core", ] @@ -2603,9 +2587,9 @@ checksum = "a3e5df347f0bf3ec1d670aad6ca5c6a1859cd9ea61d2113125794654ccced68f" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-properties" @@ -2686,7 +2670,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", - "log 0.4.25", + "log 0.4.27", "proc-macro2", "quote", "syn", @@ -2995,7 +2979,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -3044,3 +3028,9 @@ dependencies = [ "quote", "syn", ] + +[[patch.unused]] +name = "rustc_apfloat" +version = "0.2.1+llvm-462a31f5a5ab" +source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=096d585100636bc2e9f09d7eefec38c5b334d47b#096d585100636bc2e9f09d7eefec38c5b334d47b" + diff --git a/MODULE.bazel b/MODULE.bazel index fe418cd40c6d..ae00bca4390d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -75,7 +75,7 @@ use_repo( "vendor_ts__argfile-0.2.1", "vendor_ts__chalk-ir-0.100.0", "vendor_ts__chrono-0.4.40", - "vendor_ts__clap-4.5.32", + "vendor_ts__clap-4.5.35", "vendor_ts__dunce-1.0.5", "vendor_ts__either-1.15.0", "vendor_ts__encoding-0.2.33", @@ -90,22 +90,22 @@ use_repo( "vendor_ts__num_cpus-1.16.0", "vendor_ts__proc-macro2-1.0.94", "vendor_ts__quote-1.0.40", - "vendor_ts__ra_ap_base_db-0.0.270", - "vendor_ts__ra_ap_cfg-0.0.270", - "vendor_ts__ra_ap_hir-0.0.270", - "vendor_ts__ra_ap_hir_def-0.0.270", - "vendor_ts__ra_ap_hir_expand-0.0.270", - "vendor_ts__ra_ap_hir_ty-0.0.270", - "vendor_ts__ra_ap_ide_db-0.0.270", - "vendor_ts__ra_ap_intern-0.0.270", - "vendor_ts__ra_ap_load-cargo-0.0.270", - "vendor_ts__ra_ap_parser-0.0.270", - "vendor_ts__ra_ap_paths-0.0.270", - "vendor_ts__ra_ap_project_model-0.0.270", - "vendor_ts__ra_ap_span-0.0.270", - "vendor_ts__ra_ap_stdx-0.0.270", - "vendor_ts__ra_ap_syntax-0.0.270", - "vendor_ts__ra_ap_vfs-0.0.270", + "vendor_ts__ra_ap_base_db-0.0.273", + "vendor_ts__ra_ap_cfg-0.0.273", + "vendor_ts__ra_ap_hir-0.0.273", + "vendor_ts__ra_ap_hir_def-0.0.273", + "vendor_ts__ra_ap_hir_expand-0.0.273", + "vendor_ts__ra_ap_hir_ty-0.0.273", + "vendor_ts__ra_ap_ide_db-0.0.273", + "vendor_ts__ra_ap_intern-0.0.273", + "vendor_ts__ra_ap_load-cargo-0.0.273", + "vendor_ts__ra_ap_parser-0.0.273", + "vendor_ts__ra_ap_paths-0.0.273", + "vendor_ts__ra_ap_project_model-0.0.273", + "vendor_ts__ra_ap_span-0.0.273", + "vendor_ts__ra_ap_stdx-0.0.273", + "vendor_ts__ra_ap_syntax-0.0.273", + "vendor_ts__ra_ap_vfs-0.0.273", "vendor_ts__rand-0.9.0", "vendor_ts__rayon-1.10.0", "vendor_ts__regex-1.11.1", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.android_system_properties-0.1.5.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.android_system_properties-0.1.5.bazel index a6d0823636ee..d5999d213666 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.android_system_properties-0.1.5.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.android_system_properties-0.1.5.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "0.1.5", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel index 31e9ae6079ae..1f97bfd967f4 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel @@ -80,14 +80,14 @@ alias( ) alias( - name = "clap-4.5.32", - actual = "@vendor_ts__clap-4.5.32//:clap", + name = "clap-4.5.35", + actual = "@vendor_ts__clap-4.5.35//:clap", tags = ["manual"], ) alias( name = "clap", - actual = "@vendor_ts__clap-4.5.32//:clap", + actual = "@vendor_ts__clap-4.5.35//:clap", tags = ["manual"], ) @@ -260,200 +260,200 @@ alias( ) alias( - name = "ra_ap_base_db-0.0.270", - actual = "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", + name = "ra_ap_base_db-0.0.273", + actual = "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", tags = ["manual"], ) alias( name = "ra_ap_base_db", - actual = "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", + actual = "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", tags = ["manual"], ) alias( - name = "ra_ap_cfg-0.0.270", - actual = "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", + name = "ra_ap_cfg-0.0.273", + actual = "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", tags = ["manual"], ) alias( name = "ra_ap_cfg", - actual = "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", + actual = "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", tags = ["manual"], ) alias( - name = "ra_ap_hir-0.0.270", - actual = "@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir", + name = "ra_ap_hir-0.0.273", + actual = "@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir", tags = ["manual"], ) alias( name = "ra_ap_hir", - actual = "@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir", + actual = "@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir", tags = ["manual"], ) alias( - name = "ra_ap_hir_def-0.0.270", - actual = "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def", + name = "ra_ap_hir_def-0.0.273", + actual = "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def", tags = ["manual"], ) alias( name = "ra_ap_hir_def", - actual = "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def", + actual = "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def", tags = ["manual"], ) alias( - name = "ra_ap_hir_expand-0.0.270", - actual = "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", + name = "ra_ap_hir_expand-0.0.273", + actual = "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", tags = ["manual"], ) alias( name = "ra_ap_hir_expand", - actual = "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", + actual = "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", tags = ["manual"], ) alias( - name = "ra_ap_hir_ty-0.0.270", - actual = "@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty", + name = "ra_ap_hir_ty-0.0.273", + actual = "@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty", tags = ["manual"], ) alias( name = "ra_ap_hir_ty", - actual = "@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty", + actual = "@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty", tags = ["manual"], ) alias( - name = "ra_ap_ide_db-0.0.270", - actual = "@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db", + name = "ra_ap_ide_db-0.0.273", + actual = "@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db", tags = ["manual"], ) alias( name = "ra_ap_ide_db", - actual = "@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db", + actual = "@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db", tags = ["manual"], ) alias( - name = "ra_ap_intern-0.0.270", - actual = "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", + name = "ra_ap_intern-0.0.273", + actual = "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", tags = ["manual"], ) alias( name = "ra_ap_intern", - actual = "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", + actual = "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", tags = ["manual"], ) alias( - name = "ra_ap_load-cargo-0.0.270", - actual = "@vendor_ts__ra_ap_load-cargo-0.0.270//:ra_ap_load_cargo", + name = "ra_ap_load-cargo-0.0.273", + actual = "@vendor_ts__ra_ap_load-cargo-0.0.273//:ra_ap_load_cargo", tags = ["manual"], ) alias( name = "ra_ap_load-cargo", - actual = "@vendor_ts__ra_ap_load-cargo-0.0.270//:ra_ap_load_cargo", + actual = "@vendor_ts__ra_ap_load-cargo-0.0.273//:ra_ap_load_cargo", tags = ["manual"], ) alias( - name = "ra_ap_parser-0.0.270", - actual = "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", + name = "ra_ap_parser-0.0.273", + actual = "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", tags = ["manual"], ) alias( name = "ra_ap_parser", - actual = "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", + actual = "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", tags = ["manual"], ) alias( - name = "ra_ap_paths-0.0.270", - actual = "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", + name = "ra_ap_paths-0.0.273", + actual = "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", tags = ["manual"], ) alias( name = "ra_ap_paths", - actual = "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", + actual = "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", tags = ["manual"], ) alias( - name = "ra_ap_project_model-0.0.270", - actual = "@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model", + name = "ra_ap_project_model-0.0.273", + actual = "@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model", tags = ["manual"], ) alias( name = "ra_ap_project_model", - actual = "@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model", + actual = "@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model", tags = ["manual"], ) alias( - name = "ra_ap_span-0.0.270", - actual = "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", + name = "ra_ap_span-0.0.273", + actual = "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", tags = ["manual"], ) alias( name = "ra_ap_span", - actual = "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", + actual = "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", tags = ["manual"], ) alias( - name = "ra_ap_stdx-0.0.270", - actual = "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + name = "ra_ap_stdx-0.0.273", + actual = "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", tags = ["manual"], ) alias( - name = "stdx-0.0.270", - actual = "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + name = "stdx-0.0.273", + actual = "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", tags = ["manual"], ) alias( name = "stdx", - actual = "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + actual = "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", tags = ["manual"], ) alias( - name = "ra_ap_syntax-0.0.270", - actual = "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", + name = "ra_ap_syntax-0.0.273", + actual = "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", tags = ["manual"], ) alias( name = "ra_ap_syntax", - actual = "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", + actual = "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", tags = ["manual"], ) alias( - name = "ra_ap_vfs-0.0.270", - actual = "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + name = "ra_ap_vfs-0.0.273", + actual = "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", tags = ["manual"], ) alias( name = "ra_ap_vfs", - actual = "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + actual = "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", tags = ["manual"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.8.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.9.0.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.8.0.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.9.0.bazel index eb58d610f971..e5f84a9323f4 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.8.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.9.0.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "2.8.0", + version = "2.9.0", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.5.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.3.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.5.bazel index 09e2ca4092d4..062d394288fb 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.3.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.5.bazel @@ -80,9 +80,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.5.3", + version = "1.5.5", deps = [ - "@vendor_ts__borsh-1.5.3//:build_script_build", + "@vendor_ts__borsh-1.5.5//:build_script_build", ], ) @@ -131,7 +131,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "1.5.3", + version = "1.5.5", visibility = ["//visibility:private"], deps = [ "@vendor_ts__cfg_aliases-0.2.1//:cfg_aliases", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.18.1.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.19.2.bazel similarity index 96% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.18.1.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.19.2.bazel index 17cd583761cd..5be95a9511f8 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.18.1.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.19.2.bazel @@ -32,7 +32,7 @@ rust_library( "default", ], crate_root = "src/lib.rs", - edition = "2018", + edition = "2021", rustc_flags = [ "--cap-lints=allow", ], @@ -82,13 +82,13 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.18.1", + version = "0.19.2", deps = [ "@vendor_ts__camino-1.1.9//:camino", "@vendor_ts__cargo-platform-0.1.9//:cargo_platform", - "@vendor_ts__semver-1.0.24//:semver", + "@vendor_ts__semver-1.0.26//:semver", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__serde_json-1.0.140//:serde_json", - "@vendor_ts__thiserror-1.0.69//:thiserror", + "@vendor_ts__thiserror-2.0.12//:thiserror", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-ir-0.100.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-ir-0.100.0.bazel index 9b77e1de102d..a15909217db2 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-ir-0.100.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-ir-0.100.0.bazel @@ -84,6 +84,6 @@ rust_library( }), version = "0.100.0", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-solve-0.100.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-solve-0.100.0.bazel index 6bea89c9407f..1aa7560fbf27 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-solve-0.100.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-solve-0.100.0.bazel @@ -86,7 +86,7 @@ rust_library( deps = [ "@vendor_ts__chalk-ir-0.100.0//:chalk_ir", "@vendor_ts__ena-0.14.3//:ena", - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", "@vendor_ts__itertools-0.12.1//:itertools", "@vendor_ts__petgraph-0.6.5//:petgraph", "@vendor_ts__rustc-hash-1.1.0//:rustc_hash", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.32.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.35.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.32.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.35.bazel index efd3ae52118b..c857bb360f32 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.32.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.35.bazel @@ -92,8 +92,8 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "4.5.32", + version = "4.5.35", deps = [ - "@vendor_ts__clap_builder-4.5.32//:clap_builder", + "@vendor_ts__clap_builder-4.5.35//:clap_builder", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.32.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.35.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.32.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.35.bazel index d839347dd068..8d2e740ebd9a 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.32.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.35.bazel @@ -87,7 +87,7 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "4.5.32", + version = "4.5.35", deps = [ "@vendor_ts__anstream-0.6.18//:anstream", "@vendor_ts__anstyle-1.0.10//:anstyle", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ena-0.14.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ena-0.14.3.bazel index 0675dd061161..ab0a896ca891 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ena-0.14.3.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ena-0.14.3.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "0.14.3", deps = [ - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.1.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.2.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.1.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.2.bazel index 54c391b74bbe..2404a962610f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.1.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.2.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.1", + version = "1.0.2", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.filetime-0.2.25.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.filetime-0.2.25.bazel index afa987bf06c9..bcb8fb8a739a 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.filetime-0.2.25.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.filetime-0.2.25.bazel @@ -84,85 +84,85 @@ rust_library( "@vendor_ts__cfg-if-1.0.0//:cfg_if", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.fsevent-sys-4.1.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.fsevent-sys-4.1.0.bazel index fa1103d4e4ab..52e35cc09f60 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.fsevent-sys-4.1.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.fsevent-sys-4.1.0.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "4.1.0", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.generator-0.8.4.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.generator-0.8.4.bazel index bf828ac701be..0589aa9e457e 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.generator-0.8.4.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.generator-0.8.4.bazel @@ -84,88 +84,88 @@ rust_library( deps = [ "@vendor_ts__cfg-if-1.0.0//:cfg_if", "@vendor_ts__generator-0.8.4//:build_script_build", - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-0.58.0//:windows", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-0.58.0//:windows", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-0.58.0//:windows", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.getrandom-0.3.1.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.getrandom-0.3.1.bazel index ae0fc92ddc7c..e4cc7ad397a8 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.getrandom-0.3.1.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.getrandom-0.3.1.bazel @@ -89,79 +89,79 @@ rust_library( "@vendor_ts__getrandom-0.3.1//:build_script_build", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(all(windows, not(target_vendor = "win7"))) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "haiku", target_os = "redox", target_os = "nto", target_os = "aix")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "haiku", target_os = "redox", target_os = "nto", target_os = "aix")) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(all(windows, not(target_vendor = "win7"))) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm"))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm"))) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(all(windows, not(target_vendor = "win7"))) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm"))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm"))) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.globset-0.4.15.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.globset-0.4.15.bazel index c7341c6d1f1b..3a2a29d0ae4a 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.globset-0.4.15.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.globset-0.4.15.bazel @@ -87,7 +87,7 @@ rust_library( deps = [ "@vendor_ts__aho-corasick-1.1.3//:aho_corasick", "@vendor_ts__bstr-1.11.3//:bstr", - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", "@vendor_ts__regex-automata-0.4.9//:regex_automata", "@vendor_ts__regex-syntax-0.8.5//:regex_syntax", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.hashbrown-0.15.2.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.hashbrown-0.15.2.bazel index d7d08e46be64..ab42e90e017f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.hashbrown-0.15.2.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.hashbrown-0.15.2.bazel @@ -90,7 +90,7 @@ rust_library( version = "0.15.2", deps = [ "@vendor_ts__allocator-api2-0.2.21//:allocator_api2", - "@vendor_ts__equivalent-1.0.1//:equivalent", + "@vendor_ts__equivalent-1.0.2//:equivalent", "@vendor_ts__foldhash-0.1.5//:foldhash", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.7.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.9.0.bazel similarity index 98% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.7.0.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.9.0.bazel index 53eacc89ea6f..f3d360378d59 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.7.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.9.0.bazel @@ -84,9 +84,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "2.7.0", + version = "2.9.0", deps = [ - "@vendor_ts__equivalent-1.0.1//:equivalent", + "@vendor_ts__equivalent-1.0.2//:equivalent", "@vendor_ts__hashbrown-0.15.2//:hashbrown", "@vendor_ts__serde-1.0.219//:serde", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-0.11.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-0.11.0.bazel index 8abc71e58117..aff8348d7f06 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-0.11.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-0.11.0.bazel @@ -81,8 +81,8 @@ rust_library( }), version = "0.11.0", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__inotify-sys-0.1.5//:inotify_sys", - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-sys-0.1.5.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-sys-0.1.5.bazel index 3e23ee4dea6f..5a3e4beb27b6 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-sys-0.1.5.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-sys-0.1.5.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "0.1.5", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.14.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.15.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.14.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.15.bazel index 596b777f6852..0ed2975cf786 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.14.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.15.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.14", + version = "1.0.15", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-1.0.8.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-1.0.8.bazel index 25390d540e0e..9c5a46755fa5 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-1.0.8.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-1.0.8.bazel @@ -82,6 +82,6 @@ rust_library( version = "1.0.8", deps = [ "@vendor_ts__kqueue-sys-1.0.4//:kqueue_sys", - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-sys-1.0.4.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-sys-1.0.4.bazel index e226e4b77c7f..ea19f54cb02a 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-sys-1.0.4.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-sys-1.0.4.bazel @@ -82,6 +82,6 @@ rust_library( version = "1.0.4", deps = [ "@vendor_ts__bitflags-1.3.2//:bitflags", - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.169.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.171.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.169.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.171.bazel index d3cef09f0cd8..aedf0e4cfe2c 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.169.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.171.bazel @@ -84,9 +84,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.2.169", + version = "0.2.171", deps = [ - "@vendor_ts__libc-0.2.169//:build_script_build", + "@vendor_ts__libc-0.2.171//:build_script_build", ], ) @@ -139,7 +139,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "0.2.169", + version = "0.2.171", visibility = ["//visibility:private"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libredox-0.1.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libredox-0.1.3.bazel index 4bbbe82982c5..99f498374004 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libredox-0.1.3.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libredox-0.1.3.bazel @@ -81,8 +81,8 @@ rust_library( }), version = "0.1.3", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__bitflags-2.9.0//:bitflags", + "@vendor_ts__libc-0.2.171//:libc", "@vendor_ts__redox_syscall-0.5.8//:syscall", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.3.9.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.3.9.bazel index c17f4cad96b1..7ee9ca3cce20 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.3.9.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.3.9.bazel @@ -85,6 +85,6 @@ rust_library( }), version = "0.3.9", deps = [ - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.25.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.27.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.25.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.27.bazel index a2e0e15b13ef..b36cd98285ff 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.25.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.27.bazel @@ -82,5 +82,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.4.25", + version = "0.4.27", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.lz4_flex-0.11.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.lz4_flex-0.11.3.bazel deleted file mode 100644 index c2b50d980e13..000000000000 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.lz4_flex-0.11.3.bazel +++ /dev/null @@ -1,83 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @@//misc/bazel/3rdparty:vendor_tree_sitter_extractors -############################################################################### - -load("@rules_rust//rust:defs.bzl", "rust_library") - -package(default_visibility = ["//visibility:public"]) - -rust_library( - name = "lz4_flex", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_root = "src/lib.rs", - edition = "2021", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=lz4_flex", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:aarch64-unknown-uefi": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasip1": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "@rules_rust//rust/platform:x86_64-unknown-uefi": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "0.11.3", -) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.mio-1.0.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.mio-1.0.3.bazel index 617822e3a9ca..1c48d01d22fc 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.mio-1.0.3.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.mio-1.0.3.bazel @@ -87,92 +87,92 @@ rust_library( }), version = "1.0.3", deps = [ - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.52.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.52.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:wasm32-wasip1": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(target_os = "wasi") + "@vendor_ts__libc-0.2.171//:libc", # cfg(target_os = "wasi") "@vendor_ts__wasi-0.11.0-wasi-snapshot-preview1//:wasi", # cfg(target_os = "wasi") ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.52.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.notify-8.0.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.notify-8.0.0.bazel index 43a411a44ef6..1b78caaf8944 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.notify-8.0.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.notify-8.0.0.bazel @@ -87,13 +87,13 @@ rust_library( version = "8.0.0", deps = [ "@vendor_ts__filetime-0.2.25//:filetime", - "@vendor_ts__libc-0.2.169//:libc", - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__libc-0.2.171//:libc", + "@vendor_ts__log-0.4.27//:log", "@vendor_ts__notify-types-2.0.0//:notify_types", "@vendor_ts__walkdir-2.5.0//:walkdir", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__bitflags-2.8.0//:bitflags", # cfg(target_os = "macos") + "@vendor_ts__bitflags-2.9.0//:bitflags", # cfg(target_os = "macos") "@vendor_ts__fsevent-sys-4.1.0//:fsevent_sys", # aarch64-apple-darwin ], "@rules_rust//rust/platform:aarch64-apple-ios": [ @@ -132,7 +132,7 @@ rust_library( "@vendor_ts__mio-1.0.3//:mio", # cfg(any(target_os = "linux", target_os = "android")) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__bitflags-2.8.0//:bitflags", # cfg(target_os = "macos") + "@vendor_ts__bitflags-2.9.0//:bitflags", # cfg(target_os = "macos") "@vendor_ts__fsevent-sys-4.1.0//:fsevent_sys", # i686-apple-darwin ], "@rules_rust//rust/platform:i686-linux-android": [ @@ -159,7 +159,7 @@ rust_library( "@vendor_ts__mio-1.0.3//:mio", # cfg(any(target_os = "linux", target_os = "android")) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__bitflags-2.8.0//:bitflags", # cfg(target_os = "macos") + "@vendor_ts__bitflags-2.9.0//:bitflags", # cfg(target_os = "macos") "@vendor_ts__fsevent-sys-4.1.0//:fsevent_sys", # x86_64-apple-darwin ], "@rules_rust//rust/platform:x86_64-apple-ios": [ diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.num_cpus-1.16.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.num_cpus-1.16.0.bazel index ccbaed88173e..057e8dd6c636 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.num_cpus-1.16.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.num_cpus-1.16.0.bazel @@ -82,103 +82,103 @@ rust_library( version = "1.16.0", deps = select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-uefi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:thumbv7em-none-eabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:wasm32-unknown-unknown": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:wasm32-wasip1": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-none": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-uefi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.4.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.5.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.4.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.5.bazel index 2514e59de675..7fda44d7d5f3 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.4.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.5.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "11.1.4", + version = "11.1.5", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.parking_lot_core-0.9.10.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.parking_lot_core-0.9.10.bazel index d53c706ee3cb..ea6704cb1341 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.parking_lot_core-0.9.10.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.parking_lot_core-0.9.10.bazel @@ -87,85 +87,85 @@ rust_library( "@vendor_ts__smallvec-1.14.0//:smallvec", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-0.4.7.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-0.4.7.bazel index 5784824a2985..4f084775990e 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-0.4.7.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-0.4.7.bazel @@ -81,7 +81,7 @@ rust_library( }), version = "0.4.7", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", "@vendor_ts__perf-event-open-sys-1.0.1//:perf_event_open_sys", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-open-sys-1.0.1.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-open-sys-1.0.1.bazel index 92b15bc5d885..1e4bd90b8ae8 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-open-sys-1.0.1.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-open-sys-1.0.1.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "1.0.1", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.petgraph-0.6.5.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.petgraph-0.6.5.bazel index df987bd453e9..ac85fb246bd1 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.petgraph-0.6.5.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.petgraph-0.6.5.bazel @@ -88,6 +88,6 @@ rust_library( version = "0.6.5", deps = [ "@vendor_ts__fixedbitset-0.4.2//:fixedbitset", - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.proc-macro2-1.0.94.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.proc-macro2-1.0.94.bazel index c78fa364e8e5..c7bacd2430c4 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.proc-macro2-1.0.94.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.proc-macro2-1.0.94.bazel @@ -87,7 +87,7 @@ rust_library( version = "1.0.94", deps = [ "@vendor_ts__proc-macro2-1.0.94//:build_script_build", - "@vendor_ts__unicode-ident-1.0.16//:unicode_ident", + "@vendor_ts__unicode-ident-1.0.17//:unicode_ident", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_abi-0.100.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_abi-0.100.0.bazel index f1bf54464e65..cc04b2be07d0 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_abi-0.100.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_abi-0.100.0.bazel @@ -85,7 +85,7 @@ rust_library( }), version = "0.100.0", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__ra-ap-rustc_hashes-0.100.0//:ra_ap_rustc_hashes", "@vendor_ts__ra-ap-rustc_index-0.100.0//:ra_ap_rustc_index", "@vendor_ts__tracing-0.1.41//:tracing", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_pattern_analysis-0.100.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_pattern_analysis-0.100.0.bazel index dcdff444d8f5..3a7ef306f97f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_pattern_analysis-0.100.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_pattern_analysis-0.100.0.bazel @@ -86,7 +86,7 @@ rust_library( deps = [ "@vendor_ts__ra-ap-rustc_index-0.100.0//:ra_ap_rustc_index", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab//:rustc_apfloat", + "@vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab//:rustc_apfloat", "@vendor_ts__smallvec-1.14.0//:smallvec", "@vendor_ts__tracing-0.1.41//:tracing", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.273.bazel similarity index 80% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.273.bazel index 6e8ab6e20b3b..fa7cec0dbb28 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.273.bazel @@ -17,13 +17,12 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", }, compile_data = glob( include = ["**"], @@ -40,7 +39,7 @@ rust_library( crate_root = "src/lib.rs", edition = "2024", proc_macro_deps = [ - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -91,20 +90,18 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__lz4_flex-0.11.3//:lz4_flex", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__salsa-0.19.0//:salsa", - "@vendor_ts__semver-1.0.24//:semver", + "@vendor_ts__semver-1.0.26//:semver", "@vendor_ts__tracing-0.1.41//:tracing", "@vendor_ts__triomphe-0.1.14//:triomphe", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.273.bazel similarity index 93% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.273.bazel index c38cc3cdd884..a80bffe20f96 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.273.bazel @@ -17,8 +17,8 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -86,10 +86,10 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__tracing-0.1.41//:tracing", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.273.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.273.bazel index 598826ee263e..15381260d656 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.273.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.273.bazel similarity index 74% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.273.bazel index c85c4bbf9463..6bf6732bb069 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.273.bazel @@ -17,16 +17,16 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def": "hir_def", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand": "hir_expand", - "@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty": "hir_ty", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def": "hir_def", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand": "hir_expand", + "@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty": "hir_ty", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -91,22 +91,22 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", "@vendor_ts__either-1.15.0//:either", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", - "@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itertools-0.14.0//:itertools", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", + "@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__smallvec-1.14.0//:smallvec", "@vendor_ts__tracing-0.1.41//:tracing", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.273.bazel similarity index 73% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.273.bazel index f0e8fd28561c..2e483df01ff8 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.273.bazel @@ -17,16 +17,16 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand": "hir_expand", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_mbe-0.0.270//:ra_ap_mbe": "mbe", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand": "hir_expand", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_mbe-0.0.273//:ra_ap_mbe": "mbe", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -43,7 +43,7 @@ rust_library( crate_root = "src/lib.rs", edition = "2024", proc_macro_deps = [ - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -94,36 +94,34 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__cov-mark-2.0.0//:cov_mark", - "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__drop_bomb-0.1.5//:drop_bomb", "@vendor_ts__either-1.15.0//:either", "@vendor_ts__fst-0.4.7//:fst", - "@vendor_ts__hashbrown-0.14.5//:hashbrown", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__la-arena-0.3.1//:la_arena", "@vendor_ts__ra-ap-rustc_abi-0.100.0//:ra_ap_rustc_abi", - "@vendor_ts__ra-ap-rustc_hashes-0.100.0//:ra_ap_rustc_hashes", "@vendor_ts__ra-ap-rustc_parse_format-0.100.0//:ra_ap_rustc_parse_format", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_mbe-0.0.270//:ra_ap_mbe", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_mbe-0.0.273//:ra_ap_mbe", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab//:rustc_apfloat", + "@vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab//:rustc_apfloat", "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__smallvec-1.14.0//:smallvec", "@vendor_ts__text-size-1.1.1//:text_size", + "@vendor_ts__thin-vec-0.2.14//:thin_vec", "@vendor_ts__tracing-0.1.41//:tracing", "@vendor_ts__triomphe-0.1.14//:triomphe", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.273.bazel similarity index 73% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.273.bazel index 716d660159f7..3bd7c5b7cd56 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.273.bazel @@ -17,17 +17,17 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_mbe-0.0.270//:ra_ap_mbe": "mbe", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_syntax-bridge-0.0.270//:ra_ap_syntax_bridge": "syntax_bridge", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_mbe-0.0.273//:ra_ap_mbe": "mbe", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_syntax-bridge-0.0.273//:ra_ap_syntax_bridge": "syntax_bridge", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -44,7 +44,7 @@ rust_library( crate_root = "src/lib.rs", edition = "2024", proc_macro_deps = [ - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -95,23 +95,21 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__cov-mark-2.0.0//:cov_mark", "@vendor_ts__either-1.15.0//:either", - "@vendor_ts__hashbrown-0.14.5//:hashbrown", - "@vendor_ts__itertools-0.12.1//:itertools", - "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_mbe-0.0.270//:ra_ap_mbe", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_syntax-bridge-0.0.270//:ra_ap_syntax_bridge", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__itertools-0.14.0//:itertools", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_mbe-0.0.273//:ra_ap_mbe", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_syntax-bridge-0.0.273//:ra_ap_syntax_bridge", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__smallvec-1.14.0//:smallvec", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.273.bazel similarity index 77% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.273.bazel index 6e1e0740c96a..a2488ef3be60 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.273.bazel @@ -17,14 +17,14 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def": "hir_def", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand": "hir_expand", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def": "hir_def", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand": "hir_expand", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", }, compile_data = glob( include = ["**"], @@ -42,7 +42,7 @@ rust_library( edition = "2024", proc_macro_deps = [ "@vendor_ts__chalk-derive-0.100.0//:chalk_derive", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -93,34 +93,32 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__chalk-ir-0.100.0//:chalk_ir", "@vendor_ts__chalk-recursive-0.100.0//:chalk_recursive", "@vendor_ts__chalk-solve-0.100.0//:chalk_solve", "@vendor_ts__cov-mark-2.0.0//:cov_mark", - "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__either-1.15.0//:either", "@vendor_ts__ena-0.14.3//:ena", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__nohash-hasher-0.2.0//:nohash_hasher", - "@vendor_ts__oorandom-11.1.4//:oorandom", + "@vendor_ts__oorandom-11.1.5//:oorandom", "@vendor_ts__ra-ap-rustc_abi-0.100.0//:ra_ap_rustc_abi", "@vendor_ts__ra-ap-rustc_index-0.100.0//:ra_ap_rustc_index", "@vendor_ts__ra-ap-rustc_pattern_analysis-0.100.0//:ra_ap_rustc_pattern_analysis", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab//:rustc_apfloat", + "@vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab//:rustc_apfloat", "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__scoped-tls-1.0.1//:scoped_tls", "@vendor_ts__smallvec-1.14.0//:smallvec", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.273.bazel similarity index 76% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.273.bazel index 0c4376994087..e37410620227 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.273.bazel @@ -17,15 +17,15 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir": "hir", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_profile-0.0.270//:ra_ap_profile": "profile", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir": "hir", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_profile-0.0.273//:ra_ap_profile": "profile", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", }, compile_data = glob( include = ["**"], @@ -42,7 +42,7 @@ rust_library( crate_root = "src/lib.rs", edition = "2024", proc_macro_deps = [ - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -93,28 +93,27 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__cov-mark-2.0.0//:cov_mark", "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", - "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__either-1.15.0//:either", "@vendor_ts__fst-0.4.7//:fst", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__line-index-0.1.2//:line_index", "@vendor_ts__memchr-2.7.4//:memchr", "@vendor_ts__nohash-hasher-0.2.0//:nohash_hasher", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_profile-0.0.270//:ra_ap_profile", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_profile-0.0.273//:ra_ap_profile", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", "@vendor_ts__rayon-1.10.0//:rayon", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__salsa-0.19.0//:salsa", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.273.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.273.bazel index 39f87b8bcdcc..72e7580e4163 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.273.bazel @@ -79,7 +79,7 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__hashbrown-0.14.5//:hashbrown", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.273.bazel similarity index 75% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.273.bazel index 30a635ef821f..c9b5273ee2b5 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.273.bazel @@ -17,16 +17,15 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand": "hir_expand", - "@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db": "ide_db", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_proc_macro_api-0.0.270//:ra_ap_proc_macro_api": "proc_macro_api", - "@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model": "project_model", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", - "@vendor_ts__ra_ap_vfs-notify-0.0.270//:ra_ap_vfs_notify": "vfs_notify", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand": "hir_expand", + "@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db": "ide_db", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_proc_macro_api-0.0.273//:ra_ap_proc_macro_api": "proc_macro_api", + "@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model": "project_model", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_vfs-notify-0.0.273//:ra_ap_vfs_notify": "vfs_notify", }, compile_data = glob( include = ["**"], @@ -91,21 +90,20 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__anyhow-1.0.97//:anyhow", "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", - "@vendor_ts__itertools-0.12.1//:itertools", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", - "@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_proc_macro_api-0.0.270//:ra_ap_proc_macro_api", - "@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", - "@vendor_ts__ra_ap_vfs-notify-0.0.270//:ra_ap_vfs_notify", + "@vendor_ts__itertools-0.14.0//:itertools", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", + "@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_proc_macro_api-0.0.273//:ra_ap_proc_macro_api", + "@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", + "@vendor_ts__ra_ap_vfs-notify-0.0.273//:ra_ap_vfs_notify", "@vendor_ts__tracing-0.1.41//:tracing", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.273.bazel similarity index 80% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.273.bazel index be98a1794d8c..635c79e43f30 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.273.bazel @@ -17,13 +17,12 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_syntax-bridge-0.0.270//:ra_ap_syntax_bridge": "syntax_bridge", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-bridge-0.0.273//:ra_ap_syntax_bridge": "syntax_bridge", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -88,20 +87,18 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", "@vendor_ts__cov-mark-2.0.0//:cov_mark", "@vendor_ts__ra-ap-rustc_lexer-0.100.0//:ra_ap_rustc_lexer", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_syntax-bridge-0.0.270//:ra_ap_syntax_bridge", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-bridge-0.0.273//:ra_ap_syntax_bridge", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__smallvec-1.14.0//:smallvec", - "@vendor_ts__tracing-0.1.41//:tracing", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.273.bazel similarity index 96% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.273.bazel index abd94f21b0ca..0c1ca867e3d1 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.273.bazel @@ -17,7 +17,7 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_edition-0.0.270//:ra_ap_edition": "edition", + "@vendor_ts__ra_ap_edition-0.0.273//:ra_ap_edition": "edition", }, compile_data = glob( include = ["**"], @@ -86,11 +86,11 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__drop_bomb-0.1.5//:drop_bomb", "@vendor_ts__ra-ap-rustc_lexer-0.100.0//:ra_ap_rustc_lexer", - "@vendor_ts__ra_ap_edition-0.0.270//:ra_ap_edition", + "@vendor_ts__ra_ap_edition-0.0.273//:ra_ap_edition", "@vendor_ts__tracing-0.1.41//:tracing", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.273.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.273.bazel index 582fc3196744..fb0f90b42480 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.273.bazel @@ -82,7 +82,7 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__camino-1.1.9//:camino", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.273.bazel similarity index 85% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.273.bazel index e8379df9f544..bdb33ce1a793 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.273.bazel @@ -17,11 +17,11 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths": "paths", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -89,14 +89,14 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__serde_json-1.0.140//:serde_json", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.273.bazel similarity index 86% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.273.bazel index 2a4bffbc5c89..6e1af1c0010b 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.273.bazel @@ -79,45 +79,53 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__cfg-if-1.0.0//:cfg_if", - "@vendor_ts__libc-0.2.169//:libc", ] + select({ "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "//conditions:default": [], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.273.bazel similarity index 79% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.273.bazel index bac3ea62b1c3..cb1f3a56a143 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.273.bazel @@ -17,13 +17,13 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_toolchain-0.0.270//:ra_ap_toolchain": "toolchain", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths": "paths", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_toolchain-0.0.273//:ra_ap_toolchain": "toolchain", }, compile_data = glob( include = ["**"], @@ -91,21 +91,21 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__anyhow-1.0.97//:anyhow", - "@vendor_ts__cargo_metadata-0.18.1//:cargo_metadata", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__cargo_metadata-0.19.2//:cargo_metadata", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_toolchain-0.0.270//:ra_ap_toolchain", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_toolchain-0.0.273//:ra_ap_toolchain", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__semver-1.0.24//:semver", + "@vendor_ts__semver-1.0.26//:semver", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__serde_json-1.0.140//:serde_json", "@vendor_ts__tracing-0.1.41//:tracing", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.273.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.273.bazel index 66b54f0975e5..394f5e421ac1 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.273.bazel @@ -79,12 +79,10 @@ rust_proc_macro( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__heck-0.5.0//:heck", "@vendor_ts__proc-macro2-1.0.94//:proc_macro2", "@vendor_ts__quote-1.0.40//:quote", - "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__syn-2.0.100//:syn", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.273.bazel similarity index 89% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.273.bazel index fcace1b1b05f..15f74141c034 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.273.bazel @@ -17,9 +17,9 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", }, compile_data = glob( include = ["**"], @@ -33,6 +33,10 @@ rust_library( "WORKSPACE.bazel", ], ), + crate_features = [ + "default", + "salsa", + ], crate_root = "src/lib.rs", edition = "2024", rustc_flags = [ @@ -84,13 +88,13 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__hashbrown-0.14.5//:hashbrown", "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__text-size-1.1.1//:text_size", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.273.bazel similarity index 57% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.273.bazel index 9a96045450a2..baf4d1942a4d 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.273.bazel @@ -79,26 +79,97 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__jod-thread-0.1.2//:jod_thread", - "@vendor_ts__libc-0.2.169//:libc", "@vendor_ts__tracing-0.1.41//:tracing", ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__miow-0.6.0//:miow", # cfg(windows) "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], + "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__miow-0.6.0//:miow", # cfg(windows) "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__miow-0.6.0//:miow", # cfg(windows) "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], "//conditions:default": [], }), ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.273.bazel similarity index 90% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.273.bazel index adfba58214cb..8555bc6b119b 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.273.bazel @@ -17,8 +17,8 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", }, compile_data = glob( include = ["**"], @@ -83,15 +83,13 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__cov-mark-2.0.0//:cov_mark", "@vendor_ts__either-1.15.0//:either", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__ra-ap-rustc_lexer-0.100.0//:ra_ap_rustc_lexer", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", "@vendor_ts__rowan-0.15.15//:rowan", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__smol_str-0.3.2//:smol_str", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.273.bazel similarity index 82% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.273.bazel index 5402358378fb..959cd8c47346 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.273.bazel @@ -17,12 +17,12 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -87,15 +87,14 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__tracing-0.1.41//:tracing", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.273.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.273.bazel index a9f5509b3064..211a787f67f3 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.273.bazel @@ -79,7 +79,7 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__camino-1.1.9//:camino", "@vendor_ts__home-0.5.11//:home", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.273.bazel similarity index 93% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.273.bazel index 946e9862a993..1059e91496cd 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.273.bazel @@ -17,8 +17,8 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", }, compile_data = glob( include = ["**"], @@ -83,12 +83,12 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", "@vendor_ts__ra-ap-rustc_lexer-0.100.0//:ra_ap_rustc_lexer", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", "@vendor_ts__text-size-1.1.1//:text_size", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.273.bazel similarity index 92% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.273.bazel index 3990da07910f..7213c9199cdf 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.273.bazel @@ -17,8 +17,8 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths": "paths", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", }, compile_data = glob( include = ["**"], @@ -83,14 +83,14 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", "@vendor_ts__fst-0.4.7//:fst", - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", "@vendor_ts__nohash-hasher-0.2.0//:nohash_hasher", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__tracing-0.1.41//:tracing", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.273.bazel similarity index 91% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.273.bazel index 494979d39523..33a5d195f846 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.273.bazel @@ -17,9 +17,9 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths": "paths", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", }, compile_data = glob( include = ["**"], @@ -84,13 +84,13 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", "@vendor_ts__notify-8.0.0//:notify", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", "@vendor_ts__rayon-1.10.0//:rayon", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__tracing-0.1.41//:tracing", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.redox_syscall-0.5.8.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.redox_syscall-0.5.8.bazel index adc812c3df5a..db9267bd12e3 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.redox_syscall-0.5.8.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.redox_syscall-0.5.8.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "0.5.8", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel similarity index 96% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel index 00e80306ea45..feeb8d3cda4b 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel @@ -80,10 +80,10 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.2.1+llvm-462a31f5a5ab", + version = "0.2.2+llvm-462a31f5a5ab", deps = [ - "@vendor_ts__bitflags-1.3.2//:bitflags", - "@vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab//:build_script_build", + "@vendor_ts__bitflags-2.9.0//:bitflags", + "@vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab//:build_script_build", "@vendor_ts__smallvec-1.14.0//:smallvec", ], ) @@ -133,7 +133,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "0.2.1+llvm-462a31f5a5ab", + version = "0.2.2+llvm-462a31f5a5ab", visibility = ["//visibility:private"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-0.19.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-0.19.0.bazel index f732cb64f0fd..6018cc9f4911 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-0.19.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-0.19.0.bazel @@ -95,7 +95,7 @@ rust_library( "@vendor_ts__dashmap-6.1.0//:dashmap", "@vendor_ts__hashbrown-0.15.2//:hashbrown", "@vendor_ts__hashlink-0.10.0//:hashlink", - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", "@vendor_ts__parking_lot-0.12.3//:parking_lot", "@vendor_ts__portable-atomic-1.11.0//:portable_atomic", "@vendor_ts__rayon-1.10.0//:rayon", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.24.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.26.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.24.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.26.bazel index 004fe29bbd7b..807edeb36441 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.24.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.26.bazel @@ -85,9 +85,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.24", + version = "1.0.26", deps = [ - "@vendor_ts__semver-1.0.24//:build_script_build", + "@vendor_ts__semver-1.0.26//:build_script_build", "@vendor_ts__serde-1.0.219//:serde", ], ) @@ -142,7 +142,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "1.0.24", + version = "1.0.26", visibility = ["//visibility:private"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_json-1.0.140.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_json-1.0.140.bazel index 3f7d00505fbe..82dde7080ad9 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_json-1.0.140.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_json-1.0.140.bazel @@ -87,7 +87,7 @@ rust_library( }), version = "1.0.140", deps = [ - "@vendor_ts__itoa-1.0.14//:itoa", + "@vendor_ts__itoa-1.0.15//:itoa", "@vendor_ts__memchr-2.7.4//:memchr", "@vendor_ts__ryu-1.0.19//:ryu", "@vendor_ts__serde-1.0.219//:serde", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_yaml-0.9.34+deprecated.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_yaml-0.9.34+deprecated.bazel index 78a3a8caae5a..9ec28ca4440e 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_yaml-0.9.34+deprecated.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_yaml-0.9.34+deprecated.bazel @@ -81,8 +81,8 @@ rust_library( }), version = "0.9.34+deprecated", deps = [ - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itoa-1.0.14//:itoa", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itoa-1.0.15//:itoa", "@vendor_ts__ryu-1.0.19//:ryu", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__unsafe-libyaml-0.2.11//:unsafe_libyaml", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.syn-2.0.100.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.syn-2.0.100.bazel index 36eda052e065..052bbecfe4db 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.syn-2.0.100.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.syn-2.0.100.bazel @@ -95,6 +95,6 @@ rust_library( deps = [ "@vendor_ts__proc-macro2-1.0.94//:proc_macro2", "@vendor_ts__quote-1.0.40//:quote", - "@vendor_ts__unicode-ident-1.0.16//:unicode_ident", + "@vendor_ts__unicode-ident-1.0.17//:unicode_ident", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thin-vec-0.2.14.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thin-vec-0.2.14.bazel new file mode 100644 index 000000000000..aff81c594137 --- /dev/null +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thin-vec-0.2.14.bazel @@ -0,0 +1,87 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @@//misc/bazel/3rdparty:vendor_tree_sitter_extractors +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "thin_vec", + srcs = glob( + include = ["**/*.rs"], + allow_empty = True, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=thin-vec", + "manual", + "noclippy", + "norustfmt", + ], + target_compatible_with = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [], + "@rules_rust//rust/platform:aarch64-apple-ios": [], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], + "@rules_rust//rust/platform:aarch64-linux-android": [], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], + "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], + "@rules_rust//rust/platform:aarch64-unknown-uefi": [], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], + "@rules_rust//rust/platform:armv7-linux-androideabi": [], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], + "@rules_rust//rust/platform:i686-apple-darwin": [], + "@rules_rust//rust/platform:i686-linux-android": [], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [], + "@rules_rust//rust/platform:i686-unknown-freebsd": [], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], + "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], + "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], + "@rules_rust//rust/platform:thumbv7em-none-eabi": [], + "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], + "@rules_rust//rust/platform:wasm32-unknown-unknown": [], + "@rules_rust//rust/platform:wasm32-wasip1": [], + "@rules_rust//rust/platform:x86_64-apple-darwin": [], + "@rules_rust//rust/platform:x86_64-apple-ios": [], + "@rules_rust//rust/platform:x86_64-linux-android": [], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], + "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], + "@rules_rust//rust/platform:x86_64-unknown-none": [], + "@rules_rust//rust/platform:x86_64-unknown-uefi": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + version = "0.2.14", +) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-1.0.69.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-2.0.12.bazel similarity index 94% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-1.0.69.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-2.0.12.bazel index a79c49f5eeaf..2b685a2cd3af 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-1.0.69.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-2.0.12.bazel @@ -29,10 +29,14 @@ rust_library( "WORKSPACE.bazel", ], ), + crate_features = [ + "default", + "std", + ], crate_root = "src/lib.rs", edition = "2021", proc_macro_deps = [ - "@vendor_ts__thiserror-impl-1.0.69//:thiserror_impl", + "@vendor_ts__thiserror-impl-2.0.12//:thiserror_impl", ], rustc_flags = [ "--cap-lints=allow", @@ -83,9 +87,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.69", + version = "2.0.12", deps = [ - "@vendor_ts__thiserror-1.0.69//:build_script_build", + "@vendor_ts__thiserror-2.0.12//:build_script_build", ], ) @@ -108,6 +112,10 @@ cargo_build_script( "WORKSPACE.bazel", ], ), + crate_features = [ + "default", + "std", + ], crate_name = "build_script_build", crate_root = "build.rs", data = glob( @@ -134,7 +142,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "1.0.69", + version = "2.0.12", visibility = ["//visibility:private"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-1.0.69.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-2.0.12.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-1.0.69.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-2.0.12.bazel index c5c8a699beeb..4bae5674a881 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-1.0.69.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-2.0.12.bazel @@ -79,7 +79,7 @@ rust_proc_macro( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.69", + version = "2.0.12", deps = [ "@vendor_ts__proc-macro2-1.0.94//:proc_macro2", "@vendor_ts__quote-1.0.40//:quote", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.toml_edit-0.22.24.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.toml_edit-0.22.24.bazel index c539ad29ce81..ee4b912ba31a 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.toml_edit-0.22.24.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.toml_edit-0.22.24.bazel @@ -86,7 +86,7 @@ rust_library( }), version = "0.22.24", deps = [ - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__serde_spanned-0.6.8//:serde_spanned", "@vendor_ts__toml_datetime-0.6.8//:toml_datetime", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tracing-log-0.2.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tracing-log-0.2.0.bazel index da7b8a8bfc07..b4f1a8d3ab5c 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tracing-log-0.2.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tracing-log-0.2.0.bazel @@ -85,7 +85,7 @@ rust_library( }), version = "0.2.0", deps = [ - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", "@vendor_ts__once_cell-1.20.3//:once_cell", "@vendor_ts__tracing-core-0.1.33//:tracing_core", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.16.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.17.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.16.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.17.bazel index f1e1eea9fb4f..6d4b21156f98 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.16.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.17.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.16", + version = "1.0.17", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.wasm-bindgen-backend-0.2.99.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.wasm-bindgen-backend-0.2.99.bazel index 35041989b3d5..2b5e035e4091 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.wasm-bindgen-backend-0.2.99.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.wasm-bindgen-backend-0.2.99.bazel @@ -86,7 +86,7 @@ rust_library( version = "0.2.99", deps = [ "@vendor_ts__bumpalo-3.16.0//:bumpalo", - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", "@vendor_ts__proc-macro2-1.0.94//:proc_macro2", "@vendor_ts__quote-1.0.40//:quote", "@vendor_ts__syn-2.0.100//:syn", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl index b011a2c98008..b2db5d16f583 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl @@ -16,7 +16,6 @@ """ load("@bazel_skylib//lib:selects.bzl", "selects") -load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") @@ -296,7 +295,7 @@ def aliases( _NORMAL_DEPENDENCIES = { "ruby/extractor": { _COMMON_CONDITION: { - "clap": Label("@vendor_ts__clap-4.5.32//:clap"), + "clap": Label("@vendor_ts__clap-4.5.35//:clap"), "encoding": Label("@vendor_ts__encoding-0.2.33//:encoding"), "lazy_static": Label("@vendor_ts__lazy_static-1.5.0//:lazy_static"), "rayon": Label("@vendor_ts__rayon-1.10.0//:rayon"), @@ -317,7 +316,7 @@ _NORMAL_DEPENDENCIES = { "proc-macro2": Label("@vendor_ts__proc-macro2-1.0.94//:proc_macro2"), "quote": Label("@vendor_ts__quote-1.0.40//:quote"), "serde": Label("@vendor_ts__serde-1.0.219//:serde"), - "stdx": Label("@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx"), + "stdx": Label("@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx"), "ungrammar": Label("@vendor_ts__ungrammar-1.16.1//:ungrammar"), }, }, @@ -329,27 +328,27 @@ _NORMAL_DEPENDENCIES = { "argfile": Label("@vendor_ts__argfile-0.2.1//:argfile"), "chalk-ir": Label("@vendor_ts__chalk-ir-0.100.0//:chalk_ir"), "chrono": Label("@vendor_ts__chrono-0.4.40//:chrono"), - "clap": Label("@vendor_ts__clap-4.5.32//:clap"), + "clap": Label("@vendor_ts__clap-4.5.35//:clap"), "dunce": Label("@vendor_ts__dunce-1.0.5//:dunce"), "figment": Label("@vendor_ts__figment-0.10.19//:figment"), "glob": Label("@vendor_ts__glob-0.3.2//:glob"), "itertools": Label("@vendor_ts__itertools-0.14.0//:itertools"), "num-traits": Label("@vendor_ts__num-traits-0.2.19//:num_traits"), - "ra_ap_base_db": Label("@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db"), - "ra_ap_cfg": Label("@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg"), - "ra_ap_hir": Label("@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir"), - "ra_ap_hir_def": Label("@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def"), - "ra_ap_hir_expand": Label("@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand"), - "ra_ap_hir_ty": Label("@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty"), - "ra_ap_ide_db": Label("@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db"), - "ra_ap_intern": Label("@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern"), - "ra_ap_load-cargo": Label("@vendor_ts__ra_ap_load-cargo-0.0.270//:ra_ap_load_cargo"), - "ra_ap_parser": Label("@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser"), - "ra_ap_paths": Label("@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths"), - "ra_ap_project_model": Label("@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model"), - "ra_ap_span": Label("@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span"), - "ra_ap_syntax": Label("@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax"), - "ra_ap_vfs": Label("@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs"), + "ra_ap_base_db": Label("@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db"), + "ra_ap_cfg": Label("@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg"), + "ra_ap_hir": Label("@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir"), + "ra_ap_hir_def": Label("@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def"), + "ra_ap_hir_expand": Label("@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand"), + "ra_ap_hir_ty": Label("@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty"), + "ra_ap_ide_db": Label("@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db"), + "ra_ap_intern": Label("@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern"), + "ra_ap_load-cargo": Label("@vendor_ts__ra_ap_load-cargo-0.0.273//:ra_ap_load_cargo"), + "ra_ap_parser": Label("@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser"), + "ra_ap_paths": Label("@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths"), + "ra_ap_project_model": Label("@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model"), + "ra_ap_span": Label("@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span"), + "ra_ap_syntax": Label("@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax"), + "ra_ap_vfs": Label("@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs"), "serde": Label("@vendor_ts__serde-1.0.219//:serde"), "serde_json": Label("@vendor_ts__serde_json-1.0.140//:serde_json"), "serde_with": Label("@vendor_ts__serde_with-3.12.0//:serde_with"), @@ -392,7 +391,7 @@ _NORMAL_ALIASES = { }, "rust/ast-generator": { _COMMON_CONDITION: { - Label("@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx"): "stdx", + Label("@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx"): "stdx", }, }, "rust/autobuild": { @@ -596,6 +595,7 @@ _CONDITIONS = { "cfg(all(target_arch = \"x86_64\", target_env = \"gnu\", not(target_abi = \"llvm\"), not(windows_raw_dylib)))": ["@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], "cfg(all(target_arch = \"x86_64\", target_env = \"msvc\", not(windows_raw_dylib)))": ["@rules_rust//rust/platform:x86_64-pc-windows-msvc"], "cfg(all(target_os = \"linux\", not(target_env = \"ohos\")))": ["@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "cfg(all(target_os = \"linux\", target_env = \"gnu\"))": ["@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], "cfg(all(windows, not(target_vendor = \"win7\")))": ["@rules_rust//rust/platform:aarch64-pc-windows-msvc", "@rules_rust//rust/platform:i686-pc-windows-msvc", "@rules_rust//rust/platform:x86_64-pc-windows-msvc"], "cfg(any())": [], "cfg(any(target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"hurd\", target_os = \"illumos\", all(target_os = \"horizon\", target_arch = \"arm\")))": ["@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-freebsd"], @@ -829,22 +829,22 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__bitflags-2.8.0", - sha256 = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36", + name = "vendor_ts__bitflags-2.9.0", + sha256 = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd", type = "tar.gz", - urls = ["https://static.crates.io/crates/bitflags/2.8.0/download"], - strip_prefix = "bitflags-2.8.0", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.bitflags-2.8.0.bazel"), + urls = ["https://static.crates.io/crates/bitflags/2.9.0/download"], + strip_prefix = "bitflags-2.9.0", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.bitflags-2.9.0.bazel"), ) maybe( http_archive, - name = "vendor_ts__borsh-1.5.3", - sha256 = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03", + name = "vendor_ts__borsh-1.5.5", + sha256 = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc", type = "tar.gz", - urls = ["https://static.crates.io/crates/borsh/1.5.3/download"], - strip_prefix = "borsh-1.5.3", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.borsh-1.5.3.bazel"), + urls = ["https://static.crates.io/crates/borsh/1.5.5/download"], + strip_prefix = "borsh-1.5.5", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.borsh-1.5.5.bazel"), ) maybe( @@ -919,12 +919,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__cargo_metadata-0.18.1", - sha256 = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037", + name = "vendor_ts__cargo_metadata-0.19.2", + sha256 = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba", type = "tar.gz", - urls = ["https://static.crates.io/crates/cargo_metadata/0.18.1/download"], - strip_prefix = "cargo_metadata-0.18.1", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.cargo_metadata-0.18.1.bazel"), + urls = ["https://static.crates.io/crates/cargo_metadata/0.19.2/download"], + strip_prefix = "cargo_metadata-0.19.2", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.cargo_metadata-0.19.2.bazel"), ) maybe( @@ -1009,22 +1009,22 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__clap-4.5.32", - sha256 = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83", + name = "vendor_ts__clap-4.5.35", + sha256 = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944", type = "tar.gz", - urls = ["https://static.crates.io/crates/clap/4.5.32/download"], - strip_prefix = "clap-4.5.32", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.clap-4.5.32.bazel"), + urls = ["https://static.crates.io/crates/clap/4.5.35/download"], + strip_prefix = "clap-4.5.35", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.clap-4.5.35.bazel"), ) maybe( http_archive, - name = "vendor_ts__clap_builder-4.5.32", - sha256 = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8", + name = "vendor_ts__clap_builder-4.5.35", + sha256 = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9", type = "tar.gz", - urls = ["https://static.crates.io/crates/clap_builder/4.5.32/download"], - strip_prefix = "clap_builder-4.5.32", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.clap_builder-4.5.32.bazel"), + urls = ["https://static.crates.io/crates/clap_builder/4.5.35/download"], + strip_prefix = "clap_builder-4.5.35", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.clap_builder-4.5.35.bazel"), ) maybe( @@ -1319,12 +1319,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__equivalent-1.0.1", - sha256 = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5", + name = "vendor_ts__equivalent-1.0.2", + sha256 = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f", type = "tar.gz", - urls = ["https://static.crates.io/crates/equivalent/1.0.1/download"], - strip_prefix = "equivalent-1.0.1", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.equivalent-1.0.1.bazel"), + urls = ["https://static.crates.io/crates/equivalent/1.0.2/download"], + strip_prefix = "equivalent-1.0.2", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.equivalent-1.0.2.bazel"), ) maybe( @@ -1579,12 +1579,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__indexmap-2.7.0", - sha256 = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f", + name = "vendor_ts__indexmap-2.9.0", + sha256 = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e", type = "tar.gz", - urls = ["https://static.crates.io/crates/indexmap/2.7.0/download"], - strip_prefix = "indexmap-2.7.0", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.indexmap-2.7.0.bazel"), + urls = ["https://static.crates.io/crates/indexmap/2.9.0/download"], + strip_prefix = "indexmap-2.9.0", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.indexmap-2.9.0.bazel"), ) maybe( @@ -1649,12 +1649,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__itoa-1.0.14", - sha256 = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674", + name = "vendor_ts__itoa-1.0.15", + sha256 = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c", type = "tar.gz", - urls = ["https://static.crates.io/crates/itoa/1.0.14/download"], - strip_prefix = "itoa-1.0.14", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.itoa-1.0.14.bazel"), + urls = ["https://static.crates.io/crates/itoa/1.0.15/download"], + strip_prefix = "itoa-1.0.15", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.itoa-1.0.15.bazel"), ) maybe( @@ -1719,12 +1719,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__libc-0.2.169", - sha256 = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a", + name = "vendor_ts__libc-0.2.171", + sha256 = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6", type = "tar.gz", - urls = ["https://static.crates.io/crates/libc/0.2.169/download"], - strip_prefix = "libc-0.2.169", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.libc-0.2.169.bazel"), + urls = ["https://static.crates.io/crates/libc/0.2.171/download"], + strip_prefix = "libc-0.2.171", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.libc-0.2.171.bazel"), ) maybe( @@ -1769,12 +1769,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__log-0.4.25", - sha256 = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f", + name = "vendor_ts__log-0.4.27", + sha256 = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94", type = "tar.gz", - urls = ["https://static.crates.io/crates/log/0.4.25/download"], - strip_prefix = "log-0.4.25", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.log-0.4.25.bazel"), + urls = ["https://static.crates.io/crates/log/0.4.27/download"], + strip_prefix = "log-0.4.27", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.log-0.4.27.bazel"), ) maybe( @@ -1787,16 +1787,6 @@ def crate_repositories(): build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.loom-0.7.2.bazel"), ) - maybe( - http_archive, - name = "vendor_ts__lz4_flex-0.11.3", - sha256 = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5", - type = "tar.gz", - urls = ["https://static.crates.io/crates/lz4_flex/0.11.3/download"], - strip_prefix = "lz4_flex-0.11.3", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.lz4_flex-0.11.3.bazel"), - ) - maybe( http_archive, name = "vendor_ts__matchers-0.1.0", @@ -1949,12 +1939,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__oorandom-11.1.4", - sha256 = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9", + name = "vendor_ts__oorandom-11.1.5", + sha256 = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e", type = "tar.gz", - urls = ["https://static.crates.io/crates/oorandom/11.1.4/download"], - strip_prefix = "oorandom-11.1.4", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.oorandom-11.1.4.bazel"), + urls = ["https://static.crates.io/crates/oorandom/11.1.5/download"], + strip_prefix = "oorandom-11.1.5", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.oorandom-11.1.5.bazel"), ) maybe( @@ -2189,252 +2179,252 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__ra_ap_base_db-0.0.270", - sha256 = "4baa9734d254af14fd603528ad594650dea601b1764492bd39988da38598ae67", + name = "vendor_ts__ra_ap_base_db-0.0.273", + sha256 = "8fd761118bbafe29e2b187e694c6b8e800f2c7822bbc1d9d2db4ac21fb8b0365", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_base_db/0.0.270/download"], - strip_prefix = "ra_ap_base_db-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_base_db-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_base_db/0.0.273/download"], + strip_prefix = "ra_ap_base_db-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_base_db-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_cfg-0.0.270", - sha256 = "0ef2ba45636c5e585040c0c4bee640737a6001b08309f1a25ca78cf04abfbf90", + name = "vendor_ts__ra_ap_cfg-0.0.273", + sha256 = "5ce74ce1af24afd86d3529dbbf5a849d026948b2d8ba51d199b6ea6db6e345b6", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_cfg/0.0.270/download"], - strip_prefix = "ra_ap_cfg-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_cfg-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_cfg/0.0.273/download"], + strip_prefix = "ra_ap_cfg-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_cfg-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_edition-0.0.270", - sha256 = "8955c1484d5e7274f755187788ba0d51eb149f870c69cdf0d87c3b7edea20ea0", + name = "vendor_ts__ra_ap_edition-0.0.273", + sha256 = "f423b9fb19e3920e4c7039120d09d9c79070a26efe8ff9f787c7234b07f518c5", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_edition/0.0.270/download"], - strip_prefix = "ra_ap_edition-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_edition-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_edition/0.0.273/download"], + strip_prefix = "ra_ap_edition-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_edition-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_hir-0.0.270", - sha256 = "a51d7955beff2212701b149bea36d4cf2dc0f5cd129652c9bcf0cb5c0b021078", + name = "vendor_ts__ra_ap_hir-0.0.273", + sha256 = "dd4aa8a568b80d288b90c4fa5dc8a3cc405914d261bfd33a3761c1ba41be358d", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_hir/0.0.270/download"], - strip_prefix = "ra_ap_hir-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_hir/0.0.273/download"], + strip_prefix = "ra_ap_hir-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_hir_def-0.0.270", - sha256 = "e5c97e617e4c585d24b3d4f668861452aedddfbe0262f4c53235dcea77e62f9b", + name = "vendor_ts__ra_ap_hir_def-0.0.273", + sha256 = "acb18d9378a828a23ccf87b89199db005adb67ba2a05a37d7a3fcad4d1036e66", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_hir_def/0.0.270/download"], - strip_prefix = "ra_ap_hir_def-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_def-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_hir_def/0.0.273/download"], + strip_prefix = "ra_ap_hir_def-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_def-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_hir_expand-0.0.270", - sha256 = "be57c0d7e3f2180dd8ea584b11447f34060eadc06f0f6d559e2a790f6e91b6c5", + name = "vendor_ts__ra_ap_hir_expand-0.0.273", + sha256 = "094fa79d8f661f52cf3b7fb8b3d91c4be2ad9e71a3967d3dacd25429fa44b37d", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_hir_expand/0.0.270/download"], - strip_prefix = "ra_ap_hir_expand-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_expand-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_hir_expand/0.0.273/download"], + strip_prefix = "ra_ap_hir_expand-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_expand-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_hir_ty-0.0.270", - sha256 = "f260f35748f3035b46a8afcdebda7cb75d95c24750105fad86101d09a9d387c8", + name = "vendor_ts__ra_ap_hir_ty-0.0.273", + sha256 = "093482d200d5db421db5692e7819bbb14fb717cc8cb0f91f93cce9fde85b3df2", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_hir_ty/0.0.270/download"], - strip_prefix = "ra_ap_hir_ty-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_ty-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_hir_ty/0.0.273/download"], + strip_prefix = "ra_ap_hir_ty-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_ty-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_ide_db-0.0.270", - sha256 = "0426263be26e27cb55a3b9ef88b120511b66fe7d9b418a2473d6d5f3ac2fe0a6", + name = "vendor_ts__ra_ap_ide_db-0.0.273", + sha256 = "b655b92dfa9444db8129321b9217d9e4a83a58ee707aa1004a93052acfb43d57", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_ide_db/0.0.270/download"], - strip_prefix = "ra_ap_ide_db-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_ide_db-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_ide_db/0.0.273/download"], + strip_prefix = "ra_ap_ide_db-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_ide_db-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_intern-0.0.270", - sha256 = "f6ea8c9615b3b0688cf557e7310dbd9432f43860c8ea766d54f4416cbecf3571", + name = "vendor_ts__ra_ap_intern-0.0.273", + sha256 = "b4e528496b4d4c351806bb073d3d7f6526535741b9e8801776603c924bbec624", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_intern/0.0.270/download"], - strip_prefix = "ra_ap_intern-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_intern-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_intern/0.0.273/download"], + strip_prefix = "ra_ap_intern-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_intern-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_load-cargo-0.0.270", - sha256 = "570907e16725c13a678bfd8050ce8839af2831da042a0878b75ee8c41b0f7b0c", + name = "vendor_ts__ra_ap_load-cargo-0.0.273", + sha256 = "1a97a5070b2f4b99f56683d91b2687aa0c530d8969cc5252ec2ae5644e428ffe", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_load-cargo/0.0.270/download"], - strip_prefix = "ra_ap_load-cargo-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_load-cargo-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_load-cargo/0.0.273/download"], + strip_prefix = "ra_ap_load-cargo-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_load-cargo-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_mbe-0.0.270", - sha256 = "e893fe03b04b30c9b5a339ac2bf39ce32ac9c05a8b50121b7d89ce658346e164", + name = "vendor_ts__ra_ap_mbe-0.0.273", + sha256 = "b187ee5ee3fa726eeea5142242a0397e2200d77084026986a68324b9599f9046", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_mbe/0.0.270/download"], - strip_prefix = "ra_ap_mbe-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_mbe-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_mbe/0.0.273/download"], + strip_prefix = "ra_ap_mbe-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_mbe-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_parser-0.0.270", - sha256 = "6fd9a264120968b14a66b6ba756cd7f99435385b5dbc2f0a611cf3a12221c385", + name = "vendor_ts__ra_ap_parser-0.0.273", + sha256 = "2306e6c051e60483f3b317fac9dec6c883b7792eeb8db24ec6f39dbfa5430159", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_parser/0.0.270/download"], - strip_prefix = "ra_ap_parser-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_parser-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_parser/0.0.273/download"], + strip_prefix = "ra_ap_parser-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_parser-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_paths-0.0.270", - sha256 = "f47817351651e36b56ff3afc483b41600053c9cb7e67d945467c0abe93416032", + name = "vendor_ts__ra_ap_paths-0.0.273", + sha256 = "dcedd00499621bdd0f1fe01955c04e4b388197aa826744003afaf6cc2944bc80", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_paths/0.0.270/download"], - strip_prefix = "ra_ap_paths-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_paths-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_paths/0.0.273/download"], + strip_prefix = "ra_ap_paths-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_paths-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_proc_macro_api-0.0.270", - sha256 = "d96da3b8b9f6b813a98f5357eef303905450741f47ba90adaab8a5371b748416", + name = "vendor_ts__ra_ap_proc_macro_api-0.0.273", + sha256 = "7a2e49b550015cd4ad152bd78d92d73594497f2e44f61273f9fed3534ad4bbbe", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_proc_macro_api/0.0.270/download"], - strip_prefix = "ra_ap_proc_macro_api-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_proc_macro_api-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_proc_macro_api/0.0.273/download"], + strip_prefix = "ra_ap_proc_macro_api-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_proc_macro_api-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_profile-0.0.270", - sha256 = "13637377287c84f88a628e40229d271ef0081c0d683956bd99a6c8278a4f8b14", + name = "vendor_ts__ra_ap_profile-0.0.273", + sha256 = "87cdbd27ebe02ec21fdae3df303f194bda036a019ecef80d47e0082646f06c54", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_profile/0.0.270/download"], - strip_prefix = "ra_ap_profile-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_profile-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_profile/0.0.273/download"], + strip_prefix = "ra_ap_profile-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_profile-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_project_model-0.0.270", - sha256 = "053c5207a638fc7a752c7a454bc952b28b0d02f0bf9f6d7ec785ec809579d8fa", + name = "vendor_ts__ra_ap_project_model-0.0.273", + sha256 = "5eaa3406c891a7840d20ce615f8decca32cbc9d3654b82dcbcc3a31257ce90b9", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_project_model/0.0.270/download"], - strip_prefix = "ra_ap_project_model-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_project_model-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_project_model/0.0.273/download"], + strip_prefix = "ra_ap_project_model-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_project_model-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_query-group-macro-0.0.270", - sha256 = "0f1a38f07b442e47a234cbe2e8fd1b8a41ff0cc5123cb1cf994c5ce20edb5bd6", + name = "vendor_ts__ra_ap_query-group-macro-0.0.273", + sha256 = "1fbc1748e4876a9b0ccfacfc7e2fe254f30e92ef58d98925282b3803e8b004ed", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_query-group-macro/0.0.270/download"], - strip_prefix = "ra_ap_query-group-macro-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_query-group-macro-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_query-group-macro/0.0.273/download"], + strip_prefix = "ra_ap_query-group-macro-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_query-group-macro-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_span-0.0.270", - sha256 = "8818680c6f7da3b32cb2bb0992940b24264b1aa90203aa94812e09ab34d362d1", + name = "vendor_ts__ra_ap_span-0.0.273", + sha256 = "ed1d036e738bf32a057d90698df85bcb83ed6263b5fe9fba132c99e8ec3aecaf", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_span/0.0.270/download"], - strip_prefix = "ra_ap_span-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_span-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_span/0.0.273/download"], + strip_prefix = "ra_ap_span-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_span-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_stdx-0.0.270", - sha256 = "f1c10bee1b03fc48083862c13cf06bd3ed17760463ecce2734103a2f511e5ed4", + name = "vendor_ts__ra_ap_stdx-0.0.273", + sha256 = "6e3775954ab24408f71e97079a97558078a166a4082052e83256ae4c22dae18d", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_stdx/0.0.270/download"], - strip_prefix = "ra_ap_stdx-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_stdx-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_stdx/0.0.273/download"], + strip_prefix = "ra_ap_stdx-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_stdx-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_syntax-0.0.270", - sha256 = "92bc32f3946fc5fcbdc79e61b7e26a8c2a3a56f3ef6ab27c7d298a9e21a462f2", + name = "vendor_ts__ra_ap_syntax-0.0.273", + sha256 = "b49b081f209a764700f688db91820a66c2ecfe5f138895d831361cf84f716691", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_syntax/0.0.270/download"], - strip_prefix = "ra_ap_syntax-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_syntax-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_syntax/0.0.273/download"], + strip_prefix = "ra_ap_syntax-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_syntax-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_syntax-bridge-0.0.270", - sha256 = "a42052c44c98c122c37aac476260c8f19d8fec495edc9c05835307c9ae86194d", + name = "vendor_ts__ra_ap_syntax-bridge-0.0.273", + sha256 = "f2740bbe603d527f2cf0aaf51629de7d072694fbbaaeda8264f7591be1493d1b", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_syntax-bridge/0.0.270/download"], - strip_prefix = "ra_ap_syntax-bridge-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_syntax-bridge-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_syntax-bridge/0.0.273/download"], + strip_prefix = "ra_ap_syntax-bridge-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_syntax-bridge-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_toolchain-0.0.270", - sha256 = "75996e70b3a0c68cd5157ba01f018964c7c6a5d7b209047d449b393139d0b57f", + name = "vendor_ts__ra_ap_toolchain-0.0.273", + sha256 = "efbff9f26f307ef958586357d1653d000861dcd3acbaf33a009651e024720c7e", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_toolchain/0.0.270/download"], - strip_prefix = "ra_ap_toolchain-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_toolchain-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_toolchain/0.0.273/download"], + strip_prefix = "ra_ap_toolchain-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_toolchain-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_tt-0.0.270", - sha256 = "0e4ee31e93bfabe83e6720b7469db88d7ad7ec5c59a1f011efec4aa1327ffc5c", + name = "vendor_ts__ra_ap_tt-0.0.273", + sha256 = "0b1ce3ac14765e414fa6031fda7dc35d3492c74de225aac689ba8b8bf037e1f8", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_tt/0.0.270/download"], - strip_prefix = "ra_ap_tt-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_tt-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_tt/0.0.273/download"], + strip_prefix = "ra_ap_tt-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_tt-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_vfs-0.0.270", - sha256 = "f6aac1e277ac70bb073f40f8a3fc44e4b1bb9e4d4b1d0e0bd2f8269543560f80", + name = "vendor_ts__ra_ap_vfs-0.0.273", + sha256 = "29427a7c27ce8ddfefb52d77c952a4588c74d0a7ab064dc627129088a90423ca", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_vfs/0.0.270/download"], - strip_prefix = "ra_ap_vfs-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_vfs-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_vfs/0.0.273/download"], + strip_prefix = "ra_ap_vfs-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_vfs-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_vfs-notify-0.0.270", - sha256 = "cd95285146049621ee8f7a512c982a008bf036321fcc9b01a95c1ad7e6aeae57", + name = "vendor_ts__ra_ap_vfs-notify-0.0.273", + sha256 = "d5a0e3095b8216ecc131f38b4b0025cac324a646469a95d2670354aee7278078", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_vfs-notify/0.0.270/download"], - strip_prefix = "ra_ap_vfs-notify-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_vfs-notify-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_vfs-notify/0.0.273/download"], + strip_prefix = "ra_ap_vfs-notify-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_vfs-notify-0.0.273.bazel"), ) maybe( @@ -2588,12 +2578,13 @@ def crate_repositories(): ) maybe( - new_git_repository, - name = "vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab", - commit = "096d585100636bc2e9f09d7eefec38c5b334d47b", - init_submodules = True, - remote = "https://github.com/redsun82/rustc_apfloat.git", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel"), + http_archive, + name = "vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab", + sha256 = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f", + type = "tar.gz", + urls = ["https://static.crates.io/crates/rustc_apfloat/0.2.2+llvm-462a31f5a5ab/download"], + strip_prefix = "rustc_apfloat-0.2.2+llvm-462a31f5a5ab", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel"), ) maybe( @@ -2678,12 +2669,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__semver-1.0.24", - sha256 = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba", + name = "vendor_ts__semver-1.0.26", + sha256 = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0", type = "tar.gz", - urls = ["https://static.crates.io/crates/semver/1.0.24/download"], - strip_prefix = "semver-1.0.24", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.semver-1.0.24.bazel"), + urls = ["https://static.crates.io/crates/semver/1.0.26/download"], + strip_prefix = "semver-1.0.26", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.semver-1.0.26.bazel"), ) maybe( @@ -2858,22 +2849,32 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__thiserror-1.0.69", - sha256 = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52", + name = "vendor_ts__thin-vec-0.2.14", + sha256 = "144f754d318415ac792f9d69fc87abbbfc043ce2ef041c60f16ad828f638717d", + type = "tar.gz", + urls = ["https://static.crates.io/crates/thin-vec/0.2.14/download"], + strip_prefix = "thin-vec-0.2.14", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thin-vec-0.2.14.bazel"), + ) + + maybe( + http_archive, + name = "vendor_ts__thiserror-2.0.12", + sha256 = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708", type = "tar.gz", - urls = ["https://static.crates.io/crates/thiserror/1.0.69/download"], - strip_prefix = "thiserror-1.0.69", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thiserror-1.0.69.bazel"), + urls = ["https://static.crates.io/crates/thiserror/2.0.12/download"], + strip_prefix = "thiserror-2.0.12", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thiserror-2.0.12.bazel"), ) maybe( http_archive, - name = "vendor_ts__thiserror-impl-1.0.69", - sha256 = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1", + name = "vendor_ts__thiserror-impl-2.0.12", + sha256 = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d", type = "tar.gz", - urls = ["https://static.crates.io/crates/thiserror-impl/1.0.69/download"], - strip_prefix = "thiserror-impl-1.0.69", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thiserror-impl-1.0.69.bazel"), + urls = ["https://static.crates.io/crates/thiserror-impl/2.0.12/download"], + strip_prefix = "thiserror-impl-2.0.12", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thiserror-impl-2.0.12.bazel"), ) maybe( @@ -3108,12 +3109,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__unicode-ident-1.0.16", - sha256 = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034", + name = "vendor_ts__unicode-ident-1.0.17", + sha256 = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe", type = "tar.gz", - urls = ["https://static.crates.io/crates/unicode-ident/1.0.16/download"], - strip_prefix = "unicode-ident-1.0.16", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.unicode-ident-1.0.16.bazel"), + urls = ["https://static.crates.io/crates/unicode-ident/1.0.17/download"], + strip_prefix = "unicode-ident-1.0.17", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.unicode-ident-1.0.17.bazel"), ) maybe( @@ -3651,7 +3652,7 @@ def crate_repositories(): struct(repo = "vendor_ts__argfile-0.2.1", is_dev_dep = False), struct(repo = "vendor_ts__chalk-ir-0.100.0", is_dev_dep = False), struct(repo = "vendor_ts__chrono-0.4.40", is_dev_dep = False), - struct(repo = "vendor_ts__clap-4.5.32", is_dev_dep = False), + struct(repo = "vendor_ts__clap-4.5.35", is_dev_dep = False), struct(repo = "vendor_ts__dunce-1.0.5", is_dev_dep = False), struct(repo = "vendor_ts__either-1.15.0", is_dev_dep = False), struct(repo = "vendor_ts__encoding-0.2.33", is_dev_dep = False), @@ -3666,22 +3667,22 @@ def crate_repositories(): struct(repo = "vendor_ts__num_cpus-1.16.0", is_dev_dep = False), struct(repo = "vendor_ts__proc-macro2-1.0.94", is_dev_dep = False), struct(repo = "vendor_ts__quote-1.0.40", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_base_db-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_cfg-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_hir-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_hir_def-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_hir_expand-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_hir_ty-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_ide_db-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_intern-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_load-cargo-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_parser-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_paths-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_project_model-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_span-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_stdx-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_syntax-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_vfs-0.0.270", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_base_db-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_cfg-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_hir-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_hir_def-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_hir_expand-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_hir_ty-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_ide_db-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_intern-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_load-cargo-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_parser-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_paths-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_project_model-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_span-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_stdx-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_syntax-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_vfs-0.0.273", is_dev_dep = False), struct(repo = "vendor_ts__rayon-1.10.0", is_dev_dep = False), struct(repo = "vendor_ts__regex-1.11.1", is_dev_dep = False), struct(repo = "vendor_ts__serde-1.0.219", is_dev_dep = False), diff --git a/rust/ast-generator/Cargo.toml b/rust/ast-generator/Cargo.toml index 23b2ab8cb158..233a380b2f71 100644 --- a/rust/ast-generator/Cargo.toml +++ b/rust/ast-generator/Cargo.toml @@ -10,7 +10,7 @@ ungrammar = "1.16.1" proc-macro2 = "1.0.94" quote = "1.0.40" either = "1.15.0" -stdx = {package = "ra_ap_stdx", version = "0.0.270"} +stdx = {package = "ra_ap_stdx", version = "0.0.273"} itertools = "0.14.0" mustache = "0.9.0" serde = { version = "1.0.219", features = ["derive"] } diff --git a/rust/extractor/Cargo.toml b/rust/extractor/Cargo.toml index d4f6a1770743..bdbe7c969eeb 100644 --- a/rust/extractor/Cargo.toml +++ b/rust/extractor/Cargo.toml @@ -7,24 +7,24 @@ license = "MIT" # When updating these dependencies, run `rust/update_cargo_deps.sh` [dependencies] anyhow = "1.0.97" -clap = { version = "4.5.32", features = ["derive"] } +clap = { version = "4.5.35", features = ["derive"] } figment = { version = "0.10.19", features = ["env", "yaml"] } num-traits = "0.2.19" -ra_ap_base_db = "0.0.270" -ra_ap_hir = "0.0.270" -ra_ap_hir_def = "0.0.270" -ra_ap_ide_db = "0.0.270" -ra_ap_hir_ty = "0.0.270" -ra_ap_hir_expand = "0.0.270" -ra_ap_load-cargo = "0.0.270" -ra_ap_paths = "0.0.270" -ra_ap_project_model = "0.0.270" -ra_ap_syntax = "0.0.270" -ra_ap_vfs = "0.0.270" -ra_ap_parser = "0.0.270" -ra_ap_span = "0.0.270" -ra_ap_cfg = "0.0.270" -ra_ap_intern = "0.0.270" +ra_ap_base_db = "0.0.273" +ra_ap_hir = "0.0.273" +ra_ap_hir_def = "0.0.273" +ra_ap_ide_db = "0.0.273" +ra_ap_hir_ty = "0.0.273" +ra_ap_hir_expand = "0.0.273" +ra_ap_load-cargo = "0.0.273" +ra_ap_paths = "0.0.273" +ra_ap_project_model = "0.0.273" +ra_ap_syntax = "0.0.273" +ra_ap_vfs = "0.0.273" +ra_ap_parser = "0.0.273" +ra_ap_span = "0.0.273" +ra_ap_cfg = "0.0.273" +ra_ap_intern = "0.0.273" serde = "1.0.219" serde_with = "3.12.0" triomphe = "0.1.14" From afb97d27977a9238a357e9ba305306bbc5f0859b Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 14:34:33 +0200 Subject: [PATCH 039/240] Rust: regenerate schema --- Cargo.lock | 1 - rust/extractor/src/generated/.generated.list | 2 +- rust/extractor/src/generated/top.rs | 4 ++++ rust/extractor/src/translate/generated.rs | 2 ++ rust/ql/.generated.list | 8 ++++---- .../lib/codeql/rust/elements/internal/generated/Raw.qll | 5 +++++ .../rust/elements/internal/generated/StructField.qll | 5 +++++ rust/ql/lib/rust.dbscheme | 5 +++++ .../extractor-tests/generated/StructField/StructField.ql | 9 +++++---- rust/schema/ast.py | 1 + 10 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd9023a315fa..3852eeba6bba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3033,4 +3033,3 @@ dependencies = [ name = "rustc_apfloat" version = "0.2.1+llvm-462a31f5a5ab" source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=096d585100636bc2e9f09d7eefec38c5b334d47b#096d585100636bc2e9f09d7eefec38c5b334d47b" - diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index 56c8762bcddf..82b6665615b5 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 -top.rs 50fa90457102611ea7892153e4beb7512d3704a1c78d9bb8e75eb96b98b31740 50fa90457102611ea7892153e4beb7512d3704a1c78d9bb8e75eb96b98b31740 +top.rs 060225ccbae440eef117e2ef0a82f3deba29e6ba2d35f00281f9c0e6a945e692 060225ccbae440eef117e2ef0a82f3deba29e6ba2d35f00281f9c0e6a945e692 diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index b65cec68264e..caeeb7552a7d 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -2612,6 +2612,7 @@ pub struct StructField { pub id: trap::TrapId, pub attrs: Vec>, pub default: Option>, + pub is_unsafe: bool, pub name: Option>, pub type_repr: Option>, pub visibility: Option>, @@ -2630,6 +2631,9 @@ impl trap::TrapEntry for StructField { if let Some(v) = self.default { out.add_tuple("struct_field_defaults", vec![id.into(), v.into()]); } + if self.is_unsafe { + out.add_tuple("struct_field_is_unsafe", vec![id.into()]); + } if let Some(v) = self.name { out.add_tuple("struct_field_names", vec![id.into(), v.into()]); } diff --git a/rust/extractor/src/translate/generated.rs b/rust/extractor/src/translate/generated.rs index 9f8e52e0a454..32b9c2367a64 100644 --- a/rust/extractor/src/translate/generated.rs +++ b/rust/extractor/src/translate/generated.rs @@ -1850,6 +1850,7 @@ impl Translator<'_> { if self.should_be_excluded(&node) { return None; } let attrs = node.attrs().filter_map(|x| self.emit_attr(x)).collect(); let default = node.expr().and_then(|x| self.emit_expr(x)); + let is_unsafe = node.unsafe_token().is_some(); let name = node.name().and_then(|x| self.emit_name(x)); let type_repr = node.ty().and_then(|x| self.emit_type(x)); let visibility = node.visibility().and_then(|x| self.emit_visibility(x)); @@ -1857,6 +1858,7 @@ impl Translator<'_> { id: TrapId::Star, attrs, default, + is_unsafe, name, type_repr, visibility, diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 0bd2931256e7..0ff3e721e231 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -579,7 +579,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll c808c9d84dd7800573832b lib/codeql/rust/elements/internal/generated/ParenExpr.qll bc0731505bfe88516205ec360582a4222d2681d11342c93e15258590ddee82f2 d4bd6e0c80cf1d63746c88d4bcb3a01d4c75732e5da09e3ebd9437ced227fb60 lib/codeql/rust/elements/internal/generated/ParenPat.qll 4f168ef5d5bb87a903251cc31b2e44a759b099ec69c90af31783fbb15778c940 0e34f94a45a13396fd57d94c245dc64d1adde2ab0e22b56946f7e94c04e297fc lib/codeql/rust/elements/internal/generated/ParenTypeRepr.qll 40ab5c592e7699c621787793743e33988de71ff42ca27599f5ab3ddb70e3f7d8 12c0a6eed2202ee3e892f61da3b3ce77ac3190854cdf3097e8d2be98aa3cb91d -lib/codeql/rust/elements/internal/generated/ParentChild.qll 3a9dd595f34bc5841d21f91882b01f2882b18b70e8c718e81d491b4b33bad82b fb40a76aff319ec5f7dae9a05da083b337887b0918b3702641b39342213ddf6f +lib/codeql/rust/elements/internal/generated/ParentChild.qll d1770632e8d0c649ebcbcab9cbc653531ecf521bbf5d891941db8c0927ae6796 fb40a76aff319ec5f7dae9a05da083b337887b0918b3702641b39342213ddf6f lib/codeql/rust/elements/internal/generated/ParenthesizedArgList.qll c5fa328ea60d3a3333d7c7bb3480969c1873166c7ac8ebb9d0afad7a8099d1a8 2dbbb6200d96f7db7dea4a55bdeab8d67b14d39a43e0bd54ada019f7e466f163 lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll 9b12afb46fc5a9ad3a811b05472621bbecccb900c47504feb7f29d96b28421ca bcacbffc36fb3e0c9b26523b5963af0ffa9fd6b19f00a2a31bdb2316071546bd @@ -594,7 +594,7 @@ lib/codeql/rust/elements/internal/generated/PtrTypeRepr.qll 51d1e9e683fc79dddbff lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll 80826a6a6868a803aa2372e31c52a03e1811a3f1f2abdb469f91ca0bfdd9ecb6 34ee1e208c1690cba505dff2c588837c0cd91e185e2a87d1fe673191962276a9 -lib/codeql/rust/elements/internal/generated/Raw.qll 4a73b51a4e7c995c42d68cf64ff8aff351d898f306ceedf70a009bf86bbf7d84 f7ccdbc4841d87dae7bbf6f58556901176c930a9a797a59dbc04269ca3b516ce +lib/codeql/rust/elements/internal/generated/Raw.qll 6e33d9fa21ee3287a0ebc27856a09f4fdc4d587b5a31ff1c4337106de7ca1a2e eece38e6accb6b9d8838fd05edd7cbaf6f7ee37190adbef2b023ad91064d1622 lib/codeql/rust/elements/internal/generated/RefExpr.qll 7d995884e3dc1c25fc719f5d7253179344d63650e217e9ff6530285fe7a57f64 f2c3c12551deea4964b66553fb9b6423ee16fec53bd63db4796191aa60dc6c66 lib/codeql/rust/elements/internal/generated/RefPat.qll 456ede39837463ee22a630ec7ab6c8630d3664a8ea206fcc6e4f199e92fa564c 5622062765f32930465ba6b170e986706f159f6070f48adee3c20e24e8df4e05 lib/codeql/rust/elements/internal/generated/RefTypeRepr.qll 3d8c0bd296d33b91a81633f697a43269a6538df06d277262d3990d3f6880ef57 13680f39e89bcd8299c218aba396f3deec804597e6f7cb7d4a7e7c748b6faa77 @@ -615,7 +615,7 @@ lib/codeql/rust/elements/internal/generated/Struct.qll b54a48c32d99345f22f189da8 lib/codeql/rust/elements/internal/generated/StructExpr.qll c6d861eaa0123b103fd9ffd2485423419ef9b7e0b4af9ed2a2090d8ec534f65d 50da99ee44771e1239ed8919f711991dd3ec98589fbe49b49b68c88074a07d74 lib/codeql/rust/elements/internal/generated/StructExprField.qll 6bdc52ed325fd014495410c619536079b8c404e2247bd2435aa7685dd56c3833 501a30650cf813176ff325a1553da6030f78d14be3f84fea6d38032f4262c6b0 lib/codeql/rust/elements/internal/generated/StructExprFieldList.qll b19b6869a6828c7a39a7312539eb29fd21734ff47dfd02281de74194fd565d7e 3cadebffaa937e367a5e1da6741e4e9e5c9a9c7f7555e28cfa70639afd19db7c -lib/codeql/rust/elements/internal/generated/StructField.qll bcbaa836d9b9889c87ba57c6ea733cdc85425168d9df05aca5cfd051851d8cd1 a17034896bc7fa25c84e40b460109d122ca1e85632cf8ac620f66f3eb0ff81b5 +lib/codeql/rust/elements/internal/generated/StructField.qll 18b62eb2ea7d3fe109308540cb219763e968b866c8600226b44f81159d3c549b 1acfc0da7ae1d8d4b3fa2cdcc440cc1423c5cd885da03c0e8b2c81a2b089cbbb lib/codeql/rust/elements/internal/generated/StructFieldList.qll 8911a44217d091b05f488da4e012cb026aed0630caa84ca301bbcbd054c9a28c a433383fea7e42f20750aa43e6070c23baad761a4264be99257541c1004ead31 lib/codeql/rust/elements/internal/generated/StructPat.qll c76fa005c2fd0448a8803233e1e8818c4123301eb66ac5cf69d0b9eaafc61e98 6e0dffccdce24bca20e87d5ba0f0995c9a1ae8983283e71e7dbfcf6fffc67a58 lib/codeql/rust/elements/internal/generated/StructPatField.qll 5b5c7302dbc4a902ca8e69ff31875c867e295a16a626ba3cef29cd0aa248f179 4e192a0df79947f5cb0d47fdbbba7986137a6a40a1be92ae119873e2fad67edf @@ -1087,7 +1087,7 @@ test/extractor-tests/generated/StructExprFieldList/StructExprFieldList.ql 33dc3f test/extractor-tests/generated/StructExprFieldList/StructExprFieldList_getAttr.ql cd7f5236f6b660fc064f3a04f3a58d720ed4e81916cbd1a049c1fac7171108ed 61317928d0833f7bb55255a5045bedc0913db1266e963ede97d597ee43e3ddd9 test/extractor-tests/generated/StructExprFieldList/StructExprFieldList_getField.ql 1292aec1141bdb75fd8e0993f683035f396a0e6c841b76ee86a0a1d3dce0dbc4 450eccbd07cc0aa81cef698f43d60aeb55f8952a573eaf84a389a6449c3d63a7 test/extractor-tests/generated/StructExprFieldList/StructExprFieldList_getSpread.ql d0470b9846323d0408e0f26444cdc5322d78ce1ac203073ff4f556dac5343be7 280712a0b3714256aff4c2a4370fd43e70c418f526e383ed7100d61cdf790c36 -test/extractor-tests/generated/StructField/StructField.ql 7943d00e32171da93fae8215456c79b2df590cffa7241f4c0e78b0d7d525b1b2 6d5e3825075d2cb4438adf699a5a92ce22301ea58888d63ea336118bf29c0205 +test/extractor-tests/generated/StructField/StructField.ql 5ec75ec3c1a18299259dfa041790e9b4a791ceb1706aadea3537d0a67e7e65bb cba580a8678547dc88a736bd639cc4d8e84ec32a9ad1095e50f7e03047c37f1c test/extractor-tests/generated/StructField/StructField_getAttr.ql a01715bc688d5fa48c9dd4bfab21d0909169f851a290895c13a181f22c0e73a9 fa6ffcf007492d9e1b7f90d571b9747bd47b2dc29e558a8e1c3013c5949dcdb7 test/extractor-tests/generated/StructField/StructField_getDefault.ql deccc63b81892cd1b293d8b328ad5b3efdf32892efc8b161dfcd89330ca6b5a2 9a9f306f63208ce30d26f91dd15b94867a7d9affd31a0f51a3d1d2ce50786abc test/extractor-tests/generated/StructField/StructField_getName.ql 4c5a7e00b758a744a719bff63d493ee7d31ff8b3010e00c1d1449034d00130ec 9b284d848e5c86eac089f33deca7586441a89d927e7703cb4f98bb7c65a7238c diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 34d29ba230ed..3bd57ae98620 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -955,6 +955,11 @@ module Raw { */ Expr getDefault() { struct_field_defaults(this, result) } + /** + * Holds if this struct field is unsafe. + */ + predicate isUnsafe() { struct_field_is_unsafe(this) } + /** * Gets the name of this struct field, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/StructField.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/StructField.qll index c5525b86dbae..cd392811e191 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/StructField.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/StructField.qll @@ -64,6 +64,11 @@ module Generated { */ final predicate hasDefault() { exists(this.getDefault()) } + /** + * Holds if this struct field is unsafe. + */ + predicate isUnsafe() { Synth::convertStructFieldToRaw(this).(Raw::StructField).isUnsafe() } + /** * Gets the name of this struct field, if it exists. */ diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index 256e80c2dcea..e8707b675dc5 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -976,6 +976,11 @@ struct_field_defaults( int default: @expr ref ); +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + #keyset[id] struct_field_names( int id: @struct_field ref, diff --git a/rust/ql/test/extractor-tests/generated/StructField/StructField.ql b/rust/ql/test/extractor-tests/generated/StructField/StructField.ql index dfd4327e74c4..cf7b3d995e13 100644 --- a/rust/ql/test/extractor-tests/generated/StructField/StructField.ql +++ b/rust/ql/test/extractor-tests/generated/StructField/StructField.ql @@ -3,15 +3,16 @@ import codeql.rust.elements import TestUtils from - StructField x, int getNumberOfAttrs, string hasDefault, string hasName, string hasTypeRepr, - string hasVisibility + StructField x, int getNumberOfAttrs, string hasDefault, string isUnsafe, string hasName, + string hasTypeRepr, string hasVisibility where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasDefault() then hasDefault = "yes" else hasDefault = "no") and + (if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and (if x.hasTypeRepr() then hasTypeRepr = "yes" else hasTypeRepr = "no") and if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasDefault:", hasDefault, "hasName:", hasName, - "hasTypeRepr:", hasTypeRepr, "hasVisibility:", hasVisibility +select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasDefault:", hasDefault, "isUnsafe:", isUnsafe, + "hasName:", hasName, "hasTypeRepr:", hasTypeRepr, "hasVisibility:", hasVisibility diff --git a/rust/schema/ast.py b/rust/schema/ast.py index e5be9e1a0a0f..dabe1be807ae 100644 --- a/rust/schema/ast.py +++ b/rust/schema/ast.py @@ -539,6 +539,7 @@ class StructExprFieldList(AstNode, ): class StructField(AstNode, ): attrs: list["Attr"] | child default: optional["Expr"] | child + is_unsafe: predicate name: optional["Name"] | child type_repr: optional["TypeRepr"] | child visibility: optional["Visibility"] | child From 132632b2a1dbd6049168c5d47287ad7aaa3f97f0 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 14:45:55 +0200 Subject: [PATCH 040/240] Cargo: update `rustc_apfloat` patched revision --- Cargo.lock | 8 +------- Cargo.toml | 2 +- .../3rdparty/tree_sitter_extractors_deps/defs.bzl | 10 +++++----- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3852eeba6bba..f425373ceea5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2071,8 +2071,7 @@ checksum = "2febf9acc5ee5e99d1ad0afcdbccc02d87aa3f857a1f01f825b80eacf8edfcd1" [[package]] name = "rustc_apfloat" version = "0.2.2+llvm-462a31f5a5ab" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f" +source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=32968f16ef1b082243f9bf43a3fbd65c381b3e27#32968f16ef1b082243f9bf43a3fbd65c381b3e27" dependencies = [ "bitflags 2.9.0", "smallvec", @@ -3028,8 +3027,3 @@ dependencies = [ "quote", "syn", ] - -[[patch.unused]] -name = "rustc_apfloat" -version = "0.2.1+llvm-462a31f5a5ab" -source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=096d585100636bc2e9f09d7eefec38c5b334d47b#096d585100636bc2e9f09d7eefec38c5b334d47b" diff --git a/Cargo.toml b/Cargo.toml index b20cf6dd0ede..d74066772488 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,4 +14,4 @@ members = [ [patch.crates-io] # patch for build script bug preventing bazel build # see https://github.com/rust-lang/rustc_apfloat/pull/17 -rustc_apfloat = { git = "https://github.com/redsun82/rustc_apfloat.git", rev = "096d585100636bc2e9f09d7eefec38c5b334d47b" } +rustc_apfloat = { git = "https://github.com/redsun82/rustc_apfloat.git", rev = "32968f16ef1b082243f9bf43a3fbd65c381b3e27" } diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl index b2db5d16f583..ee2044468e73 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl @@ -16,6 +16,7 @@ """ load("@bazel_skylib//lib:selects.bzl", "selects") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") @@ -2578,12 +2579,11 @@ def crate_repositories(): ) maybe( - http_archive, + new_git_repository, name = "vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab", - sha256 = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f", - type = "tar.gz", - urls = ["https://static.crates.io/crates/rustc_apfloat/0.2.2+llvm-462a31f5a5ab/download"], - strip_prefix = "rustc_apfloat-0.2.2+llvm-462a31f5a5ab", + commit = "32968f16ef1b082243f9bf43a3fbd65c381b3e27", + init_submodules = True, + remote = "https://github.com/redsun82/rustc_apfloat.git", build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel"), ) From 260322b669e436f5f7776869b363489b202459d2 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 15:25:19 +0200 Subject: [PATCH 041/240] Rust: fix compilation errors --- rust/extractor/src/crate_graph.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index bc0389e8ce5f..88802e6239b6 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -18,15 +18,18 @@ use ra_ap_hir_def::{ }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; -use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; use ra_ap_hir_ty::WhereClause; use ra_ap_hir_ty::{Binders, FnPointer}; use ra_ap_hir_ty::{Interner, ProjectionTy}; +use ra_ap_hir_ty::{TraitRefExt, from_assoc_type_id}; use ra_ap_ide_db::RootDatabase; use ra_ap_vfs::{Vfs, VfsPath}; +use ra_ap_hir_def::data::ConstFlags; +use ra_ap_hir_def::item_tree::StaticFlags; +use ra_ap_hir_ty::db::InternedCallableDefId; use std::hash::Hasher; use std::{cmp::Ordering, collections::HashMap, path::PathBuf}; use std::{hash::Hash, vec}; @@ -374,7 +377,7 @@ fn emit_const( attrs: vec![], body: None, is_const: true, - is_default: konst.has_body, + is_default: konst.flags.contains(ConstFlags::HAS_BODY), type_repr, visibility, }) @@ -407,9 +410,9 @@ fn emit_static( body: None, type_repr, visibility, - is_mut: statik.mutable, + is_mut: statik.flags.contains(StaticFlags::MUTABLE), is_static: true, - is_unsafe: statik.has_unsafe_kw, + is_unsafe: statik.flags.contains(StaticFlags::HAS_UNSAFE_KW), }) .into(), ); @@ -774,7 +777,9 @@ fn const_or_function( let type_: &chalk_ir::Ty = type_.skip_binders(); match type_.kind(ra_ap_hir_ty::Interner) { chalk_ir::TyKind::FnDef(fn_def_id, parameters) => { - let data = db.fn_def_datum(*fn_def_id); + let callable_def_id = + db.lookup_intern_callable_def(InternedCallableDefId::from(*fn_def_id)); + let data = db.fn_def_datum(callable_def_id); let sig = ra_ap_hir_ty::CallableSig::from_def(db, *fn_def_id, parameters); let params = sig @@ -1200,7 +1205,7 @@ fn emit_hir_ty( substitution: _, })) | chalk_ir::TyKind::AssociatedType(associated_ty_id, _) => { - let assoc_ty_data = db.associated_ty_data(*associated_ty_id); + let assoc_ty_data = db.associated_ty_data(from_assoc_type_id(*associated_ty_id)); let _name = db .type_alias_data(assoc_ty_data.name) @@ -1302,6 +1307,7 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari trap.emit(generated::StructField { id: trap::TrapId::Star, attrs: vec![], + is_unsafe: false, name, type_repr, visibility, From 1f9455c434bab9988e8d5312b0219170d7b9f297 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 15:39:14 +0200 Subject: [PATCH 042/240] Rust: add upgrade/downgrade scripts for `struct_field_is_unsafe` --- .../old.dbscheme | 3606 +++++++++++++++++ .../rust.dbscheme | 3601 ++++++++++++++++ .../upgrade.properties | 4 + .../old.dbscheme | 3601 ++++++++++++++++ .../rust.dbscheme | 3606 +++++++++++++++++ .../upgrade.properties | 2 + 6 files changed, 14420 insertions(+) create mode 100644 rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/old.dbscheme create mode 100644 rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/rust.dbscheme create mode 100644 rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/upgrade.properties create mode 100644 rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/old.dbscheme create mode 100644 rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/rust.dbscheme create mode 100644 rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/upgrade.properties diff --git a/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/old.dbscheme b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/old.dbscheme new file mode 100644 index 000000000000..e8707b675dc5 --- /dev/null +++ b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/old.dbscheme @@ -0,0 +1,3606 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @macro_stmts +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id] +crate_modules( + int id: @crate ref, + int module: @module ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +macro_stmts( + unique int id: @macro_stmts +); + +#keyset[id] +macro_stmts_exprs( + int id: @macro_stmts ref, + int expr: @expr ref +); + +#keyset[id, index] +macro_stmts_statements( + int id: @macro_stmts ref, + int index: int ref, + int statement: @stmt ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_expandeds( + int id: @macro_call ref, + int expanded: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/rust.dbscheme b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/rust.dbscheme new file mode 100644 index 000000000000..256e80c2dcea --- /dev/null +++ b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/rust.dbscheme @@ -0,0 +1,3601 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @macro_stmts +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id] +crate_modules( + int id: @crate ref, + int module: @module ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +macro_stmts( + unique int id: @macro_stmts +); + +#keyset[id] +macro_stmts_exprs( + int id: @macro_stmts ref, + int expr: @expr ref +); + +#keyset[id, index] +macro_stmts_statements( + int id: @macro_stmts ref, + int index: int ref, + int statement: @stmt ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_expandeds( + int id: @macro_call ref, + int expanded: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/upgrade.properties b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/upgrade.properties new file mode 100644 index 000000000000..589e2d2682a8 --- /dev/null +++ b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/upgrade.properties @@ -0,0 +1,4 @@ +description: Remove `struct_field_is_unsafe` table +compatibility: backwards + +struct_field_is_unsafe.rel: delete diff --git a/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/old.dbscheme b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/old.dbscheme new file mode 100644 index 000000000000..256e80c2dcea --- /dev/null +++ b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/old.dbscheme @@ -0,0 +1,3601 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @macro_stmts +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id] +crate_modules( + int id: @crate ref, + int module: @module ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +macro_stmts( + unique int id: @macro_stmts +); + +#keyset[id] +macro_stmts_exprs( + int id: @macro_stmts ref, + int expr: @expr ref +); + +#keyset[id, index] +macro_stmts_statements( + int id: @macro_stmts ref, + int index: int ref, + int statement: @stmt ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_expandeds( + int id: @macro_call ref, + int expanded: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/rust.dbscheme b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/rust.dbscheme new file mode 100644 index 000000000000..e8707b675dc5 --- /dev/null +++ b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/rust.dbscheme @@ -0,0 +1,3606 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @macro_stmts +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id] +crate_modules( + int id: @crate ref, + int module: @module ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +macro_stmts( + unique int id: @macro_stmts +); + +#keyset[id] +macro_stmts_exprs( + int id: @macro_stmts ref, + int expr: @expr ref +); + +#keyset[id, index] +macro_stmts_statements( + int id: @macro_stmts ref, + int index: int ref, + int statement: @stmt ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_expandeds( + int id: @macro_call ref, + int expanded: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/upgrade.properties b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/upgrade.properties new file mode 100644 index 000000000000..c977c1fd43fc --- /dev/null +++ b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/upgrade.properties @@ -0,0 +1,2 @@ +description: Add `struct_field_is_unsafe` table +compatibility: backwards From de0d374cce0b3cc2a8522813834581bfc1644cc3 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 16:58:26 +0200 Subject: [PATCH 043/240] Rust: add `upgrades` property in `qlpack.yml` --- rust/ql/lib/qlpack.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/ql/lib/qlpack.yml b/rust/ql/lib/qlpack.yml index 603ede342c78..b8bd5c63c9e1 100644 --- a/rust/ql/lib/qlpack.yml +++ b/rust/ql/lib/qlpack.yml @@ -4,6 +4,7 @@ groups: rust extractor: rust dbscheme: rust.dbscheme library: true +upgrades: upgrades dependencies: codeql/controlflow: ${workspace} codeql/dataflow: ${workspace} From ded27bcee45adf55f1c97a2f1b36af4c02fa1201 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 7 Apr 2025 12:50:19 +0100 Subject: [PATCH 044/240] Go: Replace `exec.Command("go"` with `toolchain.GoCommand(` --- go/extractor/cli/go-autobuilder/go-autobuilder.go | 6 +++--- go/extractor/toolchain/toolchain.go | 15 ++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/go/extractor/cli/go-autobuilder/go-autobuilder.go b/go/extractor/cli/go-autobuilder/go-autobuilder.go index aeff4f0bd6e1..23e0cb7fe0db 100644 --- a/go/extractor/cli/go-autobuilder/go-autobuilder.go +++ b/go/extractor/cli/go-autobuilder/go-autobuilder.go @@ -67,13 +67,13 @@ func restoreRepoLayout(fromDir string, dirEntries []string, scratchDirName strin // addVersionToMod add a go version directive, e.g. `go 1.14` to a `go.mod` file. func addVersionToMod(version string) bool { - cmd := exec.Command("go", "mod", "edit", "-go="+version) + cmd := toolchain.GoCommand("mod", "edit", "-go="+version) return util.RunCmd(cmd) } // checkVendor tests to see whether a vendor directory is inconsistent according to the go frontend func checkVendor() bool { - vendorCheckCmd := exec.Command("go", "list", "-mod=vendor", "./...") + vendorCheckCmd := toolchain.GoCommand("list", "-mod=vendor", "./...") outp, err := vendorCheckCmd.CombinedOutput() if err != nil { badVendorRe := regexp.MustCompile(`(?m)^go: inconsistent vendoring in .*:$`) @@ -438,7 +438,7 @@ func installDependencies(workspace project.GoWorkspace) { util.RunCmd(vendor) } - install = exec.Command("go", "get", "-v", "./...") + install = toolchain.GoCommand("get", "-v", "./...") install.Dir = path log.Printf("Installing dependencies using `go get -v ./...` in `%s`.\n", path) util.RunCmd(install) diff --git a/go/extractor/toolchain/toolchain.go b/go/extractor/toolchain/toolchain.go index 119e3782f6f6..47df9b11ad09 100644 --- a/go/extractor/toolchain/toolchain.go +++ b/go/extractor/toolchain/toolchain.go @@ -137,9 +137,14 @@ func SupportsWorkspaces() bool { return GetEnvGoSemVer().IsAtLeast(V1_18) } +// Constructs a `*exec.Cmd` for `go` with the specified arguments. +func GoCommand(arg ...string) *exec.Cmd { + return exec.Command("go", arg...) +} + // Run `go mod tidy -e` in the directory given by `path`. func TidyModule(path string) *exec.Cmd { - cmd := exec.Command("go", "mod", "tidy", "-e") + cmd := GoCommand("mod", "tidy", "-e") cmd.Dir = path return cmd } @@ -159,21 +164,21 @@ func InitModule(path string) *exec.Cmd { } } - modInit := exec.Command("go", "mod", "init", moduleName) + modInit := GoCommand("mod", "init", moduleName) modInit.Dir = path return modInit } // Constructs a command to run `go mod vendor -e` in the directory given by `path`. func VendorModule(path string) *exec.Cmd { - modVendor := exec.Command("go", "mod", "vendor", "-e") + modVendor := GoCommand("mod", "vendor", "-e") modVendor.Dir = path return modVendor } // Constructs a command to run `go version`. func Version() *exec.Cmd { - version := exec.Command("go", "version") + version := GoCommand("version") return version } @@ -209,7 +214,7 @@ func RunListWithEnv(format string, patterns []string, additionalEnv []string, fl func ListWithEnv(format string, patterns []string, additionalEnv []string, flags ...string) *exec.Cmd { args := append([]string{"list", "-e", "-f", format}, flags...) args = append(args, patterns...) - cmd := exec.Command("go", args...) + cmd := GoCommand(args...) cmd.Env = append(os.Environ(), additionalEnv...) return cmd } From 0f78e11376315a15a62375e535313851e16cd66e Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Tue, 8 Apr 2025 11:18:40 +0100 Subject: [PATCH 045/240] Go: Detect and apply proxy settings (WIP) --- go/extractor/toolchain/toolchain.go | 4 +- go/extractor/util/BUILD.bazel | 2 + go/extractor/util/registryproxy.go | 114 ++++++++++++++++++++++++ go/extractor/util/registryproxy_test.go | 49 ++++++++++ 4 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 go/extractor/util/registryproxy.go create mode 100644 go/extractor/util/registryproxy_test.go diff --git a/go/extractor/toolchain/toolchain.go b/go/extractor/toolchain/toolchain.go index 47df9b11ad09..43581b921005 100644 --- a/go/extractor/toolchain/toolchain.go +++ b/go/extractor/toolchain/toolchain.go @@ -139,7 +139,9 @@ func SupportsWorkspaces() bool { // Constructs a `*exec.Cmd` for `go` with the specified arguments. func GoCommand(arg ...string) *exec.Cmd { - return exec.Command("go", arg...) + cmd := exec.Command("go", arg...) + util.ApplyProxyEnvVars(cmd) + return cmd } // Run `go mod tidy -e` in the directory given by `path`. diff --git a/go/extractor/util/BUILD.bazel b/go/extractor/util/BUILD.bazel index b7a7783aa799..dd294a63a9c1 100644 --- a/go/extractor/util/BUILD.bazel +++ b/go/extractor/util/BUILD.bazel @@ -6,6 +6,7 @@ go_library( name = "util", srcs = [ "extractvendordirs.go", + "registryproxy.go", "semver.go", "util.go", ], @@ -17,6 +18,7 @@ go_library( go_test( name = "util_test", srcs = [ + "registryproxy_test.go", "semver_test.go", "util_test.go", ], diff --git a/go/extractor/util/registryproxy.go b/go/extractor/util/registryproxy.go new file mode 100644 index 000000000000..8f833c30d90b --- /dev/null +++ b/go/extractor/util/registryproxy.go @@ -0,0 +1,114 @@ +package util + +import ( + "encoding/json" + "fmt" + "log/slog" + "os" + "os/exec" + "strings" +) + +const PROXY_HOST = "CODEQL_PROXY_HOST" +const PROXY_PORT = "CODEQL_PROXY_PORT" +const PROXY_CA_CERTIFICATE = "CODEQL_PROXY_CA_CERTIFICATE" +const PROXY_URLS = "CODEQL_PROXY_URLS" +const GOPROXY_SERVER = "goproxy_server" + +type RegistryConfig struct { + Type string `json:"type"` + URL string `json:"url"` +} + +var proxy_address string +var proxy_cert_file string +var proxy_configs []RegistryConfig + +// Tries to parse the given string value into an array of RegistryConfig values. +func parseRegistryConfigs(str string) ([]RegistryConfig, error) { + var configs []RegistryConfig + if err := json.Unmarshal([]byte(str), &configs); err != nil { + return nil, err + } + + return configs, nil +} + +func checkEnvVars() { + if proxy_host, proxy_host_set := os.LookupEnv(PROXY_HOST); proxy_host_set { + if proxy_port, proxy_port_set := os.LookupEnv(PROXY_PORT); proxy_port_set { + proxy_address = fmt.Sprintf("http://%s:%s", proxy_host, proxy_port) + slog.Info("Found private registry proxy", slog.String("proxy_address", proxy_address)) + } + } + + if proxy_cert, proxy_cert_set := os.LookupEnv(PROXY_CA_CERTIFICATE); proxy_cert_set { + // Write the certificate to a temporary file + slog.Info("Found certificate") + + f, err := os.CreateTemp("", "codeql-proxy.crt") + if err != nil { + slog.Error("Unable to create temporary file for the proxy certificate", slog.String("error", err.Error())) + } + + _, err = f.WriteString(proxy_cert) + if err != nil { + slog.Error("Failed to write to the temporary certificate file", slog.String("error", err.Error())) + } + + err = f.Close() + if err != nil { + slog.Error("Failed to close the temporary certificate file", slog.String("error", err.Error())) + } else { + proxy_cert_file = f.Name() + } + } + + if proxy_urls, proxy_urls_set := os.LookupEnv(PROXY_URLS); proxy_urls_set { + val, err := parseRegistryConfigs(proxy_urls) + if err != nil { + slog.Error("Unable to parse proxy configurations", slog.String("error", err.Error())) + } else { + // We only care about private registry configurations that are relevant to Go and + // filter others out at this point. + proxy_configs = make([]RegistryConfig, 0) + for _, cfg := range val { + if cfg.Type == GOPROXY_SERVER { + proxy_configs = append(proxy_configs, cfg) + slog.Info("Found GOPROXY server", slog.String("url", cfg.URL)) + } + } + } + } +} + +// Applies private package proxy related environment variables to `cmd`. +func ApplyProxyEnvVars(cmd *exec.Cmd) { + slog.Info( + "Applying private registry proxy environment variables", + slog.String("cmd_args", strings.Join(cmd.Args, " ")), + ) + + checkEnvVars() + + if proxy_address != "" { + cmd.Env = append(cmd.Env, fmt.Sprintf("HTTP_PROXY=%s", proxy_address)) + cmd.Env = append(cmd.Env, fmt.Sprintf("HTTPS_PROXY=%s", proxy_address)) + } + if proxy_cert_file != "" { + slog.Info("Setting SSL_CERT_FILE", slog.String("proxy_cert_file", proxy_cert_file)) + cmd.Env = append(cmd.Env, fmt.Sprintf("SSL_CERT_FILE=%s", proxy_cert_file)) + } + + if len(proxy_configs) > 0 { + goproxy_val := "https://proxy.golang.org,direct" + + for _, cfg := range proxy_configs { + goproxy_val = cfg.URL + "," + goproxy_val + } + + cmd.Env = append(cmd.Env, fmt.Sprintf("GOPROXY=%s", goproxy_val)) + cmd.Env = append(cmd.Env, "GOPRIVATE=") + cmd.Env = append(cmd.Env, "GONOPROXY=") + } +} diff --git a/go/extractor/util/registryproxy_test.go b/go/extractor/util/registryproxy_test.go new file mode 100644 index 000000000000..b5fde50347f2 --- /dev/null +++ b/go/extractor/util/registryproxy_test.go @@ -0,0 +1,49 @@ +package util + +import ( + "testing" +) + +func parseRegistryConfigsFail(t *testing.T, str string) { + _, err := parseRegistryConfigs(str) + + if err == nil { + t.Fatal("Expected `parseRegistryConfigs` to fail, but it succeeded.") + } +} + +func parseRegistryConfigsSuccess(t *testing.T, str string) []RegistryConfig { + val, err := parseRegistryConfigs(str) + + if err != nil { + t.Fatalf("Expected `parseRegistryConfigs` to succeed, but it failed: %s", err.Error()) + } + + return val +} + +func TestParseRegistryConfigs(t *testing.T) { + // parseRegistryConfigsFail(t, "") + + empty := parseRegistryConfigsSuccess(t, "[]") + + if len(empty) != 0 { + t.Fatal("Expected `parseRegistryConfigs(\"[]\")` to return no configurations, but got some.") + } + + single := parseRegistryConfigsSuccess(t, "[{ \"type\": \"goproxy_server\", \"url\": \"https://proxy.example.com/mod\" }]") + + if len(single) != 1 { + t.Fatalf("Expected `parseRegistryConfigs` to return one configuration, but got %d.", len(single)) + } + + first := single[0] + + if first.Type != "goproxy_server" { + t.Fatalf("Expected `Type` to be `goproxy_server`, but got `%s`", first.Type) + } + + if first.URL != "https://proxy.example.com/mod" { + t.Fatalf("Expected `URL` to be `https://proxy.example.com/mod`, but got `%s`", first.URL) + } +} From e210be7bb29b79f1005821ce832dd789ac5fd458 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Tue, 8 Apr 2025 12:38:38 +0100 Subject: [PATCH 046/240] Go: Preserve environment variables in `ApplyProxyEnvVars` --- go/extractor/util/registryproxy.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/extractor/util/registryproxy.go b/go/extractor/util/registryproxy.go index 8f833c30d90b..71071e838146 100644 --- a/go/extractor/util/registryproxy.go +++ b/go/extractor/util/registryproxy.go @@ -91,6 +91,9 @@ func ApplyProxyEnvVars(cmd *exec.Cmd) { checkEnvVars() + // Preserve environment variables + cmd.Env = os.Environ() + if proxy_address != "" { cmd.Env = append(cmd.Env, fmt.Sprintf("HTTP_PROXY=%s", proxy_address)) cmd.Env = append(cmd.Env, fmt.Sprintf("HTTPS_PROXY=%s", proxy_address)) From a578f44af4a19f9eff6f1bdf28f66295867884ed Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Thu, 10 Apr 2025 14:40:59 +0200 Subject: [PATCH 047/240] QL4QL: Restrict `ql/qlref-inline-expectations` to `(path-)problem` queries --- ql/ql/src/codeql/files/FileSystem.qll | 2 + ql/ql/src/codeql_ql/ast/Yaml.qll | 71 +++++++++++++++++++ .../queries/style/QlRefInlineExpectations.ql | 6 +- .../ProblemQuery.expected | 0 .../QlRefInlineExpectations/ProblemQuery.ql | 13 ++++ .../QlRefInlineExpectations.expected | 3 +- .../style/QlRefInlineExpectations/Test1.qlref | 2 +- .../style/QlRefInlineExpectations/Test2.qlref | 2 +- .../style/QlRefInlineExpectations/Test3.qlref | 2 +- 9 files changed, 94 insertions(+), 7 deletions(-) create mode 100644 ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.expected create mode 100644 ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.ql diff --git a/ql/ql/src/codeql/files/FileSystem.qll b/ql/ql/src/codeql/files/FileSystem.qll index 738241a402f1..5a219f3b7f0c 100644 --- a/ql/ql/src/codeql/files/FileSystem.qll +++ b/ql/ql/src/codeql/files/FileSystem.qll @@ -30,6 +30,8 @@ class Container = Impl::Container; class Folder = Impl::Folder; +module Folder = Impl::Folder; + /** A file. */ class File extends Container, Impl::File { /** Gets a token in this file. */ diff --git a/ql/ql/src/codeql_ql/ast/Yaml.qll b/ql/ql/src/codeql_ql/ast/Yaml.qll index d5e80365ff4a..403640c1f841 100644 --- a/ql/ql/src/codeql_ql/ast/Yaml.qll +++ b/ql/ql/src/codeql_ql/ast/Yaml.qll @@ -6,6 +6,7 @@ */ private import codeql.yaml.Yaml as LibYaml +private import codeql.files.FileSystem private module YamlSig implements LibYaml::InputSig { import codeql.Locations @@ -49,6 +50,58 @@ private module YamlSig implements LibYaml::InputSig { import LibYaml::Make +/** A `qlpack.yml` document. */ +class QlPackDocument extends YamlDocument { + QlPackDocument() { this.getFile().getBaseName() = ["qlpack.yml", "qlpack.test.yml"] } + + /** Gets the name of this QL pack. */ + string getPackName() { + exists(YamlMapping n | + n.getDocument() = this and + result = n.lookup("name").(YamlScalar).getValue() + ) + } + + private string getADependencyName() { + exists(YamlMapping n, YamlScalar key | + n.getDocument() = this and + n.lookup("dependencies").(YamlMapping).maps(key, _) and + result = key.getValue() + ) + } + + /** Gets a dependency of this QL pack. */ + QlPackDocument getADependency() { result.getPackName() = this.getADependencyName() } + + private Folder getRootFolder() { result = this.getFile().getParentContainer() } + + /** Gets a folder inside this QL pack. */ + pragma[nomagic] + Folder getAFolder() { + result = this.getRootFolder() + or + exists(Folder mid | + mid = this.getAFolder() and + result.getParentContainer() = mid and + not result = any(QlPackDocument other).getRootFolder() + ) + } +} + +private predicate shouldAppend(QlRefDocument qlref, Folder f, string relativePath) { + relativePath = qlref.getRelativeQueryPath() and + ( + exists(QlPackDocument pack | + pack.getAFolder() = qlref.getFile().getParentContainer() and + f = [pack, pack.getADependency()].getFile().getParentContainer() + ) + or + f = qlref.getFile().getParentContainer() + ) +} + +private predicate shouldAppend(Folder f, string relativePath) { shouldAppend(_, f, relativePath) } + /** A `.qlref` YAML document. */ class QlRefDocument extends YamlDocument { QlRefDocument() { this.getFile().getExtension() = "qlref" } @@ -65,6 +118,24 @@ class QlRefDocument extends YamlDocument { ) } + /** Gets the relative path of the query in this `.qlref` file. */ + string getRelativeQueryPath() { + exists(YamlMapping n | n.getDocument() = this | + result = n.lookup("query").(YamlScalar).getValue() + ) + or + not exists(YamlMapping n | n.getDocument() = this) and + result = this.eval().(YamlScalar).getValue() + } + + /** Gets the query file referenced in this `.qlref` file. */ + File getQueryFile() { + exists(Folder f, string relativePath | + shouldAppend(this, f, relativePath) and + result = Folder::Append::append(f, relativePath) + ) + } + predicate isPrintAst() { this.getFile().getStem() = "PrintAst" or diff --git a/ql/ql/src/queries/style/QlRefInlineExpectations.ql b/ql/ql/src/queries/style/QlRefInlineExpectations.ql index 66c139f683f6..7f47f2d06c8d 100644 --- a/ql/ql/src/queries/style/QlRefInlineExpectations.ql +++ b/ql/ql/src/queries/style/QlRefInlineExpectations.ql @@ -10,8 +10,10 @@ import ql import codeql_ql.ast.Yaml -from QlRefDocument f +from QlRefDocument f, TopLevel t, QueryDoc doc where not f.usesInlineExpectations() and - not f.isPrintAst() + t.getFile() = f.getQueryFile() and + doc = t.getQLDoc() and + doc.getQueryKind() in ["problem", "path-problem"] select f, "Query test does not use inline test expectations." diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.expected b/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.expected new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.ql b/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.ql new file mode 100644 index 000000000000..fe4867113f37 --- /dev/null +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.ql @@ -0,0 +1,13 @@ +/** + * @name Problem query + * @description Description of the problem + * @kind problem + * @problem.severity warning + * @id ql/problem-query + */ + +import ql + +from VarDecl decl +where none() +select decl, "Problem" diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/QlRefInlineExpectations.expected b/ql/ql/test/queries/style/QlRefInlineExpectations/QlRefInlineExpectations.expected index 7dd57a3ef860..9605589e514e 100644 --- a/ql/ql/test/queries/style/QlRefInlineExpectations/QlRefInlineExpectations.expected +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/QlRefInlineExpectations.expected @@ -1,2 +1 @@ -| QlRefInlineExpectations.qlref:1:1:1:40 | queries ... ions.ql | Query test does not use inline test expectations. | -| Test3.qlref:1:1:1:39 | query: ... ists.ql | Query test does not use inline test expectations. | +| Test3.qlref:1:1:1:22 | query: ... uery.ql | Query test does not use inline test expectations. | diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/Test1.qlref b/ql/ql/test/queries/style/QlRefInlineExpectations/Test1.qlref index 03dd6f50713b..07255415589e 100644 --- a/ql/ql/test/queries/style/QlRefInlineExpectations/Test1.qlref +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/Test1.qlref @@ -1,2 +1,2 @@ -query: queries/style/OmittableExists.ql +query: ProblemQuery.ql postprocess: utils/test/InlineExpectationsTestQuery.ql \ No newline at end of file diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/Test2.qlref b/ql/ql/test/queries/style/QlRefInlineExpectations/Test2.qlref index 414c61f1e9cc..a0c03488dae0 100644 --- a/ql/ql/test/queries/style/QlRefInlineExpectations/Test2.qlref +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/Test2.qlref @@ -1,3 +1,3 @@ -query: queries/style/OmittableExists.ql +query: ProblemQuery.ql postprocess: - utils/test/InlineExpectationsTestQuery.ql \ No newline at end of file diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/Test3.qlref b/ql/ql/test/queries/style/QlRefInlineExpectations/Test3.qlref index 496512e7b452..5582a96837a3 100644 --- a/ql/ql/test/queries/style/QlRefInlineExpectations/Test3.qlref +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/Test3.qlref @@ -1 +1 @@ -query: queries/style/OmittableExists.ql \ No newline at end of file +query: ProblemQuery.ql \ No newline at end of file From 159d31d494c52b11425dba7184dfcd2537c37c04 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Tue, 8 Apr 2025 13:25:14 +0200 Subject: [PATCH 048/240] Reenable problematic test --- .../all-platforms/diag_missing_project_files/test.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py b/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py index fa941f346df1..a2676d16d9c0 100644 --- a/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py +++ b/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py @@ -1,8 +1,2 @@ -import pytest -import runs_on - - -# Skipping the test on macos-15, as we're running into trouble. -@pytest.mark.only_if(not runs_on.macos_15) def test(codeql, csharp): codeql.database.create(_assert_failure=True) From 547833afb5a4106a255e6cb8107c23a2e8d567b6 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 08:32:33 +0200 Subject: [PATCH 049/240] Rust: add to `CODEOWNERS` --- CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index 90c3cb9af601..318d9f2c6de7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -8,6 +8,7 @@ /javascript/ @github/codeql-javascript /python/ @github/codeql-python /ruby/ @github/codeql-ruby +/rust/ @github/codeql-rust /swift/ @github/codeql-swift /misc/codegen/ @github/codeql-swift /java/kotlin-extractor/ @github/codeql-kotlin @@ -41,6 +42,7 @@ MODULE.bazel @github/codeql-ci-reviewers /.github/workflows/go-* @github/codeql-go /.github/workflows/ql-for-ql-* @github/codeql-ql-for-ql-reviewers /.github/workflows/ruby-* @github/codeql-ruby +/.github/workflows/rust.yml @github/codeql-rust /.github/workflows/swift.yml @github/codeql-swift # Misc From 7703b1fab5211538d70ae2e4c994cab3c00a49a0 Mon Sep 17 00:00:00 2001 From: Asger F Date: Fri, 11 Apr 2025 08:26:04 +0200 Subject: [PATCH 050/240] JS: Add test for missing getALocalSource flow for rest pattern --- .../GetALocalSource/rest-pattern.js | 15 ++++++++++ .../GetALocalSource/test.expected | 1 + .../library-tests/GetALocalSource/test.ql | 30 +++++++++++++++++++ .../library-tests/GetALocalSource/test.qlref | 2 ++ 4 files changed, 48 insertions(+) create mode 100644 javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js create mode 100644 javascript/ql/test/library-tests/GetALocalSource/test.expected create mode 100644 javascript/ql/test/library-tests/GetALocalSource/test.ql create mode 100644 javascript/ql/test/library-tests/GetALocalSource/test.qlref diff --git a/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js b/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js new file mode 100644 index 000000000000..8eb0c808853c --- /dev/null +++ b/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js @@ -0,0 +1,15 @@ +function t1() { + const { ...rest } = source('t1.1'); + rest; // $ MISSING: getALocalSource=rest +} + +function t2() { + const [ ...rest ] = source('t2.1'); + rest; // $ MISSING: getALocalSource=rest +} + +function t3() { + const { p1, ...rest } = source('t3.1'); + p1; // $ getALocalSource=p1 + rest; // $ MISSING: getALocalSource=rest +} diff --git a/javascript/ql/test/library-tests/GetALocalSource/test.expected b/javascript/ql/test/library-tests/GetALocalSource/test.expected new file mode 100644 index 000000000000..6efee9a8f1e2 --- /dev/null +++ b/javascript/ql/test/library-tests/GetALocalSource/test.expected @@ -0,0 +1 @@ +| rest-pattern.js:13:5:13:6 | p1 | p1 | diff --git a/javascript/ql/test/library-tests/GetALocalSource/test.ql b/javascript/ql/test/library-tests/GetALocalSource/test.ql new file mode 100644 index 000000000000..7803f6fd4959 --- /dev/null +++ b/javascript/ql/test/library-tests/GetALocalSource/test.ql @@ -0,0 +1,30 @@ +import javascript + +string nodeName(DataFlow::SourceNode node) { + result = node.getAstNode().(VarRef).getName() + or + result = node.getAstNode().(PropertyPattern).getName() + or + result = node.getAstNode().(PropAccess).getPropertyName() + or + exists(DataFlow::InvokeNode invoke | + node = invoke and + invoke.getCalleeName() = "source" and + result = invoke.getArgument(0).getStringValue() + ) +} + +bindingset[node1, node2] +pragma[inline_late] +predicate sameLine(DataFlow::Node node1, DataFlow::Node node2) { + node1.getLocation().getFile() = node2.getLocation().getFile() and + node1.getLocation().getStartLine() = node2.getLocation().getStartLine() +} + +query predicate getALocalSource(DataFlow::Node node, string name) { + exists(DataFlow::SourceNode sn | + sn = node.getALocalSource() and + name = nodeName(sn) and + not sameLine(node, sn) + ) +} diff --git a/javascript/ql/test/library-tests/GetALocalSource/test.qlref b/javascript/ql/test/library-tests/GetALocalSource/test.qlref new file mode 100644 index 000000000000..ab6773f15f90 --- /dev/null +++ b/javascript/ql/test/library-tests/GetALocalSource/test.qlref @@ -0,0 +1,2 @@ +query: test.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql From 719456e27d7d3f8efcd442848c5fef1df2f21a24 Mon Sep 17 00:00:00 2001 From: Asger F Date: Fri, 11 Apr 2025 08:33:29 +0200 Subject: [PATCH 051/240] JS: Fix missing flow into rest pattern lvalue --- javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll | 5 +++++ .../ql/test/library-tests/GetALocalSource/rest-pattern.js | 6 +++--- .../ql/test/library-tests/GetALocalSource/test.expected | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll b/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll index f86d8806304d..46801bd1ad7e 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll @@ -1610,6 +1610,11 @@ module DataFlow { pred = TElementPatternNode(_, element) and succ = lvalueNodeInternal(element) ) + or + exists(Expr rest | + pred = TRestPatternNode(_, rest) and + succ = lvalueNodeInternal(rest) + ) } /** diff --git a/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js b/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js index 8eb0c808853c..3e0a62755f04 100644 --- a/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js +++ b/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js @@ -1,15 +1,15 @@ function t1() { const { ...rest } = source('t1.1'); - rest; // $ MISSING: getALocalSource=rest + rest; // $ getALocalSource=rest } function t2() { const [ ...rest ] = source('t2.1'); - rest; // $ MISSING: getALocalSource=rest + rest; // $ getALocalSource=rest } function t3() { const { p1, ...rest } = source('t3.1'); p1; // $ getALocalSource=p1 - rest; // $ MISSING: getALocalSource=rest + rest; // $ getALocalSource=rest } diff --git a/javascript/ql/test/library-tests/GetALocalSource/test.expected b/javascript/ql/test/library-tests/GetALocalSource/test.expected index 6efee9a8f1e2..5770e50b8a62 100644 --- a/javascript/ql/test/library-tests/GetALocalSource/test.expected +++ b/javascript/ql/test/library-tests/GetALocalSource/test.expected @@ -1 +1,4 @@ +| rest-pattern.js:3:5:3:8 | rest | rest | +| rest-pattern.js:8:5:8:8 | rest | rest | | rest-pattern.js:13:5:13:6 | p1 | p1 | +| rest-pattern.js:14:5:14:8 | rest | rest | From cc85a09b398c6b58e4f9fb5028a10db8174c2378 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 9 Apr 2025 10:11:06 +0200 Subject: [PATCH 052/240] Rust: Add AI-generated test for path resolution of where clauses --- .../PathResolutionInlineExpectationsTest.qll | 2 +- .../library-tests/path-resolution/main.rs | 71 +++++++++ .../path-resolution/path-resolution.expected | 148 ++++++++++-------- .../test/library-tests/variables/variables.ql | 2 +- 4 files changed, 160 insertions(+), 63 deletions(-) diff --git a/rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll b/rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll index 54d6023b2642..cd82003feac1 100644 --- a/rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll +++ b/rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll @@ -18,7 +18,7 @@ private module ResolveTest implements TestSig { private predicate commmentAt(string text, string filepath, int line) { exists(Comment c | c.getLocation().hasLocationInfo(filepath, line, _, _, _) and - c.getCommentText() = text + c.getCommentText().trim() = text ) } diff --git a/rust/ql/test/library-tests/path-resolution/main.rs b/rust/ql/test/library-tests/path-resolution/main.rs index 467248219a4c..d1bf53cc5c2b 100644 --- a/rust/ql/test/library-tests/path-resolution/main.rs +++ b/rust/ql/test/library-tests/path-resolution/main.rs @@ -547,6 +547,76 @@ mod m23 { } // I108 } +mod m24 { + trait TraitA { + fn trait_a_method(&self); // I110 + } // I111 + + trait TraitB { + fn trait_b_method(&self); // I112 + } // I113 + + #[rustfmt::skip] + struct GenericStruct { // I114 + data: T, // $ item=I114 + } // I115 + + #[rustfmt::skip] + impl // I1151 + GenericStruct // $ item=I115 item=I1151 + where + T: TraitA // $ item=I111 item=I1151 + { + fn call_trait_a(&self) { + self.data.trait_a_method(); // $ MISSING: item=I110 + } // I116 + } + + #[rustfmt::skip] + impl // I1161 + GenericStruct // $ item=I115 item=I1161 + where + T: TraitB, // $ item=I113 item=I1161 + T: TraitA, // $ item=I111 item=I1161 + { + fn call_both(&self) { + self.data.trait_a_method(); // $ MISSING: item=I110 + self.data.trait_b_method(); // $ MISSING: item=I112 + } // I117 + } + + struct Implementor; // I118 + + #[rustfmt::skip] + impl TraitA for Implementor { // $ item=I111 item=I118 + fn trait_a_method(&self) { + println!("TraitA method called"); + } // I119 + } + + #[rustfmt::skip] + impl TraitB for Implementor { // $ item=I113 item=I118 + fn trait_b_method(&self) { + println!("TraitB method called"); + } // I120 + } + + #[rustfmt::skip] + pub fn f() { + let impl_obj = Implementor; // $ item=I118 + let generic = GenericStruct { data: impl_obj }; // $ item=I115 + + generic.call_trait_a(); // $ MISSING: item=I116 + generic.call_both(); // $ MISSING: item=I117 + + // Access through where clause type parameter constraint + GenericStruct::::call_trait_a(&generic); // $ item=I116 item=I118 + + // Type that satisfies multiple trait bounds in where clause + GenericStruct::::call_both(&generic); // $ item=I117 item=I118 + } // I121 +} + fn main() { my::nested::nested1::nested2::f(); // $ item=I4 my::f(); // $ item=I38 @@ -575,4 +645,5 @@ fn main() { nested_f(); // $ item=I201 m18::m19::m20::g(); // $ item=I103 m23::f(); // $ item=I108 + m24::f(); // $ item=I121 } diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index 7fbbca66c39c..0cc184be2394 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -28,6 +28,7 @@ mod | main.rs:497:5:503:5 | mod m22 | | main.rs:505:5:520:5 | mod m33 | | main.rs:523:1:548:1 | mod m23 | +| main.rs:550:1:618:1 | mod m24 | | my2/mod.rs:1:1:1:16 | mod nested2 | | my2/mod.rs:12:1:12:12 | mod my3 | | my2/mod.rs:14:1:15:10 | mod mymod | @@ -61,7 +62,7 @@ resolvePath | main.rs:30:17:30:21 | super | main.rs:18:5:36:5 | mod m2 | | main.rs:30:17:30:24 | ...::f | main.rs:19:9:21:9 | fn f | | main.rs:33:17:33:17 | f | main.rs:19:9:21:9 | fn f | -| main.rs:40:9:40:13 | super | main.rs:1:1:578:2 | SourceFile | +| main.rs:40:9:40:13 | super | main.rs:1:1:649:2 | SourceFile | | main.rs:40:9:40:17 | ...::m1 | main.rs:13:1:37:1 | mod m1 | | main.rs:40:9:40:21 | ...::m2 | main.rs:18:5:36:5 | mod m2 | | main.rs:40:9:40:24 | ...::g | main.rs:23:9:27:9 | fn g | @@ -73,7 +74,7 @@ resolvePath | main.rs:61:17:61:19 | Foo | main.rs:59:9:59:21 | struct Foo | | main.rs:64:13:64:15 | Foo | main.rs:53:5:53:17 | struct Foo | | main.rs:66:5:66:5 | f | main.rs:55:5:62:5 | fn f | -| main.rs:68:5:68:8 | self | main.rs:1:1:578:2 | SourceFile | +| main.rs:68:5:68:8 | self | main.rs:1:1:649:2 | SourceFile | | main.rs:68:5:68:11 | ...::i | main.rs:71:1:83:1 | fn i | | main.rs:74:13:74:15 | Foo | main.rs:48:1:48:13 | struct Foo | | main.rs:81:17:81:19 | Foo | main.rs:77:9:79:9 | struct Foo | @@ -87,7 +88,7 @@ resolvePath | main.rs:87:57:87:66 | ...::g | my2/nested2.rs:7:9:9:9 | fn g | | main.rs:87:80:87:86 | nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | | main.rs:100:5:100:22 | f_defined_in_macro | main.rs:99:18:99:42 | fn f_defined_in_macro | -| main.rs:117:13:117:17 | super | main.rs:1:1:578:2 | SourceFile | +| main.rs:117:13:117:17 | super | main.rs:1:1:649:2 | SourceFile | | main.rs:117:13:117:21 | ...::m5 | main.rs:103:1:107:1 | mod m5 | | main.rs:118:9:118:9 | f | main.rs:104:5:106:5 | fn f | | main.rs:118:9:118:9 | f | main.rs:110:5:112:5 | fn f | @@ -240,63 +241,88 @@ resolvePath | main.rs:535:7:535:10 | Self | main.rs:531:5:531:13 | struct S | | main.rs:537:11:537:11 | S | main.rs:531:5:531:13 | struct S | | main.rs:545:17:545:17 | S | main.rs:531:5:531:13 | struct S | -| main.rs:551:5:551:6 | my | main.rs:1:1:1:7 | mod my | -| main.rs:551:5:551:14 | ...::nested | my.rs:1:1:1:15 | mod nested | -| main.rs:551:5:551:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 | -| main.rs:551:5:551:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 | -| main.rs:551:5:551:35 | ...::f | my/nested.rs:3:9:5:9 | fn f | -| main.rs:552:5:552:6 | my | main.rs:1:1:1:7 | mod my | -| main.rs:552:5:552:9 | ...::f | my.rs:5:1:7:1 | fn f | -| main.rs:553:5:553:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | -| main.rs:553:5:553:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | -| main.rs:553:5:553:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | -| main.rs:553:5:553:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:554:5:554:5 | f | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:555:5:555:5 | g | my2/nested2.rs:7:9:9:9 | fn g | -| main.rs:556:5:556:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) | -| main.rs:556:5:556:12 | ...::h | main.rs:50:1:69:1 | fn h | -| main.rs:557:5:557:6 | m1 | main.rs:13:1:37:1 | mod m1 | -| main.rs:557:5:557:10 | ...::m2 | main.rs:18:5:36:5 | mod m2 | -| main.rs:557:5:557:13 | ...::g | main.rs:23:9:27:9 | fn g | -| main.rs:558:5:558:6 | m1 | main.rs:13:1:37:1 | mod m1 | -| main.rs:558:5:558:10 | ...::m2 | main.rs:18:5:36:5 | mod m2 | -| main.rs:558:5:558:14 | ...::m3 | main.rs:29:9:35:9 | mod m3 | -| main.rs:558:5:558:17 | ...::h | main.rs:30:27:34:13 | fn h | -| main.rs:559:5:559:6 | m4 | main.rs:39:1:46:1 | mod m4 | -| main.rs:559:5:559:9 | ...::i | main.rs:42:5:45:5 | fn i | -| main.rs:560:5:560:5 | h | main.rs:50:1:69:1 | fn h | -| main.rs:561:5:561:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:562:5:562:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g | -| main.rs:563:5:563:5 | j | main.rs:97:1:101:1 | fn j | -| main.rs:564:5:564:6 | m6 | main.rs:109:1:120:1 | mod m6 | -| main.rs:564:5:564:9 | ...::g | main.rs:114:5:119:5 | fn g | -| main.rs:565:5:565:6 | m7 | main.rs:122:1:137:1 | mod m7 | -| main.rs:565:5:565:9 | ...::f | main.rs:129:5:136:5 | fn f | -| main.rs:566:5:566:6 | m8 | main.rs:139:1:193:1 | mod m8 | -| main.rs:566:5:566:9 | ...::g | main.rs:177:5:192:5 | fn g | -| main.rs:567:5:567:6 | m9 | main.rs:195:1:203:1 | mod m9 | -| main.rs:567:5:567:9 | ...::f | main.rs:198:5:202:5 | fn f | -| main.rs:568:5:568:7 | m11 | main.rs:226:1:263:1 | mod m11 | -| main.rs:568:5:568:10 | ...::f | main.rs:231:5:234:5 | fn f | -| main.rs:569:5:569:7 | m15 | main.rs:294:1:348:1 | mod m15 | -| main.rs:569:5:569:10 | ...::f | main.rs:335:5:347:5 | fn f | -| main.rs:570:5:570:7 | m16 | main.rs:350:1:442:1 | mod m16 | -| main.rs:570:5:570:10 | ...::f | main.rs:417:5:441:5 | fn f | -| main.rs:571:5:571:7 | m17 | main.rs:444:1:474:1 | mod m17 | -| main.rs:571:5:571:10 | ...::f | main.rs:468:5:473:5 | fn f | -| main.rs:572:5:572:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 | -| main.rs:572:5:572:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f | -| main.rs:573:5:573:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | -| main.rs:573:5:573:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f | -| main.rs:574:5:574:7 | my3 | my2/mod.rs:12:1:12:12 | mod my3 | -| main.rs:574:5:574:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f | -| main.rs:575:5:575:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | -| main.rs:576:5:576:7 | m18 | main.rs:476:1:494:1 | mod m18 | -| main.rs:576:5:576:12 | ...::m19 | main.rs:481:5:493:5 | mod m19 | -| main.rs:576:5:576:17 | ...::m20 | main.rs:486:9:492:9 | mod m20 | -| main.rs:576:5:576:20 | ...::g | main.rs:487:13:491:13 | fn g | -| main.rs:577:5:577:7 | m23 | main.rs:523:1:548:1 | mod m23 | -| main.rs:577:5:577:10 | ...::f | main.rs:543:5:547:5 | fn f | +| main.rs:561:15:561:15 | T | main.rs:560:26:560:26 | T | +| main.rs:566:9:566:24 | GenericStruct::<...> | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:566:23:566:23 | T | main.rs:565:10:565:10 | T | +| main.rs:568:9:568:9 | T | main.rs:565:10:565:10 | T | +| main.rs:568:12:568:17 | TraitA | main.rs:551:5:553:5 | trait TraitA | +| main.rs:577:9:577:24 | GenericStruct::<...> | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:577:23:577:23 | T | main.rs:576:10:576:10 | T | +| main.rs:579:9:579:9 | T | main.rs:576:10:576:10 | T | +| main.rs:579:12:579:17 | TraitB | main.rs:555:5:557:5 | trait TraitB | +| main.rs:580:9:580:9 | T | main.rs:576:10:576:10 | T | +| main.rs:580:12:580:17 | TraitA | main.rs:551:5:553:5 | trait TraitA | +| main.rs:591:10:591:15 | TraitA | main.rs:551:5:553:5 | trait TraitA | +| main.rs:591:21:591:31 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:598:10:598:15 | TraitB | main.rs:555:5:557:5 | trait TraitB | +| main.rs:598:21:598:31 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:606:24:606:34 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:607:23:607:35 | GenericStruct | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:613:9:613:36 | GenericStruct::<...> | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:613:9:613:50 | ...::call_trait_a | main.rs:570:9:572:9 | fn call_trait_a | +| main.rs:613:25:613:35 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:616:9:616:36 | GenericStruct::<...> | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:616:9:616:47 | ...::call_both | main.rs:582:9:585:9 | fn call_both | +| main.rs:616:25:616:35 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:621:5:621:6 | my | main.rs:1:1:1:7 | mod my | +| main.rs:621:5:621:14 | ...::nested | my.rs:1:1:1:15 | mod nested | +| main.rs:621:5:621:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 | +| main.rs:621:5:621:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 | +| main.rs:621:5:621:35 | ...::f | my/nested.rs:3:9:5:9 | fn f | +| main.rs:622:5:622:6 | my | main.rs:1:1:1:7 | mod my | +| main.rs:622:5:622:9 | ...::f | my.rs:5:1:7:1 | fn f | +| main.rs:623:5:623:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | +| main.rs:623:5:623:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | +| main.rs:623:5:623:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | +| main.rs:623:5:623:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:624:5:624:5 | f | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:625:5:625:5 | g | my2/nested2.rs:7:9:9:9 | fn g | +| main.rs:626:5:626:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) | +| main.rs:626:5:626:12 | ...::h | main.rs:50:1:69:1 | fn h | +| main.rs:627:5:627:6 | m1 | main.rs:13:1:37:1 | mod m1 | +| main.rs:627:5:627:10 | ...::m2 | main.rs:18:5:36:5 | mod m2 | +| main.rs:627:5:627:13 | ...::g | main.rs:23:9:27:9 | fn g | +| main.rs:628:5:628:6 | m1 | main.rs:13:1:37:1 | mod m1 | +| main.rs:628:5:628:10 | ...::m2 | main.rs:18:5:36:5 | mod m2 | +| main.rs:628:5:628:14 | ...::m3 | main.rs:29:9:35:9 | mod m3 | +| main.rs:628:5:628:17 | ...::h | main.rs:30:27:34:13 | fn h | +| main.rs:629:5:629:6 | m4 | main.rs:39:1:46:1 | mod m4 | +| main.rs:629:5:629:9 | ...::i | main.rs:42:5:45:5 | fn i | +| main.rs:630:5:630:5 | h | main.rs:50:1:69:1 | fn h | +| main.rs:631:5:631:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:632:5:632:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g | +| main.rs:633:5:633:5 | j | main.rs:97:1:101:1 | fn j | +| main.rs:634:5:634:6 | m6 | main.rs:109:1:120:1 | mod m6 | +| main.rs:634:5:634:9 | ...::g | main.rs:114:5:119:5 | fn g | +| main.rs:635:5:635:6 | m7 | main.rs:122:1:137:1 | mod m7 | +| main.rs:635:5:635:9 | ...::f | main.rs:129:5:136:5 | fn f | +| main.rs:636:5:636:6 | m8 | main.rs:139:1:193:1 | mod m8 | +| main.rs:636:5:636:9 | ...::g | main.rs:177:5:192:5 | fn g | +| main.rs:637:5:637:6 | m9 | main.rs:195:1:203:1 | mod m9 | +| main.rs:637:5:637:9 | ...::f | main.rs:198:5:202:5 | fn f | +| main.rs:638:5:638:7 | m11 | main.rs:226:1:263:1 | mod m11 | +| main.rs:638:5:638:10 | ...::f | main.rs:231:5:234:5 | fn f | +| main.rs:639:5:639:7 | m15 | main.rs:294:1:348:1 | mod m15 | +| main.rs:639:5:639:10 | ...::f | main.rs:335:5:347:5 | fn f | +| main.rs:640:5:640:7 | m16 | main.rs:350:1:442:1 | mod m16 | +| main.rs:640:5:640:10 | ...::f | main.rs:417:5:441:5 | fn f | +| main.rs:641:5:641:7 | m17 | main.rs:444:1:474:1 | mod m17 | +| main.rs:641:5:641:10 | ...::f | main.rs:468:5:473:5 | fn f | +| main.rs:642:5:642:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 | +| main.rs:642:5:642:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f | +| main.rs:643:5:643:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | +| main.rs:643:5:643:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f | +| main.rs:644:5:644:7 | my3 | my2/mod.rs:12:1:12:12 | mod my3 | +| main.rs:644:5:644:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f | +| main.rs:645:5:645:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | +| main.rs:646:5:646:7 | m18 | main.rs:476:1:494:1 | mod m18 | +| main.rs:646:5:646:12 | ...::m19 | main.rs:481:5:493:5 | mod m19 | +| main.rs:646:5:646:17 | ...::m20 | main.rs:486:9:492:9 | mod m20 | +| main.rs:646:5:646:20 | ...::g | main.rs:487:13:491:13 | fn g | +| main.rs:647:5:647:7 | m23 | main.rs:523:1:548:1 | mod m23 | +| main.rs:647:5:647:10 | ...::f | main.rs:543:5:547:5 | fn f | +| main.rs:648:5:648:7 | m24 | main.rs:550:1:618:1 | mod m24 | +| main.rs:648:5:648:10 | ...::f | main.rs:604:5:617:5 | fn f | | my2/mod.rs:5:5:5:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | | my2/mod.rs:5:5:5:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | | my2/mod.rs:5:5:5:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | @@ -312,7 +338,7 @@ resolvePath | my2/my3/mod.rs:3:5:3:5 | g | my2/mod.rs:3:1:6:1 | fn g | | my2/my3/mod.rs:4:5:4:5 | h | main.rs:50:1:69:1 | fn h | | my2/my3/mod.rs:7:5:7:9 | super | my2/mod.rs:1:1:17:30 | SourceFile | -| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:578:2 | SourceFile | +| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:649:2 | SourceFile | | my2/my3/mod.rs:7:5:7:19 | ...::h | main.rs:50:1:69:1 | fn h | | my2/my3/mod.rs:8:5:8:9 | super | my2/mod.rs:1:1:17:30 | SourceFile | | my2/my3/mod.rs:8:5:8:12 | ...::g | my2/mod.rs:3:1:6:1 | fn g | diff --git a/rust/ql/test/library-tests/variables/variables.ql b/rust/ql/test/library-tests/variables/variables.ql index f7793911dae0..121975c0c820 100644 --- a/rust/ql/test/library-tests/variables/variables.ql +++ b/rust/ql/test/library-tests/variables/variables.ql @@ -31,7 +31,7 @@ module VariableAccessTest implements TestSig { private predicate commmentAt(string text, string filepath, int line) { exists(Comment c | c.getLocation().hasLocationInfo(filepath, line, _, _, _) and - c.getCommentText() = text + c.getCommentText().trim() = text ) } From e26695fc511d426c5f84b7c3f7f3606881d62fa4 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Apr 2025 10:45:18 +0200 Subject: [PATCH 053/240] Rust: Take `where` clauses into account in path resolution --- .../codeql/rust/internal/PathResolution.qll | 20 +++++++++++++------ .../library-tests/path-resolution/main.rs | 6 +++--- .../test/library-tests/type-inference/main.rs | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 31fbf7fe4cff..20d68b765917 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -581,9 +581,21 @@ private class BlockExprItemNode extends ItemNode instanceof BlockExpr { } class TypeParamItemNode extends ItemNode instanceof TypeParam { + private WherePred getAWherePred() { + exists(ItemNode declaringItem | + this = resolveTypeParamPathTypeRepr(result.getTypeRepr()) and + result = declaringItem.getADescendant() and + this = declaringItem.getADescendant() + ) + } + pragma[nomagic] Path getABoundPath() { - result = super.getTypeBoundList().getABound().getTypeRepr().(PathTypeRepr).getPath() + exists(TypeBoundList tbl | result = tbl.getABound().getTypeRepr().(PathTypeRepr).getPath() | + tbl = super.getTypeBoundList() + or + tbl = this.getAWherePred().getTypeBoundList() + ) } pragma[nomagic] @@ -605,11 +617,7 @@ class TypeParamItemNode extends ItemNode instanceof TypeParam { Stages::PathResolutionStage::ref() and exists(this.getABoundPath()) or - exists(ItemNode declaringItem, WherePred wp | - this = resolveTypeParamPathTypeRepr(wp.getTypeRepr()) and - wp = declaringItem.getADescendant() and - this = declaringItem.getADescendant() - ) + exists(this.getAWherePred()) } /** diff --git a/rust/ql/test/library-tests/path-resolution/main.rs b/rust/ql/test/library-tests/path-resolution/main.rs index d1bf53cc5c2b..1179f2f7b589 100644 --- a/rust/ql/test/library-tests/path-resolution/main.rs +++ b/rust/ql/test/library-tests/path-resolution/main.rs @@ -568,7 +568,7 @@ mod m24 { T: TraitA // $ item=I111 item=I1151 { fn call_trait_a(&self) { - self.data.trait_a_method(); // $ MISSING: item=I110 + self.data.trait_a_method(); // $ item=I110 } // I116 } @@ -580,8 +580,8 @@ mod m24 { T: TraitA, // $ item=I111 item=I1161 { fn call_both(&self) { - self.data.trait_a_method(); // $ MISSING: item=I110 - self.data.trait_b_method(); // $ MISSING: item=I112 + self.data.trait_a_method(); // $ item=I110 + self.data.trait_b_method(); // $ item=I112 } // I117 } diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index f9c03c94710e..1972b181c83c 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -623,7 +623,7 @@ mod function_trait_bounds_2 { where T1: Into, { - x.into() + x.into() // $ method=into } pub fn f() { From a5aef8c6f92fe230cdd44cc7515ff8eac07f181c Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 11 Apr 2025 12:03:06 +0200 Subject: [PATCH 054/240] C#: Add some more DotNet autobuilder unit tests. --- .../BuildScripts.cs | 77 ++++++++++++++++--- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs index d277331b12e9..6bbe706d9544 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs @@ -424,8 +424,7 @@ private CSharpAutobuilder CreateAutoBuilder(bool isWindows, return new CSharpAutobuilder(actions, options); } - [Fact] - public void TestDefaultCSharpAutoBuilder() + private void SetupActionForDotnet() { actions.RunProcess["cmd.exe /C dotnet --info"] = 0; actions.RunProcess[@"cmd.exe /C dotnet clean C:\Project\test.csproj"] = 0; @@ -438,20 +437,80 @@ public void TestDefaultCSharpAutoBuilder() actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SCRATCH_DIR"] = "scratch"; actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbar.cs\ntest.csproj"; actions.EnumerateDirectories[@"C:\Project"] = ""; - var xml = new XmlDocument(); - xml.LoadXml(@" - - Exe - netcoreapp2.1 - + } -"); + private void CreateAndVerifyDotnetScript(XmlDocument xml) + { actions.LoadXml[@"C:\Project\test.csproj"] = xml; var autobuilder = CreateAutoBuilder(true); TestAutobuilderScript(autobuilder, 0, 4); } + [Fact] + public void TestDefaultCSharpAutoBuilder1() + { + SetupActionForDotnet(); + var xml = new XmlDocument(); + xml.LoadXml( + """ + + + Exe + netcoreapp2.1 + + + """); + CreateAndVerifyDotnetScript(xml); + } + + [Fact] + public void TestDefaultCSharpAutoBuilder2() + { + SetupActionForDotnet(); + var xml = new XmlDocument(); + + xml.LoadXml( + """ + + + + + Exe + net9.0 + enable + enable + + + """ + ); + CreateAndVerifyDotnetScript(xml); + } + + [Fact] + public void TestDefaultCSharpAutoBuilder3() + { + SetupActionForDotnet(); + var xml = new XmlDocument(); + + xml.LoadXml( + """ + + + + + Exe + net9.0 + enable + enable + + + + """ + ); + CreateAndVerifyDotnetScript(xml); + } + [Fact] public void TestLinuxCSharpAutoBuilder() { From 31143b405ebb4cf7c3f55d4db84ac372391c2545 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 11 Apr 2025 13:11:04 +0200 Subject: [PATCH 055/240] C#: Improve auto builder logic to detect Sdk reference. --- .../Semmle.Autobuild.Shared/Project.cs | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs index c318ef09805d..37a8feee186c 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs @@ -3,7 +3,6 @@ using System.IO; using System.Linq; using System.Xml; -using Semmle.Util.Logging; namespace Semmle.Autobuild.Shared { @@ -26,6 +25,26 @@ public class Project : ProjectOrSolution w private readonly Lazy>> includedProjectsLazy; public override IEnumerable IncludedProjects => includedProjectsLazy.Value; + private static bool HasSdkAttribute(XmlElement xml) => + xml.HasAttribute("Sdk"); + + private static bool AnyElement(XmlNodeList l, Func f) => + l.OfType().Any(f); + + /// + /// According to https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2022#reference-a-project-sdk + /// there are three ways to reference a project SDK: + /// 1. As an attribute on the . + /// 2. As a top level element of . + /// 3. As an attribute on an element. + /// + /// Returns true, if the Sdk attribute is used, otherwise false. + /// + private static bool ReferencesSdk(XmlElement xml) => + HasSdkAttribute(xml) || // Case 1 + AnyElement(xml.ChildNodes, e => e.Name == "Sdk") || // Case 2 + AnyElement(xml.GetElementsByTagName("Import"), HasSdkAttribute); // Case 3 + public Project(Autobuilder builder, string path) : base(builder, path) { ToolsVersion = new Version(); @@ -49,7 +68,7 @@ public Project(Autobuilder builder, string path) : base(build if (root?.Name == "Project") { - if (root.HasAttribute("Sdk")) + if (ReferencesSdk(root)) { DotNetProject = true; return; From f349048e42502ac12ea6de07be7d93814297a6ae Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 11 Apr 2025 13:17:41 +0200 Subject: [PATCH 056/240] C#: Add change note. --- csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md diff --git a/csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md b/csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md new file mode 100644 index 000000000000..1ab0153786fd --- /dev/null +++ b/csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Improved autobuilder logic for detecting whether a project references a SDK (and should be built using `dotnet`). From 51388f24012fbf33d4321e74d2ed2a3c6806e9c1 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Fri, 11 Apr 2025 12:42:12 +0200 Subject: [PATCH 057/240] Do not try running mono when it's not available on the runner --- .../BuildScripts.cs | 35 ++++++++++++++++--- .../Semmle.Autobuild.Shared/MsBuildRule.cs | 20 +++++++---- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs index d277331b12e9..db445c591a52 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs @@ -46,6 +46,11 @@ bool IBuildActions.FileExists(string file) public IList RunProcessIn { get; } = new List(); public IDictionary RunProcess { get; } = new Dictionary(); + + /// + /// (process-exit code) pairs for commands that are executed during the assembly of the autobuild script. + /// + public IDictionary RunProcessExecuteDuring { get; } = new Dictionary(); public IDictionary RunProcessOut { get; } = new Dictionary(); public IDictionary RunProcessWorkingDirectory { get; } = new Dictionary(); public HashSet CreateDirectories { get; } = new HashSet(); @@ -66,7 +71,7 @@ int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory, if (wd != workingDirectory) throw new ArgumentException($"Unexpected RunProcessWorkingDirectory, got {wd ?? "null"} expected {workingDirectory ?? "null"} in {pattern}"); - if (!RunProcess.TryGetValue(pattern, out var ret)) + if (!RunProcess.TryGetValue(pattern, out var ret) && !RunProcessExecuteDuring.TryGetValue(pattern, out ret)) throw new ArgumentException("Missing RunProcess " + pattern); return ret; @@ -81,7 +86,7 @@ int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory, if (wd != workingDirectory) throw new ArgumentException($"Unexpected RunProcessWorkingDirectory, got {wd ?? "null"} expected {workingDirectory ?? "null"} in {pattern}"); - if (!RunProcess.TryGetValue(pattern, out var ret)) + if (!RunProcess.TryGetValue(pattern, out var ret) && !RunProcessExecuteDuring.TryGetValue(pattern, out ret)) throw new ArgumentException("Missing RunProcess " + pattern); return ret; @@ -797,11 +802,32 @@ public void TestDirsProjWindows() } [Fact] - public void TestDirsProjLinux() + public void TestDirsProjLinux_WithMono() { + actions.RunProcessExecuteDuring[@"mono --version"] = 0; + actions.RunProcess[@"nuget restore C:\Project/dirs.proj -DisableParallelProcessing"] = 1; actions.RunProcess[@"mono scratch/.nuget/nuget.exe restore C:\Project/dirs.proj -DisableParallelProcessing"] = 0; actions.RunProcess[@"msbuild C:\Project/dirs.proj /t:rebuild"] = 0; + + var autobuilder = TestDirsProjLinux(); + TestAutobuilderScript(autobuilder, 0, 3); + } + + [Fact] + public void TestDirsProjLinux_WithoutMono() + { + actions.RunProcessExecuteDuring[@"mono --version"] = 1; + + actions.RunProcess[@"dotnet msbuild /t:restore C:\Project/dirs.proj"] = 0; + actions.RunProcess[@"dotnet msbuild C:\Project/dirs.proj /t:rebuild"] = 0; + + var autobuilder = TestDirsProjLinux(); + TestAutobuilderScript(autobuilder, 0, 2); + } + + private CSharpAutobuilder TestDirsProjLinux() + { actions.FileExists["csharp.log"] = true; actions.FileExists[@"C:\Project/a/test.csproj"] = true; actions.FileExists[@"C:\Project/dirs.proj"] = true; @@ -830,8 +856,7 @@ public void TestDirsProjLinux() "); actions.LoadXml[@"C:\Project/dirs.proj"] = dirsproj; - var autobuilder = CreateAutoBuilder(false); - TestAutobuilderScript(autobuilder, 0, 3); + return CreateAutoBuilder(false); } [Fact] diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs index 953f0884a44f..72ede13da42b 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs @@ -10,15 +10,13 @@ internal static class MsBuildCommandExtensions /// /// Appends a call to msbuild. /// - /// - /// /// - public static CommandBuilder MsBuildCommand(this CommandBuilder cmdBuilder, IAutobuilder builder) + public static CommandBuilder MsBuildCommand(this CommandBuilder cmdBuilder, IAutobuilder builder, bool preferDotnet) { // mono doesn't ship with `msbuild` on Arm-based Macs, but we can fall back to // msbuild that ships with `dotnet` which can be invoked with `dotnet msbuild` // perhaps we should do this on all platforms? - return builder.Actions.IsRunningOnAppleSilicon() + return builder.Actions.IsRunningOnAppleSilicon() || preferDotnet ? cmdBuilder.RunCommand("dotnet").Argument("msbuild") : cmdBuilder.RunCommand("msbuild"); } @@ -75,13 +73,21 @@ BuildScript GetNugetRestoreScript() => QuoteArgument(projectOrSolution.FullPath). Argument("-DisableParallelProcessing"). Script; + + BuildScript GetMonoVersionScript() => new CommandBuilder(builder.Actions). + RunCommand("mono"). + Argument("--version"). + Script; + + var preferDotnet = !builder.Actions.IsWindows() && GetMonoVersionScript().Run(builder.Actions, (_, _) => { }, (_, _, _) => { }) != 0; + var nugetRestore = GetNugetRestoreScript(); var msbuildRestoreCommand = new CommandBuilder(builder.Actions). - MsBuildCommand(builder). + MsBuildCommand(builder, preferDotnet). Argument("/t:restore"). QuoteArgument(projectOrSolution.FullPath); - if (builder.Actions.IsRunningOnAppleSilicon()) + if (builder.Actions.IsRunningOnAppleSilicon() || preferDotnet) { // On Apple Silicon, only try package restore with `dotnet msbuild /t:restore` ret &= BuildScript.Try(msbuildRestoreCommand.Script); @@ -119,7 +125,7 @@ BuildScript GetNugetRestoreScript() => command.RunCommand("set Platform=&& type NUL", quoteExe: false); } - command.MsBuildCommand(builder); + command.MsBuildCommand(builder, preferDotnet); command.QuoteArgument(projectOrSolution.FullPath); var target = "rebuild"; From 6c01709048a97c36727c6a7538efb478c53f12a9 Mon Sep 17 00:00:00 2001 From: Asger F Date: Fri, 11 Apr 2025 15:15:22 +0200 Subject: [PATCH 058/240] JS: Update more test output --- javascript/ql/test/library-tests/DataFlow/tests.expected | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/javascript/ql/test/library-tests/DataFlow/tests.expected b/javascript/ql/test/library-tests/DataFlow/tests.expected index 3637927d0e25..55c6771eef02 100644 --- a/javascript/ql/test/library-tests/DataFlow/tests.expected +++ b/javascript/ql/test/library-tests/DataFlow/tests.expected @@ -1094,6 +1094,7 @@ flowStep | tst.js:87:11:87:24 | o | tst.js:90:15:90:15 | o | | tst.js:87:11:87:24 | x | tst.js:91:10:91:10 | x | | tst.js:87:13:87:16 | p: x | tst.js:87:11:87:24 | x | +| tst.js:87:22:87:22 | ...o | tst.js:87:11:87:24 | o | | tst.js:88:7:88:18 | y | tst.js:91:14:91:14 | y | | tst.js:88:9:88:12 | q: y | tst.js:88:7:88:18 | y | | tst.js:88:18:88:18 | o | tst.js:88:7:88:14 | { q: y } | @@ -1110,6 +1111,7 @@ flowStep | tst.js:98:11:98:24 | rest | tst.js:101:13:101:16 | rest | | tst.js:98:11:98:24 | x | tst.js:102:10:102:10 | x | | tst.js:98:13:98:13 | x | tst.js:98:11:98:24 | x | +| tst.js:98:19:98:22 | ...rest | tst.js:98:11:98:24 | rest | | tst.js:99:7:99:18 | y | tst.js:102:14:102:14 | y | | tst.js:99:9:99:9 | y | tst.js:99:7:99:18 | y | | tst.js:99:15:99:18 | rest | tst.js:99:7:99:11 | [ y ] | @@ -1264,6 +1266,7 @@ getImmediatePredecessor | tst.js:87:11:87:24 | o | tst.js:90:15:90:15 | o | | tst.js:87:11:87:24 | x | tst.js:91:10:91:10 | x | | tst.js:87:13:87:16 | p: x | tst.js:87:11:87:24 | x | +| tst.js:87:22:87:22 | ...o | tst.js:87:11:87:24 | o | | tst.js:88:7:88:18 | y | tst.js:91:14:91:14 | y | | tst.js:88:9:88:12 | q: y | tst.js:88:7:88:18 | y | | tst.js:88:18:88:18 | o | tst.js:88:7:88:14 | { q: y } | @@ -1279,6 +1282,7 @@ getImmediatePredecessor | tst.js:98:11:98:24 | rest | tst.js:101:13:101:16 | rest | | tst.js:98:11:98:24 | x | tst.js:102:10:102:10 | x | | tst.js:98:13:98:13 | x | tst.js:98:11:98:24 | x | +| tst.js:98:19:98:22 | ...rest | tst.js:98:11:98:24 | rest | | tst.js:99:7:99:18 | y | tst.js:102:14:102:14 | y | | tst.js:99:9:99:9 | y | tst.js:99:7:99:18 | y | | tst.js:99:15:99:18 | rest | tst.js:99:7:99:11 | [ y ] | From dbbd80f4dc8567eb896c253b3decd29f7b4f572f Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 15:32:15 +0200 Subject: [PATCH 059/240] Rust: pick correct edition for the files Previously we would unconditionally set the edition to the latest stable according to rust-analyzer (2021 at the moment). Now we ask rust-analyzer itself to pick the correct edition for the file. --- rust/extractor/src/rust_analyzer.rs | 117 ++++++++++++++-------------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/rust/extractor/src/rust_analyzer.rs b/rust/extractor/src/rust_analyzer.rs index 1947dcbe09f7..9bd5abaab14b 100644 --- a/rust/extractor/src/rust_analyzer.rs +++ b/rust/extractor/src/rust_analyzer.rs @@ -1,5 +1,5 @@ use itertools::Itertools; -use ra_ap_base_db::{EditionedFileId, RootQueryDb, SourceDatabase}; +use ra_ap_base_db::{EditionedFileId, FileText, RootQueryDb, SourceDatabase}; use ra_ap_hir::Semantics; use ra_ap_ide_db::RootDatabase; use ra_ap_load_cargo::{LoadCargoConfig, load_workspace_at}; @@ -7,7 +7,6 @@ use ra_ap_paths::{AbsPath, Utf8PathBuf}; use ra_ap_project_model::ProjectManifest; use ra_ap_project_model::{CargoConfig, ManifestPath}; use ra_ap_span::Edition; -use ra_ap_span::EditionedFileId as SpanEditionedFileId; use ra_ap_span::TextRange; use ra_ap_span::TextSize; use ra_ap_syntax::SourceFile; @@ -54,7 +53,6 @@ impl<'a> RustAnalyzer<'a> { ) -> Option<(RootDatabase, Vfs)> { let progress = |t| (trace!("progress: {}", t)); let manifest = project.manifest_path(); - match load_workspace_at(manifest.as_ref(), config, load_config, &progress) { Ok((db, vfs, _macro_server)) => Some((db, vfs)), Err(err) => { @@ -66,67 +64,70 @@ impl<'a> RustAnalyzer<'a> { pub fn new(vfs: &'a Vfs, semantics: &'a Semantics<'a, RootDatabase>) -> Self { RustAnalyzer::WithSemantics { vfs, semantics } } - pub fn parse(&self, path: &Path) -> ParseResult { - let no_semantics_reason; + fn get_file_data( + &self, + path: &Path, + ) -> Result<(&Semantics, EditionedFileId, FileText), &str> { match self { + RustAnalyzer::WithoutSemantics { reason } => Err(reason), RustAnalyzer::WithSemantics { vfs, semantics } => { - if let Some(file_id) = path_to_file_id(path, vfs) { - if let Ok(input) = std::panic::catch_unwind(|| semantics.db.file_text(file_id)) - { - let file_id = EditionedFileId::new( - semantics.db, - SpanEditionedFileId::current_edition(file_id), - ); - let source_file = semantics.parse(file_id); - let errors = semantics - .db - .parse_errors(file_id) - .into_iter() - .flat_map(|x| x.to_vec()) - .collect(); - - return ParseResult { - ast: source_file, - text: input.text(semantics.db), - errors, - semantics_info: Ok(FileSemanticInformation { file_id, semantics }), - }; - } - debug!( - "No text available for file_id '{:?}', falling back to loading file '{}' from disk.", - file_id, - path.to_string_lossy() - ); - no_semantics_reason = "no text available for the file in the project"; - } else { - no_semantics_reason = "file not found in project"; - } - } - RustAnalyzer::WithoutSemantics { reason } => { - no_semantics_reason = reason; + let file_id = path_to_file_id(path, vfs).ok_or("file not found in project")?; + let input = std::panic::catch_unwind(|| semantics.db.file_text(file_id)) + .or(Err("no text available for the file in the project"))?; + let editioned_file_id = semantics + .attach_first_edition(file_id) + .ok_or("failed to determine rust edition")?; + Ok(( + semantics, + EditionedFileId::new(semantics.db, editioned_file_id), + input, + )) } } - let mut errors = Vec::new(); - let input = match std::fs::read(path) { - Ok(data) => data, - Err(e) => { - errors.push(SyntaxError::new( - format!("Could not read {}: {}", path.to_string_lossy(), e), - TextRange::empty(TextSize::default()), - )); - vec![] + } + + pub fn parse(&self, path: &Path) -> ParseResult { + match self.get_file_data(path) { + Ok((semantics, file_id, input)) => { + let source_file = semantics.parse(file_id); + let errors = semantics + .db + .parse_errors(file_id) + .into_iter() + .flat_map(|x| x.to_vec()) + .collect(); + + ParseResult { + ast: source_file, + text: input.text(semantics.db), + errors, + semantics_info: Ok(FileSemanticInformation { file_id, semantics }), + } } - }; - let (input, err) = from_utf8_lossy(&input); + Err(reason) => { + let mut errors = Vec::new(); + let input = match std::fs::read(path) { + Ok(data) => data, + Err(e) => { + errors.push(SyntaxError::new( + format!("Could not read {}: {}", path.to_string_lossy(), e), + TextRange::empty(TextSize::default()), + )); + vec![] + } + }; + let (input, err) = from_utf8_lossy(&input); - let parse = ra_ap_syntax::ast::SourceFile::parse(&input, Edition::CURRENT); - errors.extend(parse.errors()); - errors.extend(err); - ParseResult { - ast: parse.tree(), - text: input.as_ref().into(), - errors, - semantics_info: Err(no_semantics_reason), + let parse = ra_ap_syntax::ast::SourceFile::parse(&input, Edition::CURRENT); + errors.extend(parse.errors()); + errors.extend(err); + ParseResult { + ast: parse.tree(), + text: input.as_ref().into(), + errors, + semantics_info: Err(reason), + } + } } } } From 662e963a7b513982825ed8c87a91ddb956ff0857 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 10 Apr 2025 21:35:46 +0200 Subject: [PATCH 060/240] Rust: allow shadowing of prelude items --- .../codeql/rust/internal/PathResolution.qll | 2 +- .../test/library-tests/path-resolution/my.rs | 18 ++++++++++++++++++ .../path-resolution/path-resolution.expected | 7 +++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 91d7e87704c6..bc9da4906ea0 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -178,7 +178,7 @@ abstract class ItemNode extends Locatable { Stages::PathResolutionStage::ref() and result = this.getASuccessorRec(name) or - preludeEdge(this, name, result) + preludeEdge(this, name, result) and not declares(this, _, name) or name = "super" and if this instanceof Module or this instanceof SourceFile diff --git a/rust/ql/test/library-tests/path-resolution/my.rs b/rust/ql/test/library-tests/path-resolution/my.rs index 2dcb1c76aebc..8a94c169f6fe 100644 --- a/rust/ql/test/library-tests/path-resolution/my.rs +++ b/rust/ql/test/library-tests/path-resolution/my.rs @@ -16,3 +16,21 @@ mod my4 { } pub use my4::my5::f as nested_f; // $ item=I201 + +type Result< + T, // T +> = ::std::result::Result< + T, // $ item=T + String, +>; // my::Result + +fn int_div( + x: i32, // + y: i32, +) -> Result // $ item=my::Result +{ + if y == 0 { + return Err("Div by zero".to_string()); + } + Ok(x / y) +} diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index 1d480f2f5ad9..2a27352411e3 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -319,6 +319,13 @@ resolvePath | my.rs:18:9:18:11 | my4 | my.rs:14:1:16:1 | mod my4 | | my.rs:18:9:18:16 | ...::my5 | my.rs:15:5:15:16 | mod my5 | | my.rs:18:9:18:19 | ...::f | my/my4/my5/mod.rs:1:1:3:1 | fn f | +| my.rs:22:5:22:9 | std | file:///Users/arthur/.rustup/toolchains/1.85-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/lib.rs:0:0:0:0 | Crate(std@0.0.0) | +| my.rs:22:5:22:17 | ...::result | file://:0:0:0:0 | mod result | +| my.rs:22:5:25:1 | ...::Result::<...> | file://:0:0:0:0 | enum Result | +| my.rs:23:5:23:5 | T | my.rs:21:5:21:5 | T | +| my.rs:30:6:30:16 | Result::<...> | my.rs:20:1:25:2 | type Result<...> | +| my.rs:33:16:33:18 | Err | file://:0:0:0:0 | Err | +| my.rs:35:5:35:6 | Ok | file://:0:0:0:0 | Ok | | my/nested.rs:9:13:9:13 | f | my/nested.rs:3:9:5:9 | fn f | | my/nested.rs:15:9:15:15 | nested2 | my/nested.rs:2:5:11:5 | mod nested2 | | my/nested.rs:15:9:15:18 | ...::f | my/nested.rs:3:9:5:9 | fn f | From b27ae98b548eceb47fe2624147d65f78e0c74716 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 11 Apr 2025 10:59:08 +0200 Subject: [PATCH 061/240] Rust: normalize paths in the rustup folder --- .../path-resolution/path-resolution.expected | 2 +- .../path-resolution/path-resolution.ql | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index 2a27352411e3..c52ea0980043 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -319,7 +319,7 @@ resolvePath | my.rs:18:9:18:11 | my4 | my.rs:14:1:16:1 | mod my4 | | my.rs:18:9:18:16 | ...::my5 | my.rs:15:5:15:16 | mod my5 | | my.rs:18:9:18:19 | ...::f | my/my4/my5/mod.rs:1:1:3:1 | fn f | -| my.rs:22:5:22:9 | std | file:///Users/arthur/.rustup/toolchains/1.85-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/lib.rs:0:0:0:0 | Crate(std@0.0.0) | +| my.rs:22:5:22:9 | std | file:///RUSTUP_HOME/toolchain/lib/rustlib/src/rust/library/std/src/lib.rs:0:0:0:0 | Crate(std@0.0.0) | | my.rs:22:5:22:17 | ...::result | file://:0:0:0:0 | mod result | | my.rs:22:5:25:1 | ...::Result::<...> | file://:0:0:0:0 | enum Result | | my.rs:23:5:23:5 | T | my.rs:21:5:21:5 | T | diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.ql b/rust/ql/test/library-tests/path-resolution/path-resolution.ql index 4fdcf39c6c62..bd522597a2e4 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.ql +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.ql @@ -5,6 +5,17 @@ import TestUtils query predicate mod(Module m) { toBeTested(m) } -query predicate resolvePath(Path p, ItemNode i) { +class ItemNodeLoc extends Locatable instanceof ItemNode { + predicate hasLocationInfo( + string filepath, int startline, int startcolumn, int endline, int endcolumn + ) { + exists(string file | + super.getLocation().hasLocationInfo(file, startline, startcolumn, endline, endcolumn) and + filepath = file.regexpReplaceAll("^/.*/.rustup/toolchains/[^/]+/", "/RUSTUP_HOME/toolchain/") + ) + } +} + +query predicate resolvePath(Path p, ItemNodeLoc i) { toBeTested(p) and not p.isInMacroExpansion() and i = resolvePath(p) } From 60aa3a8d9d90b51440af7402282d942969fc4d5b Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 16:41:51 +0200 Subject: [PATCH 062/240] Rust: fix workspace member aggregation when absolute path is a glob pattern We were interpreting the absolute path of a workspace as a glob pattern, which doesn't work if the path has some special characters (e.g. `[` or `]`). --- rust/extractor/src/rust_analyzer.rs | 6 ++++-- .../{hello-workspace => hello-[workspace]}/Cargo.toml | 0 .../ExtractionErrors.expected | 0 .../ExtractionErrors.qlref | 0 .../ExtractionWarnings.expected | 0 .../ExtractionWarnings.qlref | 0 .../diagnostics.cargo.expected | 0 .../diagnostics.rust-project.expected | 0 .../{hello-workspace => hello-[workspace]}/exe/Cargo.toml | 0 .../exe/src/a_module.rs | 0 .../{hello-workspace => hello-[workspace]}/exe/src/main.rs | 0 .../functions.expected | 0 .../{hello-workspace => hello-[workspace]}/functions.ql | 0 .../{hello-workspace => hello-[workspace]}/lib/Cargo.toml | 0 .../lib/src/a_module/mod.rs | 0 .../{hello-workspace => hello-[workspace]}/lib/src/lib.rs | 0 .../path-resolution.expected | 0 .../path-resolution.ql | 0 .../rust-project.json | 2 +- .../source_archive.expected | 0 .../steps.cargo.expected | 0 .../{hello-workspace => hello-[workspace]}/steps.ql | 0 .../steps.rust-project.expected | 0 .../summary.cargo.expected | 0 .../{hello-workspace => hello-[workspace]}/summary.qlref | 0 .../summary.rust-project.expected | 0 .../test_workspace.py | 0 27 files changed, 5 insertions(+), 3 deletions(-) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/Cargo.toml (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/ExtractionErrors.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/ExtractionErrors.qlref (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/ExtractionWarnings.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/ExtractionWarnings.qlref (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/diagnostics.cargo.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/diagnostics.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/exe/Cargo.toml (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/exe/src/a_module.rs (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/exe/src/main.rs (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/functions.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/functions.ql (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/lib/Cargo.toml (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/lib/src/a_module/mod.rs (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/lib/src/lib.rs (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/path-resolution.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/path-resolution.ql (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/rust-project.json (99%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/source_archive.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/steps.cargo.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/steps.ql (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/steps.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/summary.cargo.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/summary.qlref (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/summary.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/test_workspace.py (100%) diff --git a/rust/extractor/src/rust_analyzer.rs b/rust/extractor/src/rust_analyzer.rs index 1947dcbe09f7..d79d20b4142f 100644 --- a/rust/extractor/src/rust_analyzer.rs +++ b/rust/extractor/src/rust_analyzer.rs @@ -173,8 +173,10 @@ impl TomlReader { } fn workspace_members_match(workspace_dir: &AbsPath, members: &[String], target: &AbsPath) -> bool { - members.iter().any(|p| { - glob::Pattern::new(workspace_dir.join(p).as_str()).is_ok_and(|p| p.matches(target.as_str())) + target.strip_prefix(workspace_dir).is_some_and(|rel_path| { + members + .iter() + .any(|p| glob::Pattern::new(p).is_ok_and(|p| p.matches(rel_path.as_str()))) }) } diff --git a/rust/ql/integration-tests/hello-workspace/Cargo.toml b/rust/ql/integration-tests/hello-[workspace]/Cargo.toml similarity index 100% rename from rust/ql/integration-tests/hello-workspace/Cargo.toml rename to rust/ql/integration-tests/hello-[workspace]/Cargo.toml diff --git a/rust/ql/integration-tests/hello-workspace/ExtractionErrors.expected b/rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/ExtractionErrors.expected rename to rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.expected diff --git a/rust/ql/integration-tests/hello-workspace/ExtractionErrors.qlref b/rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.qlref similarity index 100% rename from rust/ql/integration-tests/hello-workspace/ExtractionErrors.qlref rename to rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.qlref diff --git a/rust/ql/integration-tests/hello-workspace/ExtractionWarnings.expected b/rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/ExtractionWarnings.expected rename to rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.expected diff --git a/rust/ql/integration-tests/hello-workspace/ExtractionWarnings.qlref b/rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.qlref similarity index 100% rename from rust/ql/integration-tests/hello-workspace/ExtractionWarnings.qlref rename to rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.qlref diff --git a/rust/ql/integration-tests/hello-workspace/diagnostics.cargo.expected b/rust/ql/integration-tests/hello-[workspace]/diagnostics.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/diagnostics.cargo.expected rename to rust/ql/integration-tests/hello-[workspace]/diagnostics.cargo.expected diff --git a/rust/ql/integration-tests/hello-workspace/diagnostics.rust-project.expected b/rust/ql/integration-tests/hello-[workspace]/diagnostics.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/diagnostics.rust-project.expected rename to rust/ql/integration-tests/hello-[workspace]/diagnostics.rust-project.expected diff --git a/rust/ql/integration-tests/hello-workspace/exe/Cargo.toml b/rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml similarity index 100% rename from rust/ql/integration-tests/hello-workspace/exe/Cargo.toml rename to rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml diff --git a/rust/ql/integration-tests/hello-workspace/exe/src/a_module.rs b/rust/ql/integration-tests/hello-[workspace]/exe/src/a_module.rs similarity index 100% rename from rust/ql/integration-tests/hello-workspace/exe/src/a_module.rs rename to rust/ql/integration-tests/hello-[workspace]/exe/src/a_module.rs diff --git a/rust/ql/integration-tests/hello-workspace/exe/src/main.rs b/rust/ql/integration-tests/hello-[workspace]/exe/src/main.rs similarity index 100% rename from rust/ql/integration-tests/hello-workspace/exe/src/main.rs rename to rust/ql/integration-tests/hello-[workspace]/exe/src/main.rs diff --git a/rust/ql/integration-tests/hello-workspace/functions.expected b/rust/ql/integration-tests/hello-[workspace]/functions.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/functions.expected rename to rust/ql/integration-tests/hello-[workspace]/functions.expected diff --git a/rust/ql/integration-tests/hello-workspace/functions.ql b/rust/ql/integration-tests/hello-[workspace]/functions.ql similarity index 100% rename from rust/ql/integration-tests/hello-workspace/functions.ql rename to rust/ql/integration-tests/hello-[workspace]/functions.ql diff --git a/rust/ql/integration-tests/hello-workspace/lib/Cargo.toml b/rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml similarity index 100% rename from rust/ql/integration-tests/hello-workspace/lib/Cargo.toml rename to rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml diff --git a/rust/ql/integration-tests/hello-workspace/lib/src/a_module/mod.rs b/rust/ql/integration-tests/hello-[workspace]/lib/src/a_module/mod.rs similarity index 100% rename from rust/ql/integration-tests/hello-workspace/lib/src/a_module/mod.rs rename to rust/ql/integration-tests/hello-[workspace]/lib/src/a_module/mod.rs diff --git a/rust/ql/integration-tests/hello-workspace/lib/src/lib.rs b/rust/ql/integration-tests/hello-[workspace]/lib/src/lib.rs similarity index 100% rename from rust/ql/integration-tests/hello-workspace/lib/src/lib.rs rename to rust/ql/integration-tests/hello-[workspace]/lib/src/lib.rs diff --git a/rust/ql/integration-tests/hello-workspace/path-resolution.expected b/rust/ql/integration-tests/hello-[workspace]/path-resolution.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/path-resolution.expected rename to rust/ql/integration-tests/hello-[workspace]/path-resolution.expected diff --git a/rust/ql/integration-tests/hello-workspace/path-resolution.ql b/rust/ql/integration-tests/hello-[workspace]/path-resolution.ql similarity index 100% rename from rust/ql/integration-tests/hello-workspace/path-resolution.ql rename to rust/ql/integration-tests/hello-[workspace]/path-resolution.ql diff --git a/rust/ql/integration-tests/hello-workspace/rust-project.json b/rust/ql/integration-tests/hello-[workspace]/rust-project.json similarity index 99% rename from rust/ql/integration-tests/hello-workspace/rust-project.json rename to rust/ql/integration-tests/hello-[workspace]/rust-project.json index d8c73fa41b6d..fae89dcecce8 100644 --- a/rust/ql/integration-tests/hello-workspace/rust-project.json +++ b/rust/ql/integration-tests/hello-[workspace]/rust-project.json @@ -21,4 +21,4 @@ "deps": [] } ] -} \ No newline at end of file +} diff --git a/rust/ql/integration-tests/hello-workspace/source_archive.expected b/rust/ql/integration-tests/hello-[workspace]/source_archive.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/source_archive.expected rename to rust/ql/integration-tests/hello-[workspace]/source_archive.expected diff --git a/rust/ql/integration-tests/hello-workspace/steps.cargo.expected b/rust/ql/integration-tests/hello-[workspace]/steps.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/steps.cargo.expected rename to rust/ql/integration-tests/hello-[workspace]/steps.cargo.expected diff --git a/rust/ql/integration-tests/hello-workspace/steps.ql b/rust/ql/integration-tests/hello-[workspace]/steps.ql similarity index 100% rename from rust/ql/integration-tests/hello-workspace/steps.ql rename to rust/ql/integration-tests/hello-[workspace]/steps.ql diff --git a/rust/ql/integration-tests/hello-workspace/steps.rust-project.expected b/rust/ql/integration-tests/hello-[workspace]/steps.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/steps.rust-project.expected rename to rust/ql/integration-tests/hello-[workspace]/steps.rust-project.expected diff --git a/rust/ql/integration-tests/hello-workspace/summary.cargo.expected b/rust/ql/integration-tests/hello-[workspace]/summary.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/summary.cargo.expected rename to rust/ql/integration-tests/hello-[workspace]/summary.cargo.expected diff --git a/rust/ql/integration-tests/hello-workspace/summary.qlref b/rust/ql/integration-tests/hello-[workspace]/summary.qlref similarity index 100% rename from rust/ql/integration-tests/hello-workspace/summary.qlref rename to rust/ql/integration-tests/hello-[workspace]/summary.qlref diff --git a/rust/ql/integration-tests/hello-workspace/summary.rust-project.expected b/rust/ql/integration-tests/hello-[workspace]/summary.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/summary.rust-project.expected rename to rust/ql/integration-tests/hello-[workspace]/summary.rust-project.expected diff --git a/rust/ql/integration-tests/hello-workspace/test_workspace.py b/rust/ql/integration-tests/hello-[workspace]/test_workspace.py similarity index 100% rename from rust/ql/integration-tests/hello-workspace/test_workspace.py rename to rust/ql/integration-tests/hello-[workspace]/test_workspace.py From 63e5f5a555b10e98e3dc55ebc4ba7701fe553d4a Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 16:50:23 +0200 Subject: [PATCH 063/240] Rust: parametrize some integration tests on three editions --- rust/ql/integration-tests/conftest.py | 32 +++++++++++++++++-- .../hello-project/Cargo.toml | 2 +- .../Cargo.toml | 0 .../ExtractionErrors.expected | 0 .../ExtractionErrors.qlref | 0 .../ExtractionWarnings.expected | 0 .../ExtractionWarnings.qlref | 0 .../diagnostics.cargo.expected | 0 .../diagnostics.rust-project.expected | 0 .../exe/Cargo.toml | 2 +- .../exe/src/a_module.rs | 0 .../exe/src/main.rs | 0 .../functions.expected | 0 .../functions.ql | 0 .../lib/Cargo.toml | 2 +- .../lib/src/a_module/mod.rs | 0 .../lib/src/lib.rs | 0 .../path-resolution.expected | 0 .../path-resolution.ql | 0 .../rust-project.json | 0 .../source_archive.expected | 0 .../steps.cargo.expected | 0 .../steps.ql | 0 .../steps.rust-project.expected | 0 .../summary.cargo.expected | 0 .../summary.qlref | 0 .../summary.rust-project.expected | 0 .../test_workspace.py | 1 - 28 files changed, 32 insertions(+), 7 deletions(-) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/Cargo.toml (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/ExtractionErrors.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/ExtractionErrors.qlref (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/ExtractionWarnings.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/ExtractionWarnings.qlref (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/diagnostics.cargo.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/diagnostics.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/exe/Cargo.toml (69%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/exe/src/a_module.rs (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/exe/src/main.rs (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/functions.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/functions.ql (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/lib/Cargo.toml (60%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/lib/src/a_module/mod.rs (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/lib/src/lib.rs (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/path-resolution.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/path-resolution.ql (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/rust-project.json (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/source_archive.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/steps.cargo.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/steps.ql (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/steps.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/summary.cargo.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/summary.qlref (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/summary.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/test_workspace.py (99%) diff --git a/rust/ql/integration-tests/conftest.py b/rust/ql/integration-tests/conftest.py index a1fbcf4e18d2..578a81a849a9 100644 --- a/rust/ql/integration-tests/conftest.py +++ b/rust/ql/integration-tests/conftest.py @@ -2,13 +2,35 @@ import json import commands import pathlib +import tomllib + + +@pytest.fixture(params=[2018, 2021, 2024]) +def rust_edition(request): + return request.param @pytest.fixture -def cargo(cwd): - assert (cwd / "Cargo.toml").exists() +def cargo(cwd, rust_edition): + manifest_file = cwd / "Cargo.toml" + assert manifest_file.exists() (cwd / "rust-project.json").unlink(missing_ok=True) + def update(file): + contents = file.read_text() + m = tomllib.loads(contents) + if 'package' in m: + # tomllib does not support writing, and we don't want to use further dependencies + # so we just do a dumb search and replace + contents = contents.replace(f'edition = "{m["package"]["edition"]}"', f'edition = "{rust_edition}"') + file.write_text(contents) + if 'members' in m.get('workspace', ()): + for member in m['workspace']['members']: + update(file.parent / member / "Cargo.toml") + + update(manifest_file) + + @pytest.fixture(scope="session") def rust_sysroot_src() -> str: rust_sysroot = pathlib.Path(commands.run("rustc --print sysroot", _capture=True)) @@ -16,15 +38,19 @@ def rust_sysroot_src() -> str: assert ret.exists() return str(ret) + @pytest.fixture -def rust_project(cwd, rust_sysroot_src): +def rust_project(cwd, rust_sysroot_src, rust_edition): project_file = cwd / "rust-project.json" assert project_file.exists() project = json.loads(project_file.read_text()) project["sysroot_src"] = rust_sysroot_src + for c in project["crates"]: + c["edition"] = str(rust_edition) project_file.write_text(json.dumps(project, indent=4)) (cwd / "Cargo.toml").unlink(missing_ok=True) + @pytest.fixture def rust_check_diagnostics(check_diagnostics): check_diagnostics.redact += [ diff --git a/rust/ql/integration-tests/hello-project/Cargo.toml b/rust/ql/integration-tests/hello-project/Cargo.toml index 909b5b525ff3..7ad4f694f489 100644 --- a/rust/ql/integration-tests/hello-project/Cargo.toml +++ b/rust/ql/integration-tests/hello-project/Cargo.toml @@ -2,6 +2,6 @@ [package] name = "hello-cargo" version = "0.1.0" -edition = "2021" +edition = "2021" # replaced in test [dependencies] diff --git a/rust/ql/integration-tests/hello-[workspace]/Cargo.toml b/rust/ql/integration-tests/hello-workspace/Cargo.toml similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/Cargo.toml rename to rust/ql/integration-tests/hello-workspace/Cargo.toml diff --git a/rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.expected b/rust/ql/integration-tests/hello-workspace/ExtractionErrors.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.expected rename to rust/ql/integration-tests/hello-workspace/ExtractionErrors.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.qlref b/rust/ql/integration-tests/hello-workspace/ExtractionErrors.qlref similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.qlref rename to rust/ql/integration-tests/hello-workspace/ExtractionErrors.qlref diff --git a/rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.expected b/rust/ql/integration-tests/hello-workspace/ExtractionWarnings.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.expected rename to rust/ql/integration-tests/hello-workspace/ExtractionWarnings.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.qlref b/rust/ql/integration-tests/hello-workspace/ExtractionWarnings.qlref similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.qlref rename to rust/ql/integration-tests/hello-workspace/ExtractionWarnings.qlref diff --git a/rust/ql/integration-tests/hello-[workspace]/diagnostics.cargo.expected b/rust/ql/integration-tests/hello-workspace/diagnostics.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/diagnostics.cargo.expected rename to rust/ql/integration-tests/hello-workspace/diagnostics.cargo.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/diagnostics.rust-project.expected b/rust/ql/integration-tests/hello-workspace/diagnostics.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/diagnostics.rust-project.expected rename to rust/ql/integration-tests/hello-workspace/diagnostics.rust-project.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml b/rust/ql/integration-tests/hello-workspace/exe/Cargo.toml similarity index 69% rename from rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml rename to rust/ql/integration-tests/hello-workspace/exe/Cargo.toml index b63ccfd5da54..4d9a0e543070 100644 --- a/rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml +++ b/rust/ql/integration-tests/hello-workspace/exe/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "exe" version = "0.1.0" -edition = "2021" +edition = "2021" # replaced in test [dependencies] lib = { path = "../lib" } diff --git a/rust/ql/integration-tests/hello-[workspace]/exe/src/a_module.rs b/rust/ql/integration-tests/hello-workspace/exe/src/a_module.rs similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/exe/src/a_module.rs rename to rust/ql/integration-tests/hello-workspace/exe/src/a_module.rs diff --git a/rust/ql/integration-tests/hello-[workspace]/exe/src/main.rs b/rust/ql/integration-tests/hello-workspace/exe/src/main.rs similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/exe/src/main.rs rename to rust/ql/integration-tests/hello-workspace/exe/src/main.rs diff --git a/rust/ql/integration-tests/hello-[workspace]/functions.expected b/rust/ql/integration-tests/hello-workspace/functions.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/functions.expected rename to rust/ql/integration-tests/hello-workspace/functions.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/functions.ql b/rust/ql/integration-tests/hello-workspace/functions.ql similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/functions.ql rename to rust/ql/integration-tests/hello-workspace/functions.ql diff --git a/rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml b/rust/ql/integration-tests/hello-workspace/lib/Cargo.toml similarity index 60% rename from rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml rename to rust/ql/integration-tests/hello-workspace/lib/Cargo.toml index e8fc5405b71f..9d59bf133d3c 100644 --- a/rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml +++ b/rust/ql/integration-tests/hello-workspace/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lib" version = "0.1.0" -edition = "2021" +edition = "2021" # replaced in test [dependencies] diff --git a/rust/ql/integration-tests/hello-[workspace]/lib/src/a_module/mod.rs b/rust/ql/integration-tests/hello-workspace/lib/src/a_module/mod.rs similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/lib/src/a_module/mod.rs rename to rust/ql/integration-tests/hello-workspace/lib/src/a_module/mod.rs diff --git a/rust/ql/integration-tests/hello-[workspace]/lib/src/lib.rs b/rust/ql/integration-tests/hello-workspace/lib/src/lib.rs similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/lib/src/lib.rs rename to rust/ql/integration-tests/hello-workspace/lib/src/lib.rs diff --git a/rust/ql/integration-tests/hello-[workspace]/path-resolution.expected b/rust/ql/integration-tests/hello-workspace/path-resolution.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/path-resolution.expected rename to rust/ql/integration-tests/hello-workspace/path-resolution.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/path-resolution.ql b/rust/ql/integration-tests/hello-workspace/path-resolution.ql similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/path-resolution.ql rename to rust/ql/integration-tests/hello-workspace/path-resolution.ql diff --git a/rust/ql/integration-tests/hello-[workspace]/rust-project.json b/rust/ql/integration-tests/hello-workspace/rust-project.json similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/rust-project.json rename to rust/ql/integration-tests/hello-workspace/rust-project.json diff --git a/rust/ql/integration-tests/hello-[workspace]/source_archive.expected b/rust/ql/integration-tests/hello-workspace/source_archive.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/source_archive.expected rename to rust/ql/integration-tests/hello-workspace/source_archive.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/steps.cargo.expected b/rust/ql/integration-tests/hello-workspace/steps.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/steps.cargo.expected rename to rust/ql/integration-tests/hello-workspace/steps.cargo.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/steps.ql b/rust/ql/integration-tests/hello-workspace/steps.ql similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/steps.ql rename to rust/ql/integration-tests/hello-workspace/steps.ql diff --git a/rust/ql/integration-tests/hello-[workspace]/steps.rust-project.expected b/rust/ql/integration-tests/hello-workspace/steps.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/steps.rust-project.expected rename to rust/ql/integration-tests/hello-workspace/steps.rust-project.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/summary.cargo.expected b/rust/ql/integration-tests/hello-workspace/summary.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/summary.cargo.expected rename to rust/ql/integration-tests/hello-workspace/summary.cargo.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/summary.qlref b/rust/ql/integration-tests/hello-workspace/summary.qlref similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/summary.qlref rename to rust/ql/integration-tests/hello-workspace/summary.qlref diff --git a/rust/ql/integration-tests/hello-[workspace]/summary.rust-project.expected b/rust/ql/integration-tests/hello-workspace/summary.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/summary.rust-project.expected rename to rust/ql/integration-tests/hello-workspace/summary.rust-project.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/test_workspace.py b/rust/ql/integration-tests/hello-workspace/test_workspace.py similarity index 99% rename from rust/ql/integration-tests/hello-[workspace]/test_workspace.py rename to rust/ql/integration-tests/hello-workspace/test_workspace.py index fe8dbc69141c..acf46b70aa64 100644 --- a/rust/ql/integration-tests/hello-[workspace]/test_workspace.py +++ b/rust/ql/integration-tests/hello-workspace/test_workspace.py @@ -1,6 +1,5 @@ import pytest - @pytest.mark.ql_test("steps.ql", expected=".cargo.expected") @pytest.mark.ql_test("summary.qlref", expected=".cargo.expected") def test_cargo(codeql, rust, cargo, check_source_archive, rust_check_diagnostics): From 9dd1062a9c17d645d588ff2e192327f4b9bd42bd Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 17:25:56 +0200 Subject: [PATCH 064/240] Rust: remove fixed inconsistency --- .../CWE-312/CONSISTENCY/ExtractionConsistency.expected | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/ExtractionConsistency.expected diff --git a/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/ExtractionConsistency.expected deleted file mode 100644 index bd41fe2245ab..000000000000 --- a/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/ExtractionConsistency.expected +++ /dev/null @@ -1,3 +0,0 @@ -extractionWarning -| test_logging.rs:90:12:90:30 | expected R_PAREN | -| test_logging.rs:90:12:90:30 | macro expansion failed: the macro '$crate::__private_api::format_args' expands to ERROR but a Expr was expected | \ No newline at end of file From 64f37ea24c0d18ee96585fb225c917e38c866a2a Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Sat, 12 Apr 2025 16:01:55 +0200 Subject: [PATCH 065/240] Docs: Fix typo in code sample --- docs/codeql/ql-language-reference/types.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codeql/ql-language-reference/types.rst b/docs/codeql/ql-language-reference/types.rst index d2d79fe8409b..005aab370b2e 100644 --- a/docs/codeql/ql-language-reference/types.rst +++ b/docs/codeql/ql-language-reference/types.rst @@ -422,7 +422,7 @@ final extensions leave the extended type unchanged: .. code-block:: ql - from OneTwoTree o + from OneTwoThree o select o, o.getAString() +---+-------------------------+ From 2910cb68cebe062d565caf218f79c4fef3c098df Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 09:19:47 +0200 Subject: [PATCH 066/240] Swift: extract `ExtracFunctionIsolationExpr` --- swift/extractor/infra/SwiftTagTraits.h | 2 +- .../extractor/translators/ExprTranslator.cpp | 7 +++ swift/extractor/translators/ExprTranslator.h | 2 + swift/ql/.generated.list | 16 ++++-- swift/ql/.gitattributes | 6 ++ swift/ql/lib/codeql/swift/elements.qll | 1 + .../expr/ExtractFunctionIsolationExpr.qll | 20 +++++++ ...xtractFunctionIsolationExprConstructor.qll | 14 +++++ .../ExtractFunctionIsolationExprImpl.qll | 27 +++++++++ .../codeql/swift/generated/ParentChild.qll | 22 ++++++++ swift/ql/lib/codeql/swift/generated/Raw.qll | 21 +++++++ swift/ql/lib/codeql/swift/generated/Synth.qll | 32 ++++++++++- .../swift/generated/SynthConstructors.qll | 1 + .../expr/ExtractFunctionIsolationExpr.qll | 56 +++++++++++++++++++ swift/ql/lib/swift.dbscheme | 6 ++ .../ExtractFunctionIsolationExpr.expected | 1 + .../ExtractFunctionIsolationExpr.ql | 11 ++++ ...ractFunctionIsolationExpr_getType.expected | 1 + .../ExtractFunctionIsolationExpr_getType.ql | 7 +++ .../extract_function_isolation.swift | 3 + swift/schema.py | 15 +++++ 21 files changed, 262 insertions(+), 9 deletions(-) create mode 100644 swift/ql/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll create mode 100644 swift/ql/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.expected create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.expected create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/extract_function_isolation.swift diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index 7d3a670be6a6..c300f130c29d 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -202,7 +202,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::ConsumeExpr, ConsumeExprTag) MAP(swift::MaterializePackExpr, MaterializePackExprTag) MAP(swift::SingleValueStmtExpr, SingleValueStmtExprTag) - MAP(swift::ExtractFunctionIsolationExpr, void) // TODO swift 6.0 + MAP(swift::ExtractFunctionIsolationExpr, ExtractFunctionIsolationExprTag) MAP(swift::CurrentContextIsolationExpr, void) // TODO swift 6.0 MAP(swift::Decl, DeclTag) MAP(swift::ValueDecl, ValueDeclTag) diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index 2da23e9c0afb..97a314a33ef3 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -671,4 +671,11 @@ codeql::MaterializePackExpr ExprTranslator::translateMaterializePackExpr( return entry; } +codeql::ExtractFunctionIsolationExpr ExprTranslator::translateExtractFunctionIsolationExpr( + const swift::ExtractFunctionIsolationExpr& expr) { + auto entry = createExprEntry(expr); + entry.function_expr = dispatcher.fetchLabel(expr.getFunctionExpr()); + return entry; +} + } // namespace codeql diff --git a/swift/extractor/translators/ExprTranslator.h b/swift/extractor/translators/ExprTranslator.h index 5dec909b1b23..0b0e8cbd3046 100644 --- a/swift/extractor/translators/ExprTranslator.h +++ b/swift/extractor/translators/ExprTranslator.h @@ -125,6 +125,8 @@ class ExprTranslator : public AstTranslatorBase { codeql::CopyExpr translateCopyExpr(const swift::CopyExpr& expr); codeql::ConsumeExpr translateConsumeExpr(const swift::ConsumeExpr& expr); codeql::MaterializePackExpr translateMaterializePackExpr(const swift::MaterializePackExpr& expr); + codeql::ExtractFunctionIsolationExpr translateExtractFunctionIsolationExpr( + const swift::ExtractFunctionIsolationExpr& expr); private: void fillClosureExpr(const swift::AbstractClosureExpr& expr, codeql::ClosureExpr& entry); diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 32734851515c..19668fe8c933 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -164,6 +164,7 @@ lib/codeql/swift/elements/expr/ExistentialMetatypeToObjectExpr.qll d594531b0f9ce lib/codeql/swift/elements/expr/ExplicitCastExpr.qll 2298ed1952b7d6454d6da53f79a5460987fea4c30317187799fd425d0a013e4f bc4007c1521fbaa9811d6a893a2eea9901f3b1bff2e89a201d416c067e5b2e32 lib/codeql/swift/elements/expr/ExplicitClosureExpr.qll bdfa54ebd6bf8bb872cad5a04f57a78c63f9a92ab282d845bf654a45da0cad97 1071c526a7d263151ce9de155d43245dddce33d168b6520f49c96908e91fb256 lib/codeql/swift/elements/expr/Expr.qll ae02fbaaf676b1418a047da363a4a61174ba5aba08b229b4f6ba5b3fb96c1edd ff9c4d4d274cceeb178d85a469791833b60a89b06dc4df4678932d6ea7a799ee +lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll 3b557d7e0c8d340e30ff22b22a1f7eb5a7ccb3e278835f1968627c5174cb530a dc25ac7455be2c622e588855a572c49b31e3cdf8900fc83ee79ff40a5e1c4687 lib/codeql/swift/elements/expr/FloatLiteralExpr.qll f80be9eea21297f891761284da66c690706b188aadf824641a27446c1b914789 5c6a0ea847a688a33acb6e12713b9d9f33218148e6a51e80b57b3e0e4543ffae lib/codeql/swift/elements/expr/ForceTryExpr.qll 087b6e8ee24d6956cd63adf3e82d89e37d0482c7ba19c2b69af557d1962fdd62 233e166748af3d0f1efb265cd6b15c9960df841fabd6a8eb54744b53d897b35f lib/codeql/swift/elements/expr/ForceValueExpr.qll 397cfd523b3791684482c55a130629d10fd3d993ffe21e8e2d6e7b0295881e54 4a3ecd15296c661d9ebcccaa75f742fdb10056614e0f0ac6085571951b580d6a @@ -311,6 +312,8 @@ lib/codeql/swift/elements/expr/internal/ErrorExprImpl.qll 819ddf5500b362c2b48ae9 lib/codeql/swift/elements/expr/internal/ExistentialMetatypeToObjectExprConstructor.qll 338043a69b96c85913ac5ae02efb7fa363bb97ef33f1caab4253f1146f4a0e2b 0e66776ca92ebc6ab5b3cbc2b4e7fca382436279dacd5bf9f742b6e0c2150ab0 lib/codeql/swift/elements/expr/internal/ExistentialMetatypeToObjectExprImpl.qll 50104bc5721fbd13e1b22639b1a8e1114c0691297c808926c73f5257e55fd4f6 38b634dc13cdbabe0f7195e2a399c7370522b7fc8a56a3a9c53e8928b0742100 lib/codeql/swift/elements/expr/internal/ExplicitClosureExprConstructor.qll fe430a5f87fdb10a4354f699437150bda543ae7b2d09879e50c0498239417a4b f8ea635fe9ab01d48a52f135079a34689a648a4c279bddaf8def56ed014868b7 +lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll 5f940fa3982695f409225cc81dd89140aa35d396ba93ae88a370167e3e1ebdc2 b6c3085b5d7fed62660b57578537fb9ad7bde1a564b832e1eee7845a813e76be +lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll edaad600821c5534b3b2c1a642c9d36b2c1ac406d97334ab7c1e4d934f188614 02e36137fcd5b64d1a89950a01ed129dc28034cf64310d333c06bc581ac9472e lib/codeql/swift/elements/expr/internal/FloatLiteralExprConstructor.qll b6a507af69777dc3e333e1346a3f93b4398551608f6789de562c2b57f1f5bb67 fe2eb2aacb3d4c3d2fa5476199512d5e1ce6aca6d2605dc94445e127ee2f3b08 lib/codeql/swift/elements/expr/internal/ForceTryExprConstructor.qll 159e084ab5e6fdbcd45b0ec0d4915121e8f425d764e8787df053e8a0b8fb6137 ebd9c1eb6c5029eef2ee6bb307e15f1eaf2e5db1fa97565cd04386b584b56674 lib/codeql/swift/elements/expr/internal/ForceValueExprConstructor.qll 1c85f4d1d06f46f8c992ca13e32de8bc2c682d04a550ccec026ea301307ce2ef a89cf5fdd2063318244d42e73ddbe0e235bd76dcf35e54ace58f098d217e94d7 @@ -692,7 +695,7 @@ lib/codeql/swift/elements/type/internal/UnresolvedTypeImpl.qll ee1499dd568753898 lib/codeql/swift/elements/type/internal/VariadicSequenceTypeConstructor.qll fc74a5a2a2effa28ef24509b20ee4373d97cf6e8c71840121bb031c6adedf584 c9b2effc1d01c13c5e6a74a111122fa79a2f6554dda3cb016d68ba397e566ec4 lib/codeql/swift/elements/type/internal/WeakStorageTypeConstructor.qll 5fdce3716aba6318522174a2c455a63480970222ae81c732fb19c6dd3ae2d271 60ea79d6943e129deba0deccb566cf9d73f78398b0f7f0212674d91287d6b2ae lib/codeql/swift/elements/type/internal/WeakStorageTypeImpl.qll 74f79b458f3204ec2519bd654de21bc4fb6b76816bd8ca01990fe897563a1383 34e1810f74cecda5b580ed050438ae1d914b97a36b8f4e2de1c25254c0cac633 -lib/codeql/swift/elements.qll 8a9719dd149f539a01c4c8cbe93a15f221cc1dee388a500adada8facd6a92f57 8a9719dd149f539a01c4c8cbe93a15f221cc1dee388a500adada8facd6a92f57 +lib/codeql/swift/elements.qll 0853da5629624f0be83b603afa04e2280d4feb65f4c1c764ff21d979342f91d4 0853da5629624f0be83b603afa04e2280d4feb65f4c1c764ff21d979342f91d4 lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99 lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119 @@ -709,12 +712,12 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f -lib/codeql/swift/generated/ParentChild.qll bafa2e366c0df25d6c26c4e2e2b84f3e363524d7abcf0f6e31e42879f2bc664a 616160f5664f77346992c2ac39e3229abdf186fe707066d4895ceddd148749a9 +lib/codeql/swift/generated/ParentChild.qll b83a0abc72324c099409e5136f50b9da12cbc27129b7679cc66138d796eddcf7 28cef184087887409504bcab8a7b381982fdafbc4b12e7b90236620b83693dc9 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 4f2ddadd2ced9728aaf4595ccf85cd147468d7ad0a57a21a6cbfd04e3834b386 9653595693da55953d7743fbecce33d16910e3b6737c654311f1e34d27ad7f0b -lib/codeql/swift/generated/Synth.qll 31e318c6e156848c85a2a2664695b48b5e93c57c9bb22fa29d027069907b3ab0 8655ffcf772f55284b93f1d7f8e1b3d497a9744d5f2e0c17bc322c1fdf8bdba8 -lib/codeql/swift/generated/SynthConstructors.qll 3e53c7853096020219c01dae85681fe80b34938d198a0ff359a209dda41c5ed7 3e53c7853096020219c01dae85681fe80b34938d198a0ff359a209dda41c5ed7 +lib/codeql/swift/generated/Raw.qll 6718c8cfed48ea863eea4e112502de92dc369139a9496c61124ac608ac25f8ac 03a7ee490b51fe328eca447a5042ba6ade0c468faf10971a5793b530b5619953 +lib/codeql/swift/generated/Synth.qll faa969292c3db59606356e0343ce36c99f53d545bbbe33103ce1de0b8d532d1f 29850fc05a0c8ba89391ec9469b4e75e2a98d523e0d53b0426ef46cb942c02ae +lib/codeql/swift/generated/SynthConstructors.qll 73ed3d8d2b059c705c6887a373fb40ce2d66d176dde4d573f099d7e5dbcf4f74 73ed3d8d2b059c705c6887a373fb40ce2d66d176dde4d573f099d7e5dbcf4f74 lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022 @@ -816,6 +819,7 @@ lib/codeql/swift/generated/expr/ExistentialMetatypeToObjectExpr.qll f6eb63b5887d lib/codeql/swift/generated/expr/ExplicitCastExpr.qll 2830522bd17122c26a2392405b2c160ff29ebe8cb0aa8d21498a2b0f05ce9858 bc96f19c0bcb36e78c7f7c48c7d01dbdefaa20564a020e7baf2fc9d8abe734c2 lib/codeql/swift/generated/expr/ExplicitClosureExpr.qll e6fa08fad995b2cafb9d76482cc836e6a0fa24d1e055e848bf2df5acedd12a94 79730347c91ab01c480116c7feba97dafafc030c910e6664519fbc122201cf5b lib/codeql/swift/generated/expr/Expr.qll 29581d27469f6abd06bb1c29cce142e8287f3a6eb7cb251fd14e832e6a6a4e6a 957d3f470d91e757b2921af49651b7c1a1eb111e74ff9ea12577d5df38714c64 +lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll 87e5b3d76a64297787c4e9c63e5278f75f94df64acf6dce2cd12af52f071b90b 185ff557ef4f3efaccc696705282df74dda577063197cc8bc20bc8968993a1ff lib/codeql/swift/generated/expr/FloatLiteralExpr.qll fb226de33de8ede0c3048aa5735f83feafa912d165a793e06e50d0d87165989c 0fb88029e576f444a9623b49294a5fb713bb0f38850e136378107dafcefb98a2 lib/codeql/swift/generated/expr/ForceTryExpr.qll da482d8440c5245dd4ea347e0d6c14cfb455f426055bb4e4c23cacae511a3a52 9c2ec46370708434337802dc62a07f24382cb3ea4499eafcf45ba8b503cbebf9 lib/codeql/swift/generated/expr/ForceValueExpr.qll 3660da045afe79bf7815519134278851a8852ca4a159cf54a2d4f2d413864471 4e7416dc69fb917f6cd304d992a6d0e4e7cd1b4ce16201c86cf3a53a58892635 @@ -1144,6 +1148,8 @@ test/extractor-tests/generated/expr/DynamicTypeExpr/MISSING_SOURCE.txt 35fb32ea5 test/extractor-tests/generated/expr/EnumIsCaseExpr/EnumIsCaseExpr.ql 426837e6acd80fd5c4f79f756919c99df132f6666aae9d07274c4b95711123bd 451393b79359a46070db84d8d35ad3c7f14cc20eddd3df2a70126575d2200297 test/extractor-tests/generated/expr/EnumIsCaseExpr/EnumIsCaseExpr_getType.ql 9deff1a2a2271c2dbe44b2aeef42f9adadd73b0e09eb6d71c68ac5bd8d315447 bdc07aec1fa2ced3f8b4c2dcede0354b8943488acf13e559f882f01161172318 test/extractor-tests/generated/expr/ExplicitClosureExpr/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d +test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql 7c4666a86e962726a505e76c57196483c6eb5259463a1cbdb6239f5ccbb33a13 2b5acd61e85a46b1c565104ba6f58b58813ffeba3548dacd776f72db552d5d65 +test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql 487c727c721ff925861b265d9a4f78029f04dba3b94e064529d89c7ee55ac343 3bfdadc09b8672b9030f43c2f0cab6395af803e79ddc17089c43c3da93d69979 test/extractor-tests/generated/expr/FloatLiteralExpr/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d test/extractor-tests/generated/expr/ForceTryExpr/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d test/extractor-tests/generated/expr/ForceValueExpr/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d diff --git a/swift/ql/.gitattributes b/swift/ql/.gitattributes index ab478ec526b5..45bfde2b5a86 100644 --- a/swift/ql/.gitattributes +++ b/swift/ql/.gitattributes @@ -166,6 +166,7 @@ /lib/codeql/swift/elements/expr/ExplicitCastExpr.qll linguist-generated /lib/codeql/swift/elements/expr/ExplicitClosureExpr.qll linguist-generated /lib/codeql/swift/elements/expr/Expr.qll linguist-generated +/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll linguist-generated /lib/codeql/swift/elements/expr/FloatLiteralExpr.qll linguist-generated /lib/codeql/swift/elements/expr/ForceTryExpr.qll linguist-generated /lib/codeql/swift/elements/expr/ForceValueExpr.qll linguist-generated @@ -313,6 +314,8 @@ /lib/codeql/swift/elements/expr/internal/ExistentialMetatypeToObjectExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/ExistentialMetatypeToObjectExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/ExplicitClosureExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/FloatLiteralExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/ForceTryExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/ForceValueExprConstructor.qll linguist-generated @@ -818,6 +821,7 @@ /lib/codeql/swift/generated/expr/ExplicitCastExpr.qll linguist-generated /lib/codeql/swift/generated/expr/ExplicitClosureExpr.qll linguist-generated /lib/codeql/swift/generated/expr/Expr.qll linguist-generated +/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll linguist-generated /lib/codeql/swift/generated/expr/FloatLiteralExpr.qll linguist-generated /lib/codeql/swift/generated/expr/ForceTryExpr.qll linguist-generated /lib/codeql/swift/generated/expr/ForceValueExpr.qll linguist-generated @@ -1146,6 +1150,8 @@ /test/extractor-tests/generated/expr/EnumIsCaseExpr/EnumIsCaseExpr.ql linguist-generated /test/extractor-tests/generated/expr/EnumIsCaseExpr/EnumIsCaseExpr_getType.ql linguist-generated /test/extractor-tests/generated/expr/ExplicitClosureExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql linguist-generated +/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql linguist-generated /test/extractor-tests/generated/expr/FloatLiteralExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/expr/ForceTryExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/expr/ForceValueExpr/MISSING_SOURCE.txt linguist-generated diff --git a/swift/ql/lib/codeql/swift/elements.qll b/swift/ql/lib/codeql/swift/elements.qll index 5d79bdf2d248..3e2080262d11 100644 --- a/swift/ql/lib/codeql/swift/elements.qll +++ b/swift/ql/lib/codeql/swift/elements.qll @@ -119,6 +119,7 @@ import codeql.swift.elements.expr.ExistentialMetatypeToObjectExpr import codeql.swift.elements.expr.ExplicitCastExpr import codeql.swift.elements.expr.ExplicitClosureExpr import codeql.swift.elements.expr.Expr +import codeql.swift.elements.expr.ExtractFunctionIsolationExpr import codeql.swift.elements.expr.FloatLiteralExpr import codeql.swift.elements.expr.ForceTryExpr import codeql.swift.elements.expr.ForceValueExpr diff --git a/swift/ql/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll b/swift/ql/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll new file mode 100644 index 000000000000..62ef58ee602d --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll @@ -0,0 +1,20 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the public class `ExtractFunctionIsolationExpr`. + */ + +private import internal.ExtractFunctionIsolationExprImpl +import codeql.swift.elements.expr.Expr + +/** + * An expression that extracts the function isolation of an expression with `@isolated(any)` + * function type. + * + * For example: + * ``` + * func foo(x: @isolated(any) () -> ()) { + * let isolation = x.isolation + * } + * ``` + */ +final class ExtractFunctionIsolationExpr = Impl::ExtractFunctionIsolationExpr; diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll new file mode 100644 index 000000000000..a2a52efef60e --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `ExtractFunctionIsolationExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.Raw + +/** + * The characteristic predicate of `ExtractFunctionIsolationExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructExtractFunctionIsolationExpr(Raw::ExtractFunctionIsolationExpr id) { any() } diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll new file mode 100644 index 000000000000..dcb7d5874940 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll @@ -0,0 +1,27 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `ExtractFunctionIsolationExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.expr.ExtractFunctionIsolationExpr + +/** + * INTERNAL: This module contains the customizable definition of `ExtractFunctionIsolationExpr` and should not + * be referenced directly. + */ +module Impl { + /** + * An expression that extracts the function isolation of an expression with `@isolated(any)` + * function type. + * + * For example: + * ``` + * func foo(x: @isolated(any) () -> ()) { + * let isolation = x.isolation + * } + * ``` + */ + class ExtractFunctionIsolationExpr extends Generated::ExtractFunctionIsolationExpr { } +} diff --git a/swift/ql/lib/codeql/swift/generated/ParentChild.qll b/swift/ql/lib/codeql/swift/generated/ParentChild.qll index 13e75c262398..083c31f67ac2 100644 --- a/swift/ql/lib/codeql/swift/generated/ParentChild.qll +++ b/swift/ql/lib/codeql/swift/generated/ParentChild.qll @@ -1406,6 +1406,26 @@ private module Impl { ) } + private Element getImmediateChildOfExtractFunctionIsolationExpr( + ExtractFunctionIsolationExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bExpr, int n, int nFunctionExpr | + b = 0 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + n = bExpr and + nFunctionExpr = n + 1 and + ( + none() + or + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + or + index = n and + result = e.getImmediateFunctionExpr() and + partialPredicateCall = "FunctionExpr()" + ) + ) + } + private Element getImmediateChildOfForceValueExpr( ForceValueExpr e, int index, string partialPredicateCall ) { @@ -5238,6 +5258,8 @@ private module Impl { or result = getImmediateChildOfErrorExpr(e, index, partialAccessor) or + result = getImmediateChildOfExtractFunctionIsolationExpr(e, index, partialAccessor) + or result = getImmediateChildOfForceValueExpr(e, index, partialAccessor) or result = getImmediateChildOfIfExpr(e, index, partialAccessor) diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index 820dd7e3a888..f7c919ded6d2 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -1346,6 +1346,27 @@ module Raw { Expr getSubExpr() { explicit_cast_exprs(this, result) } } + /** + * INTERNAL: Do not use. + * An expression that extracts the function isolation of an expression with `@isolated(any)` + * function type. + * + * For example: + * ``` + * func foo(x: @isolated(any) () -> ()) { + * let isolation = x.isolation + * } + * ``` + */ + class ExtractFunctionIsolationExpr extends @extract_function_isolation_expr, Expr { + override string toString() { result = "ExtractFunctionIsolationExpr" } + + /** + * Gets the function expression of this extract function isolation expression. + */ + Expr getFunctionExpr() { extract_function_isolation_exprs(this, result) } + } + /** * INTERNAL: Do not use. */ diff --git a/swift/ql/lib/codeql/swift/generated/Synth.qll b/swift/ql/lib/codeql/swift/generated/Synth.qll index 44759bc72eab..f8cb4713f2af 100644 --- a/swift/ql/lib/codeql/swift/generated/Synth.qll +++ b/swift/ql/lib/codeql/swift/generated/Synth.qll @@ -394,6 +394,12 @@ module Synth { * INTERNAL: Do not use. */ TExplicitClosureExpr(Raw::ExplicitClosureExpr id) { constructExplicitClosureExpr(id) } or + /** + * INTERNAL: Do not use. + */ + TExtractFunctionIsolationExpr(Raw::ExtractFunctionIsolationExpr id) { + constructExtractFunctionIsolationExpr(id) + } or /** * INTERNAL: Do not use. */ @@ -1232,9 +1238,9 @@ module Synth { TCaptureListExpr or TClosureExpr or TCollectionExpr or TConsumeExpr or TCopyExpr or TDeclRefExpr or TDefaultArgumentExpr or TDiscardAssignmentExpr or TDotSyntaxBaseIgnoredExpr or TDynamicTypeExpr or TEnumIsCaseExpr or TErrorExpr or - TExplicitCastExpr or TForceValueExpr or TIdentityExpr or TIfExpr or - TImplicitConversionExpr or TInOutExpr or TKeyPathApplicationExpr or TKeyPathDotExpr or - TKeyPathExpr or TLazyInitializationExpr or TLiteralExpr or TLookupExpr or + TExplicitCastExpr or TExtractFunctionIsolationExpr or TForceValueExpr or TIdentityExpr or + TIfExpr or TImplicitConversionExpr or TInOutExpr or TKeyPathApplicationExpr or + TKeyPathDotExpr or TKeyPathExpr or TLazyInitializationExpr or TLiteralExpr or TLookupExpr or TMakeTemporarilyEscapableExpr or TMaterializePackExpr or TObjCSelectorExpr or TOneWayExpr or TOpaqueValueExpr or TOpenExistentialExpr or TOptionalEvaluationExpr or TOtherInitializerRefExpr or TOverloadedDeclRefExpr or TPackElementExpr or @@ -2018,6 +2024,14 @@ module Synth { result = TExplicitClosureExpr(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TExtractFunctionIsolationExpr`, if possible. + */ + TExtractFunctionIsolationExpr convertExtractFunctionIsolationExprFromRaw(Raw::Element e) { + result = TExtractFunctionIsolationExpr(e) + } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TFloatLiteralExpr`, if possible. @@ -3545,6 +3559,8 @@ module Synth { or result = convertExplicitCastExprFromRaw(e) or + result = convertExtractFunctionIsolationExprFromRaw(e) + or result = convertForceValueExprFromRaw(e) or result = convertIdentityExprFromRaw(e) @@ -4690,6 +4706,14 @@ module Synth { e = TExplicitClosureExpr(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TExtractFunctionIsolationExpr` to a raw DB element, if possible. + */ + Raw::Element convertExtractFunctionIsolationExprToRaw(TExtractFunctionIsolationExpr e) { + e = TExtractFunctionIsolationExpr(result) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TFloatLiteralExpr` to a raw DB element, if possible. @@ -6215,6 +6239,8 @@ module Synth { or result = convertExplicitCastExprToRaw(e) or + result = convertExtractFunctionIsolationExprToRaw(e) + or result = convertForceValueExprToRaw(e) or result = convertIdentityExprToRaw(e) diff --git a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll index 0d5dcdaaa6a4..259453b63f6e 100644 --- a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll +++ b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll @@ -90,6 +90,7 @@ import codeql.swift.elements.expr.internal.ErasureExprConstructor import codeql.swift.elements.expr.internal.ErrorExprConstructor import codeql.swift.elements.expr.internal.ExistentialMetatypeToObjectExprConstructor import codeql.swift.elements.expr.internal.ExplicitClosureExprConstructor +import codeql.swift.elements.expr.internal.ExtractFunctionIsolationExprConstructor import codeql.swift.elements.expr.internal.FloatLiteralExprConstructor import codeql.swift.elements.expr.internal.ForceTryExprConstructor import codeql.swift.elements.expr.internal.ForceValueExprConstructor diff --git a/swift/ql/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll new file mode 100644 index 000000000000..28b942b54dab --- /dev/null +++ b/swift/ql/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll @@ -0,0 +1,56 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the generated definition of `ExtractFunctionIsolationExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.swift.generated.Synth +private import codeql.swift.generated.Raw +import codeql.swift.elements.expr.Expr +import codeql.swift.elements.expr.internal.ExprImpl::Impl as ExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `ExtractFunctionIsolationExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * An expression that extracts the function isolation of an expression with `@isolated(any)` + * function type. + * + * For example: + * ``` + * func foo(x: @isolated(any) () -> ()) { + * let isolation = x.isolation + * } + * ``` + * INTERNAL: Do not reference the `Generated::ExtractFunctionIsolationExpr` class directly. + * Use the subclass `ExtractFunctionIsolationExpr`, where the following predicates are available. + */ + class ExtractFunctionIsolationExpr extends Synth::TExtractFunctionIsolationExpr, ExprImpl::Expr { + override string getAPrimaryQlClass() { result = "ExtractFunctionIsolationExpr" } + + /** + * Gets the function expression of this extract function isolation expression. + * + * This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the + * behavior of both the `Immediate` and non-`Immediate` versions. + */ + Expr getImmediateFunctionExpr() { + result = + Synth::convertExprFromRaw(Synth::convertExtractFunctionIsolationExprToRaw(this) + .(Raw::ExtractFunctionIsolationExpr) + .getFunctionExpr()) + } + + /** + * Gets the function expression of this extract function isolation expression. + */ + final Expr getFunctionExpr() { + exists(Expr immediate | + immediate = this.getImmediateFunctionExpr() and + if exists(this.getResolveStep()) then result = immediate else result = immediate.resolve() + ) + } + } +} diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 33db81ad4b60..80ba4a9a1045 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -786,6 +786,7 @@ arguments( //dir=expr | @enum_is_case_expr | @error_expr | @explicit_cast_expr +| @extract_function_isolation_expr | @force_value_expr | @identity_expr | @if_expr @@ -994,6 +995,11 @@ explicit_cast_exprs( //dir=expr int sub_expr: @expr_or_none ref ); +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + force_value_exprs( //dir=expr unique int id: @force_value_expr, int sub_expr: @expr_or_none ref diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.expected b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.expected new file mode 100644 index 000000000000..aabc59fac994 --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.expected @@ -0,0 +1 @@ +| extract_function_isolation.swift:2:21:2:23 | ExtractFunctionIsolationExpr | hasType: | yes | getFunctionExpr: | extract_function_isolation.swift:2:21:2:21 | x | diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql new file mode 100644 index 000000000000..f133b61f9b67 --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen/codegen.py, do not edit +import codeql.swift.elements +import TestUtils + +from ExtractFunctionIsolationExpr x, string hasType, Expr getFunctionExpr +where + toBeTested(x) and + not x.isUnknown() and + (if x.hasType() then hasType = "yes" else hasType = "no") and + getFunctionExpr = x.getFunctionExpr() +select x, "hasType:", hasType, "getFunctionExpr:", getFunctionExpr diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.expected b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.expected new file mode 100644 index 000000000000..2c6a32f914c0 --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.expected @@ -0,0 +1 @@ +| extract_function_isolation.swift:2:21:2:23 | ExtractFunctionIsolationExpr | (any Actor)? | diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql new file mode 100644 index 000000000000..b7e9c6a7ba0c --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql @@ -0,0 +1,7 @@ +// generated by codegen/codegen.py, do not edit +import codeql.swift.elements +import TestUtils + +from ExtractFunctionIsolationExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getType() diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/extract_function_isolation.swift b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/extract_function_isolation.swift new file mode 100644 index 000000000000..fb5dcb52c083 --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/extract_function_isolation.swift @@ -0,0 +1,3 @@ +func foo(x: @isolated(any) () -> ()) { + let isolation = x.isolation +} diff --git a/swift/schema.py b/swift/schema.py index 7c2cebb594da..59660fd4031a 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1425,3 +1425,18 @@ class DiscardStmt(Stmt): ``` """ sub_expr: Expr | child + + +class ExtractFunctionIsolationExpr(Expr): + """ + An expression that extracts the function isolation of an expression with `@isolated(any)` + function type. + + For example: + ``` + func foo(x: @isolated(any) () -> ()) { + let isolation = x.isolation + } + ``` + """ + function_expr: Expr | child From 42ec6b018d757c107963543b8c3b3001b194b12f Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 09:28:10 +0200 Subject: [PATCH 067/240] Swift: add `ExtractFunctionIsolationTree` to control flow --- .../swift/controlflow/internal/ControlFlowGraphImpl.qll | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll b/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll index f785bd0f2784..601e0eb0ad38 100644 --- a/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll +++ b/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll @@ -1866,6 +1866,15 @@ module Exprs { } } + private class ExtractFunctionIsolationTree extends AstStandardPostOrderTree { + override ExtractFunctionIsolationExpr ast; + + final override ControlFlowElement getChildNode(int i) { + i = 0 and + result.asAstNode() = ast.getFunctionExpr().getFullyConverted() + } + } + module Conversions { class ConversionOrIdentity = Synth::TIdentityExpr or Synth::TExplicitCastExpr or Synth::TImplicitConversionExpr or From 712142cde967d60bbb6bb1180d7db9f21230e4da Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 09:48:05 +0200 Subject: [PATCH 068/240] Swift: extract `CurrentContextIsolationExpr` --- swift/extractor/infra/SwiftTagTraits.h | 2 +- .../extractor/translators/ExprTranslator.cpp | 7 +++ swift/extractor/translators/ExprTranslator.h | 2 + swift/ql/.generated.list | 14 ++++-- swift/ql/.gitattributes | 4 ++ swift/ql/lib/codeql/swift/elements.qll | 1 + .../expr/CurrentContextIsolationExpr.qll | 14 ++++++ ...CurrentContextIsolationExprConstructor.qll | 14 ++++++ .../CurrentContextIsolationExprImpl.qll | 21 ++++++++ .../codeql/swift/generated/ParentChild.qll | 17 +++++++ swift/ql/lib/codeql/swift/generated/Raw.qll | 15 ++++++ swift/ql/lib/codeql/swift/generated/Synth.qll | 44 ++++++++++++---- .../swift/generated/SynthConstructors.qll | 1 + .../expr/CurrentContextIsolationExpr.qll | 50 +++++++++++++++++++ swift/ql/lib/swift.dbscheme | 6 +++ swift/schema.py | 10 ++++ 16 files changed, 207 insertions(+), 15 deletions(-) create mode 100644 swift/ql/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll create mode 100644 swift/ql/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index c300f130c29d..006c649fad5a 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -203,7 +203,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::MaterializePackExpr, MaterializePackExprTag) MAP(swift::SingleValueStmtExpr, SingleValueStmtExprTag) MAP(swift::ExtractFunctionIsolationExpr, ExtractFunctionIsolationExprTag) - MAP(swift::CurrentContextIsolationExpr, void) // TODO swift 6.0 + MAP(swift::CurrentContextIsolationExpr, CurrentContextIsolationExprTag) MAP(swift::Decl, DeclTag) MAP(swift::ValueDecl, ValueDeclTag) MAP(swift::TypeDecl, TypeDeclTag) diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index 97a314a33ef3..915d26b33731 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -678,4 +678,11 @@ codeql::ExtractFunctionIsolationExpr ExprTranslator::translateExtractFunctionIso return entry; } +codeql::CurrentContextIsolationExpr ExprTranslator::translateCurrentContextIsolationExpr( + const swift::CurrentContextIsolationExpr& expr) { + auto entry = createExprEntry(expr); + entry.actor = dispatcher.fetchLabel(expr.getActor()); + return entry; +} + } // namespace codeql diff --git a/swift/extractor/translators/ExprTranslator.h b/swift/extractor/translators/ExprTranslator.h index 0b0e8cbd3046..ff3db137b3bc 100644 --- a/swift/extractor/translators/ExprTranslator.h +++ b/swift/extractor/translators/ExprTranslator.h @@ -127,6 +127,8 @@ class ExprTranslator : public AstTranslatorBase { codeql::MaterializePackExpr translateMaterializePackExpr(const swift::MaterializePackExpr& expr); codeql::ExtractFunctionIsolationExpr translateExtractFunctionIsolationExpr( const swift::ExtractFunctionIsolationExpr& expr); + codeql::CurrentContextIsolationExpr translateCurrentContextIsolationExpr( + const swift::CurrentContextIsolationExpr& expr); private: void fillClosureExpr(const swift::AbstractClosureExpr& expr, codeql::ClosureExpr& entry); diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 19668fe8c933..8dd1a1ba407e 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -143,6 +143,7 @@ lib/codeql/swift/elements/expr/ConsumeExpr.qll cf1551b82e4dd28555778f4092a90f917 lib/codeql/swift/elements/expr/CopyExpr.qll ff680438de3b2105d4fd69f48879eaa954436e63809b045f766d50454436f88a 1e0781d35da6d31bdd66110e3ce4d5dce46cf7b9e4b285ed5f544c8d40945639 lib/codeql/swift/elements/expr/CovariantFunctionConversionExpr.qll 4acc70bae3a6d31798a505be6604e1bee00770b7d385ea44550d4c0e5db35477 d6f852d2d11a78ea7c188379ad474db8d77494e3a3621dca1b7d963e083374d3 lib/codeql/swift/elements/expr/CovariantReturnConversionExpr.qll d6856a3986eb1421c0676d046432657a52e4c77775fd7c437090cfa8ade3ee29 b8229608a404e5f310a329568a26994eca0361f0653aefdb495351fbefaa5a97 +lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll 1500722bc7ae42c524d1b1cf578befcea69bea5c7a24280af07c911dbdb31e8c 567366f4d3642e183dff1d8bfad3bea433fd6ea37b841faaaa25c21ca0654289 lib/codeql/swift/elements/expr/DeclRefExpr.qll 4d7eb8f70aa18d35cde805a310b836d702c8c9da55e9676f8db3338dc57e8034 c6136ccf37e8128640d9df423713b7646309e51c3eda5c6d2807fdb0cc0733e2 lib/codeql/swift/elements/expr/DefaultArgumentExpr.qll d655cc4c69db37dc20c477e72df9bb53e18dcc65ffefe61a1bca1854bc006210 a8af422bfdcf56ac37a322d707252ed34b08acf58608065ff3bd214137583b13 lib/codeql/swift/elements/expr/DerivedToBaseExpr.qll d42b72fe5c4a36830c9c7b6c929992fb18dabeedda448159822770256593f274 fc6240a71dbd554f8bcc86c2ad0b05f2112578223e9a180beeb0223bf9cc76be @@ -285,6 +286,8 @@ lib/codeql/swift/elements/expr/internal/CovariantFunctionConversionExprConstruct lib/codeql/swift/elements/expr/internal/CovariantFunctionConversionExprImpl.qll 499b77c2820d42739843665a7574e47e630d3afd125cb4cbb4952d7fe6fde867 fe7d197f25786e329235756a85a90faec82273e097896224bd64f8fb4a804bd9 lib/codeql/swift/elements/expr/internal/CovariantReturnConversionExprConstructor.qll 5328580363441c1d76c8ba2654448207f581bc9af4b612b78c2522dceb1accea 687f9b1a9c57f0364893df2812472de0d32e5faed37d34ca429fcea2f9fa2857 lib/codeql/swift/elements/expr/internal/CovariantReturnConversionExprImpl.qll 750189e344195f715d09e93e772d5cf3a611a6d1895b7e4a88db4abfe0a5dc8a 8f646de70cb489f46bcc295e4b4a3bd7b8f03e3691c444c1f80b34453b65274c +lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll 153c80058a025e57375acb36938a44aa0b959772e2864e83e4fb48e9aacf63d2 bea25c65c5a16be09765ab7fe9db37190c18f778878a16cbec92c47f9d25159d +lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll 56b1efc50878f99474c7e5dc5525d7ba98f857112b5fe29926feb2f112d4416c efde63d7e72635f8027b04990eb40bf494fc14215e6ab08316c73b6caa0e49fb lib/codeql/swift/elements/expr/internal/DeclRefExprConstructor.qll 70bd400520a0c5f29494c320184468d36075cf24feb1f6393fc430b47a2cd336 0d3419d85b0a62cc3c8f0f0cb3a4e9a09d250f2e8b99fb11b96e18f584f817a7 lib/codeql/swift/elements/expr/internal/DefaultArgumentExprConstructor.qll 31f4def20cb3b60b48eae9b24022f853dc490c2282368fbd8f89e2c689963f86 45dd0dc08a1c4729178b80c4027ad98cba5258ea31e11f0936a8fa9bde8d3b3b lib/codeql/swift/elements/expr/internal/DerivedToBaseExprConstructor.qll d258b88fff4f115e9b4c7ef4cb26623787732cf0d7cf9b59da273d8ebcdb9460 a0a3615be242c3b52624423d685bea3b1f57ebedb2dba51059acc33e2da49844 @@ -695,7 +698,7 @@ lib/codeql/swift/elements/type/internal/UnresolvedTypeImpl.qll ee1499dd568753898 lib/codeql/swift/elements/type/internal/VariadicSequenceTypeConstructor.qll fc74a5a2a2effa28ef24509b20ee4373d97cf6e8c71840121bb031c6adedf584 c9b2effc1d01c13c5e6a74a111122fa79a2f6554dda3cb016d68ba397e566ec4 lib/codeql/swift/elements/type/internal/WeakStorageTypeConstructor.qll 5fdce3716aba6318522174a2c455a63480970222ae81c732fb19c6dd3ae2d271 60ea79d6943e129deba0deccb566cf9d73f78398b0f7f0212674d91287d6b2ae lib/codeql/swift/elements/type/internal/WeakStorageTypeImpl.qll 74f79b458f3204ec2519bd654de21bc4fb6b76816bd8ca01990fe897563a1383 34e1810f74cecda5b580ed050438ae1d914b97a36b8f4e2de1c25254c0cac633 -lib/codeql/swift/elements.qll 0853da5629624f0be83b603afa04e2280d4feb65f4c1c764ff21d979342f91d4 0853da5629624f0be83b603afa04e2280d4feb65f4c1c764ff21d979342f91d4 +lib/codeql/swift/elements.qll 913ca9d6eda0972ab2e1922c40cc5f3519bcdfc36db70873b4802822852eac44 913ca9d6eda0972ab2e1922c40cc5f3519bcdfc36db70873b4802822852eac44 lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99 lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119 @@ -712,12 +715,12 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f -lib/codeql/swift/generated/ParentChild.qll b83a0abc72324c099409e5136f50b9da12cbc27129b7679cc66138d796eddcf7 28cef184087887409504bcab8a7b381982fdafbc4b12e7b90236620b83693dc9 +lib/codeql/swift/generated/ParentChild.qll 6208de45f7dbf7713f91c710c6bcca1e14800cb025bdc054ea21df5f23ad9075 c6450faaf5d027fd3f43372588b893855cc72d61eab1a6efa7d9266c00a84aa2 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 6718c8cfed48ea863eea4e112502de92dc369139a9496c61124ac608ac25f8ac 03a7ee490b51fe328eca447a5042ba6ade0c468faf10971a5793b530b5619953 -lib/codeql/swift/generated/Synth.qll faa969292c3db59606356e0343ce36c99f53d545bbbe33103ce1de0b8d532d1f 29850fc05a0c8ba89391ec9469b4e75e2a98d523e0d53b0426ef46cb942c02ae -lib/codeql/swift/generated/SynthConstructors.qll 73ed3d8d2b059c705c6887a373fb40ce2d66d176dde4d573f099d7e5dbcf4f74 73ed3d8d2b059c705c6887a373fb40ce2d66d176dde4d573f099d7e5dbcf4f74 +lib/codeql/swift/generated/Raw.qll 855cacf92f587700c5408b9e17bb360dbcc57656d936148d96a3d4f747593e47 13fde0d5c2644691d6e89f9b62d528a0bdc01c32e1990769c53b65fb4b87526e +lib/codeql/swift/generated/Synth.qll 96e48b93040580edb77d94f1c3b5974899808d507fab2f3c2eab0d50367a3d3f 7e6b50a342e45cb8b3ed53150dbcdb75be07264885fde15d19fd98ae61d1ba05 +lib/codeql/swift/generated/SynthConstructors.qll 6367ac382b6516cdf793922702acd6187c7e873eac9f4c215955a67825ab6bf4 6367ac382b6516cdf793922702acd6187c7e873eac9f4c215955a67825ab6bf4 lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022 @@ -797,6 +800,7 @@ lib/codeql/swift/generated/expr/ConsumeExpr.qll 86c90b17fb5fded8852088703418132f lib/codeql/swift/generated/expr/CopyExpr.qll 026c323ebb0ac57814041a73b6c5933501902f744f6d2e971dbc2b39bb987be3 be20d88f5d6f8771a1d0d0af6316ccfd51994dcfaee2a2ee47cb7ef132f8e6b7 lib/codeql/swift/generated/expr/CovariantFunctionConversionExpr.qll 53f906b1ff6c3994829881098d070a92df2ee86242f7636401acfa4c8a0a1e9c 98a5f7949f02f5fc2aee38e2eed2feef677b6f2daa2d244fe790baca347a9db3 lib/codeql/swift/generated/expr/CovariantReturnConversionExpr.qll 68bf0f1a97f6a1bd2a99c60fa09d930cbd427679bbe0f41ae4394b1ad4ba126d c1063eb981345c73b871292218b40308ee5c12babc80b5d63b337eb67628d7a9 +lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll d5d82951e4aff875c5229daec9f18a3261fb236e326234eadccd7ee5c87a83e0 c76f2fa71e422cbe2dfa39588d1dcaa4e50266fc3102a446fb76386f198601ee lib/codeql/swift/generated/expr/DeclRefExpr.qll 9a696dc79181a2ebe76e2ad47edc27baac49a9c8ed38e164e5c8c61a81c23865 adcde2929271268d08550848d8c04911aec790af10609e387ea07e80bee0de6f lib/codeql/swift/generated/expr/DefaultArgumentExpr.qll a9bd89e69f35b04932a89be8099cdb0a4ce65df579d3b88d4cf6f5c328b9f327 16d22db992c2fae4abec569e10be32526883610eea7f90f19c73297168fa63fb lib/codeql/swift/generated/expr/DerivedToBaseExpr.qll 2b744875e4d12988992222cec5e5c16d65b98dca45a375c436ac5811dff4c19f 536407ce6e380d80bf8fd9d16498a773fba828cf7fa2d43f88a7ec38312f953f diff --git a/swift/ql/.gitattributes b/swift/ql/.gitattributes index 45bfde2b5a86..66bb4123005b 100644 --- a/swift/ql/.gitattributes +++ b/swift/ql/.gitattributes @@ -145,6 +145,7 @@ /lib/codeql/swift/elements/expr/CopyExpr.qll linguist-generated /lib/codeql/swift/elements/expr/CovariantFunctionConversionExpr.qll linguist-generated /lib/codeql/swift/elements/expr/CovariantReturnConversionExpr.qll linguist-generated +/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll linguist-generated /lib/codeql/swift/elements/expr/DeclRefExpr.qll linguist-generated /lib/codeql/swift/elements/expr/DefaultArgumentExpr.qll linguist-generated /lib/codeql/swift/elements/expr/DerivedToBaseExpr.qll linguist-generated @@ -287,6 +288,8 @@ /lib/codeql/swift/elements/expr/internal/CovariantFunctionConversionExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/CovariantReturnConversionExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/CovariantReturnConversionExprImpl.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/DeclRefExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/DefaultArgumentExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/DerivedToBaseExprConstructor.qll linguist-generated @@ -799,6 +802,7 @@ /lib/codeql/swift/generated/expr/CopyExpr.qll linguist-generated /lib/codeql/swift/generated/expr/CovariantFunctionConversionExpr.qll linguist-generated /lib/codeql/swift/generated/expr/CovariantReturnConversionExpr.qll linguist-generated +/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll linguist-generated /lib/codeql/swift/generated/expr/DeclRefExpr.qll linguist-generated /lib/codeql/swift/generated/expr/DefaultArgumentExpr.qll linguist-generated /lib/codeql/swift/generated/expr/DerivedToBaseExpr.qll linguist-generated diff --git a/swift/ql/lib/codeql/swift/elements.qll b/swift/ql/lib/codeql/swift/elements.qll index 3e2080262d11..5db89ec95773 100644 --- a/swift/ql/lib/codeql/swift/elements.qll +++ b/swift/ql/lib/codeql/swift/elements.qll @@ -98,6 +98,7 @@ import codeql.swift.elements.expr.ConsumeExpr import codeql.swift.elements.expr.CopyExpr import codeql.swift.elements.expr.CovariantFunctionConversionExpr import codeql.swift.elements.expr.CovariantReturnConversionExpr +import codeql.swift.elements.expr.CurrentContextIsolationExpr import codeql.swift.elements.expr.DeclRefExpr import codeql.swift.elements.expr.DefaultArgumentExpr import codeql.swift.elements.expr.DerivedToBaseExpr diff --git a/swift/ql/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll b/swift/ql/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll new file mode 100644 index 000000000000..09bfc59e362a --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the public class `CurrentContextIsolationExpr`. + */ + +private import internal.CurrentContextIsolationExprImpl +import codeql.swift.elements.expr.Expr + +/** + * An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + * This is synthesized by the type checker and does not have any way to be expressed explicitly in + * the source. + */ +final class CurrentContextIsolationExpr = Impl::CurrentContextIsolationExpr; diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll new file mode 100644 index 000000000000..00e2e626e150 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `CurrentContextIsolationExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.Raw + +/** + * The characteristic predicate of `CurrentContextIsolationExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructCurrentContextIsolationExpr(Raw::CurrentContextIsolationExpr id) { any() } diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll new file mode 100644 index 000000000000..8c4b71eb04f9 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll @@ -0,0 +1,21 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `CurrentContextIsolationExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.expr.CurrentContextIsolationExpr + +/** + * INTERNAL: This module contains the customizable definition of `CurrentContextIsolationExpr` and should not + * be referenced directly. + */ +module Impl { + /** + * An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + * This is synthesized by the type checker and does not have any way to be expressed explicitly in + * the source. + */ + class CurrentContextIsolationExpr extends Generated::CurrentContextIsolationExpr { } +} diff --git a/swift/ql/lib/codeql/swift/generated/ParentChild.qll b/swift/ql/lib/codeql/swift/generated/ParentChild.qll index 083c31f67ac2..2e0b69ca8e0c 100644 --- a/swift/ql/lib/codeql/swift/generated/ParentChild.qll +++ b/swift/ql/lib/codeql/swift/generated/ParentChild.qll @@ -1267,6 +1267,21 @@ private module Impl { ) } + private Element getImmediateChildOfCurrentContextIsolationExpr( + CurrentContextIsolationExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bExpr, int n | + b = 0 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + n = bExpr and + ( + none() + or + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + ) + ) + } + private Element getImmediateChildOfDeclRefExpr( DeclRefExpr e, int index, string partialPredicateCall ) { @@ -5244,6 +5259,8 @@ private module Impl { or result = getImmediateChildOfCopyExpr(e, index, partialAccessor) or + result = getImmediateChildOfCurrentContextIsolationExpr(e, index, partialAccessor) + or result = getImmediateChildOfDeclRefExpr(e, index, partialAccessor) or result = getImmediateChildOfDefaultArgumentExpr(e, index, partialAccessor) diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index f7c919ded6d2..a28175b1e749 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -1215,6 +1215,21 @@ module Raw { Expr getSubExpr() { copy_exprs(this, result) } } + /** + * INTERNAL: Do not use. + * An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + * This is synthesized by the type checker and does not have any way to be expressed explicitly in + * the source. + */ + class CurrentContextIsolationExpr extends @current_context_isolation_expr, Expr { + override string toString() { result = "CurrentContextIsolationExpr" } + + /** + * Gets the actor of this current context isolation expression. + */ + Expr getActor() { current_context_isolation_exprs(this, result) } + } + /** * INTERNAL: Do not use. */ diff --git a/swift/ql/lib/codeql/swift/generated/Synth.qll b/swift/ql/lib/codeql/swift/generated/Synth.qll index f8cb4713f2af..9e34c7785128 100644 --- a/swift/ql/lib/codeql/swift/generated/Synth.qll +++ b/swift/ql/lib/codeql/swift/generated/Synth.qll @@ -310,6 +310,12 @@ module Synth { TCovariantReturnConversionExpr(Raw::CovariantReturnConversionExpr id) { constructCovariantReturnConversionExpr(id) } or + /** + * INTERNAL: Do not use. + */ + TCurrentContextIsolationExpr(Raw::CurrentContextIsolationExpr id) { + constructCurrentContextIsolationExpr(id) + } or /** * INTERNAL: Do not use. */ @@ -1236,15 +1242,15 @@ module Synth { class TExpr = TAnyTryExpr or TAppliedPropertyWrapperExpr or TApplyExpr or TAssignExpr or TBindOptionalExpr or TCaptureListExpr or TClosureExpr or TCollectionExpr or TConsumeExpr or TCopyExpr or - TDeclRefExpr or TDefaultArgumentExpr or TDiscardAssignmentExpr or - TDotSyntaxBaseIgnoredExpr or TDynamicTypeExpr or TEnumIsCaseExpr or TErrorExpr or - TExplicitCastExpr or TExtractFunctionIsolationExpr or TForceValueExpr or TIdentityExpr or - TIfExpr or TImplicitConversionExpr or TInOutExpr or TKeyPathApplicationExpr or - TKeyPathDotExpr or TKeyPathExpr or TLazyInitializationExpr or TLiteralExpr or TLookupExpr or - TMakeTemporarilyEscapableExpr or TMaterializePackExpr or TObjCSelectorExpr or TOneWayExpr or - TOpaqueValueExpr or TOpenExistentialExpr or TOptionalEvaluationExpr or - TOtherInitializerRefExpr or TOverloadedDeclRefExpr or TPackElementExpr or - TPackExpansionExpr or TPropertyWrapperValuePlaceholderExpr or + TCurrentContextIsolationExpr or TDeclRefExpr or TDefaultArgumentExpr or + TDiscardAssignmentExpr or TDotSyntaxBaseIgnoredExpr or TDynamicTypeExpr or + TEnumIsCaseExpr or TErrorExpr or TExplicitCastExpr or TExtractFunctionIsolationExpr or + TForceValueExpr or TIdentityExpr or TIfExpr or TImplicitConversionExpr or TInOutExpr or + TKeyPathApplicationExpr or TKeyPathDotExpr or TKeyPathExpr or TLazyInitializationExpr or + TLiteralExpr or TLookupExpr or TMakeTemporarilyEscapableExpr or TMaterializePackExpr or + TObjCSelectorExpr or TOneWayExpr or TOpaqueValueExpr or TOpenExistentialExpr or + TOptionalEvaluationExpr or TOtherInitializerRefExpr or TOverloadedDeclRefExpr or + TPackElementExpr or TPackExpansionExpr or TPropertyWrapperValuePlaceholderExpr or TRebindSelfInInitializerExpr or TSequenceExpr or TSingleValueStmtExpr or TSuperRefExpr or TTapExpr or TTupleElementExpr or TTupleExpr or TTypeExpr or TUnresolvedDeclRefExpr or TUnresolvedDotExpr or TUnresolvedMemberExpr or TUnresolvedPatternExpr or @@ -1884,6 +1890,14 @@ module Synth { result = TCovariantReturnConversionExpr(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TCurrentContextIsolationExpr`, if possible. + */ + TCurrentContextIsolationExpr convertCurrentContextIsolationExprFromRaw(Raw::Element e) { + result = TCurrentContextIsolationExpr(e) + } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TDeclRefExpr`, if possible. @@ -3543,6 +3557,8 @@ module Synth { or result = convertCopyExprFromRaw(e) or + result = convertCurrentContextIsolationExprFromRaw(e) + or result = convertDeclRefExprFromRaw(e) or result = convertDefaultArgumentExprFromRaw(e) @@ -4566,6 +4582,14 @@ module Synth { e = TCovariantReturnConversionExpr(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TCurrentContextIsolationExpr` to a raw DB element, if possible. + */ + Raw::Element convertCurrentContextIsolationExprToRaw(TCurrentContextIsolationExpr e) { + e = TCurrentContextIsolationExpr(result) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TDeclRefExpr` to a raw DB element, if possible. @@ -6223,6 +6247,8 @@ module Synth { or result = convertCopyExprToRaw(e) or + result = convertCurrentContextIsolationExprToRaw(e) + or result = convertDeclRefExprToRaw(e) or result = convertDefaultArgumentExprToRaw(e) diff --git a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll index 259453b63f6e..635e9cbb5bb1 100644 --- a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll +++ b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll @@ -71,6 +71,7 @@ import codeql.swift.elements.expr.internal.ConsumeExprConstructor import codeql.swift.elements.expr.internal.CopyExprConstructor import codeql.swift.elements.expr.internal.CovariantFunctionConversionExprConstructor import codeql.swift.elements.expr.internal.CovariantReturnConversionExprConstructor +import codeql.swift.elements.expr.internal.CurrentContextIsolationExprConstructor import codeql.swift.elements.expr.internal.DeclRefExprConstructor import codeql.swift.elements.expr.internal.DefaultArgumentExprConstructor import codeql.swift.elements.expr.internal.DerivedToBaseExprConstructor diff --git a/swift/ql/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll new file mode 100644 index 000000000000..32a895355436 --- /dev/null +++ b/swift/ql/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll @@ -0,0 +1,50 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the generated definition of `CurrentContextIsolationExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.swift.generated.Synth +private import codeql.swift.generated.Raw +import codeql.swift.elements.expr.Expr +import codeql.swift.elements.expr.internal.ExprImpl::Impl as ExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `CurrentContextIsolationExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + * This is synthesized by the type checker and does not have any way to be expressed explicitly in + * the source. + * INTERNAL: Do not reference the `Generated::CurrentContextIsolationExpr` class directly. + * Use the subclass `CurrentContextIsolationExpr`, where the following predicates are available. + */ + class CurrentContextIsolationExpr extends Synth::TCurrentContextIsolationExpr, ExprImpl::Expr { + override string getAPrimaryQlClass() { result = "CurrentContextIsolationExpr" } + + /** + * Gets the actor of this current context isolation expression. + * + * This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the + * behavior of both the `Immediate` and non-`Immediate` versions. + */ + Expr getImmediateActor() { + result = + Synth::convertExprFromRaw(Synth::convertCurrentContextIsolationExprToRaw(this) + .(Raw::CurrentContextIsolationExpr) + .getActor()) + } + + /** + * Gets the actor of this current context isolation expression. + */ + final Expr getActor() { + exists(Expr immediate | + immediate = this.getImmediateActor() and + if exists(this.getResolveStep()) then result = immediate else result = immediate.resolve() + ) + } + } +} diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 80ba4a9a1045..0928a72ec712 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -778,6 +778,7 @@ arguments( //dir=expr | @collection_expr | @consume_expr | @copy_expr +| @current_context_isolation_expr | @decl_ref_expr | @default_argument_expr | @discard_assignment_expr @@ -915,6 +916,11 @@ copy_exprs( //dir=expr int sub_expr: @expr_or_none ref ); +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + decl_ref_exprs( //dir=expr unique int id: @decl_ref_expr, int decl: @decl_or_none ref diff --git a/swift/schema.py b/swift/schema.py index 59660fd4031a..9a777f6c7c7e 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1440,3 +1440,13 @@ class ExtractFunctionIsolationExpr(Expr): ``` """ function_expr: Expr | child + + +@qltest.skip +class CurrentContextIsolationExpr(Expr): + """ + An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + This is synthesized by the type checker and does not have any way to be expressed explicitly in + the source. + """ + actor: Expr From b575c894638ca2eff26b509796ebc57c852ab0a9 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 09:50:37 +0200 Subject: [PATCH 069/240] Swift: add `CurrentContextIsolationTree` to control flow --- .../swift/controlflow/internal/ControlFlowGraphImpl.qll | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll b/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll index 601e0eb0ad38..3d2b33e88906 100644 --- a/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll +++ b/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll @@ -1875,6 +1875,15 @@ module Exprs { } } + private class CurrentContextIsolationTree extends AstStandardPostOrderTree { + override CurrentContextIsolationExpr ast; + + final override ControlFlowElement getChildNode(int i) { + i = 0 and + result.asAstNode() = ast.getActor().getFullyConverted() + } + } + module Conversions { class ConversionOrIdentity = Synth::TIdentityExpr or Synth::TExplicitCastExpr or Synth::TImplicitConversionExpr or From ad0f9f1e7347130a852eba90e14225370314db9c Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 10:06:31 +0200 Subject: [PATCH 070/240] Swift: mark `ErrorUnionType` as type-check only --- swift/extractor/infra/SwiftTagTraits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index 006c649fad5a..0c79134a978f 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -335,7 +335,7 @@ MAP(swift::TypeBase, TypeTag) MAP(swift::PackExpansionType, PackExpansionTypeTag) MAP(swift::PackElementType, PackElementTypeTag) MAP(swift::TypeVariableType, void) // created during type checking and only used for constraint checking - MAP(swift::ErrorUnionType, void) // TODO swift 6.0 + MAP(swift::ErrorUnionType, void) // created during type checking and only used for constraint checking MAP(swift::SugarType, SugarTypeTag) MAP(swift::ParenType, ParenTypeTag) MAP(swift::TypeAliasType, TypeAliasTypeTag) From 947354393314bdb91104850e94ff98bbac5bfb25 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 10:20:00 +0200 Subject: [PATCH 071/240] Swift: extract `ActorIsolationErasureExpr` --- swift/extractor/infra/SwiftTagTraits.h | 2 +- swift/ql/.generated.list | 14 +++++---- swift/ql/.gitattributes | 4 +++ swift/ql/lib/codeql/swift/elements.qll | 1 + .../expr/ActorIsolationErasureExpr.qll | 13 ++++++++ .../ActorIsolationErasureExprConstructor.qll | 14 +++++++++ .../ActorIsolationErasureExprImpl.qll | 20 +++++++++++++ .../codeql/swift/generated/ParentChild.qll | 19 ++++++++++++ swift/ql/lib/codeql/swift/generated/Raw.qll | 9 ++++++ swift/ql/lib/codeql/swift/generated/Synth.qll | 30 +++++++++++++++++-- .../swift/generated/SynthConstructors.qll | 1 + .../expr/ActorIsolationErasureExpr.qll | 27 +++++++++++++++++ swift/ql/lib/swift.dbscheme | 5 ++++ swift/schema.py | 7 +++++ 14 files changed, 158 insertions(+), 8 deletions(-) create mode 100644 swift/ql/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll create mode 100644 swift/ql/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index 0c79134a978f..d1f4c4c915c8 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -175,7 +175,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::LinearFunctionExtractOriginalExpr, LinearFunctionExtractOriginalExprTag) MAP(swift::LinearToDifferentiableFunctionExpr, LinearToDifferentiableFunctionExprTag) MAP(swift::ABISafeConversionExpr, AbiSafeConversionExprTag) // different acronym convention - MAP(swift::ActorIsolationErasureExpr, void) // TODO swift 6.0 + MAP(swift::ActorIsolationErasureExpr, ActorIsolationErasureExprTag) MAP(swift::UnreachableExpr, void) // TODO swift 6.0 MAP(swift::ExplicitCastExpr, ExplicitCastExprTag) MAP(swift::CheckedCastExpr, CheckedCastExprTag) diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 8dd1a1ba407e..14134c8c89aa 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -111,6 +111,7 @@ lib/codeql/swift/elements/decl/internal/SubscriptDeclConstructor.qll 67882596f38 lib/codeql/swift/elements/decl/internal/TopLevelCodeDeclConstructor.qll 3924b6e5bee007fd62ae4b2352e38ae20292dbdab65fd1724ca9cd698bfc88f4 28ac8627c75cd787e6dca1a8bfed4c36edbfd13cdad19a08905a49d56b815ad7 lib/codeql/swift/elements/decl/internal/TypeAliasDeclConstructor.qll 1dc3d7ef11adf5fb9b4be1c824b8a49393137071584ed44224a2f47b3a0b8a4a 2e1e8222b851376b0d7843a93fb6affeac7f8ee52867623b1e2fa99c1ac37dbb lib/codeql/swift/elements/expr/AbiSafeConversionExpr.qll 62c6b231898c42a7756cae20ed9b3818958872cb581cca6f1db0b28e4cff9b93 b90f7496229e76a40ac66e8a3d0ac2f14c65d729ebeea796cb34f395f2858b32 +lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll bbbc615255877e7fd95199710449fa696d68d81a4cfb985240d0cfbf124d9d37 526e7b4f2b5af5f2c8172b5d2c76c1f7198025e02c9e1068f92fa6c78cddeb81 lib/codeql/swift/elements/expr/AnyHashableErasureExpr.qll 3388c1ad2c9d984fb0a0368ef9090f03cc5bbd63088024308a056cabfb9c93c9 49e3450180b8a4626911fc83bd64d17e486fad6b50f33b55b9322faef1ced39f lib/codeql/swift/elements/expr/AnyTryExpr.qll 1edad5f25c3e36412e4d93b3a5f6d1886670c353837c7bd9477351136ea4d743 58f5a8d11b5b5aea41cc5c513e2f594bc418e979f27aa0a44ddc3340aba50f95 lib/codeql/swift/elements/expr/AppliedPropertyWrapperExpr.qll 83c08f24e715393c8e9a9434ab53556f38965a750ee1c8b145df03435e8bf41c ad70842a93f26d70b1a9400039c4446b75302a3005e3b44905cefd44c57c46af @@ -241,6 +242,8 @@ lib/codeql/swift/elements/expr/UnresolvedTypeConversionExpr.qll e259a187d70ea6b6 lib/codeql/swift/elements/expr/VarargExpansionExpr.qll c7d7574caaac88fd73e69e82a84ca924e078eece0fd85a476b4a831e23b425f9 27213c88f864b7f8fd73edf8951e04a5ae7a57140a387df7c03dc1544ced723b lib/codeql/swift/elements/expr/internal/AbiSafeConversionExprConstructor.qll de9d2daf68b754e783374d017116606c8cd0710dbf8989d3606939e977dc672c 63c5ddb9da56da2c9637d7a0a6d9d069f745b4c095b07c9494a0b3a7e11be95b lib/codeql/swift/elements/expr/internal/AbiSafeConversionExprImpl.qll 6b2c51a5a5dd17044c6f5510048a9a2187aac9d35a70541faa9400406e35bc1e 448c23eec2ef44bd90e6c1636e3e881ca3447198eb68b8261412f42c4995b766 +lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll da71e5e88434f620484b792075c4966758721b46a20834c296ae77be587a8952 aafac69f37c3fd8b7d0973ca616bba30833b00d64639c3d6b7fb2e86d212406d +lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll e9b2498761c33cd765566978dbb789637e04549bdb967a1948cb6518435bfa7b 3d7b115e8d40fe1ab1fe7375493d991e51b4689b8565dde4beb6181ce7ea44ba lib/codeql/swift/elements/expr/internal/AnyHashableErasureExprConstructor.qll a1a1b5b5cb85202756826d5858b336fa2c06859020084695f6182dff999993ed bc9aab20cb809516512ddca305e2d107c2b2d2f5850620fe53af021145bde247 lib/codeql/swift/elements/expr/internal/AnyHashableErasureExprImpl.qll c1a0516ad5176f00347f7a5187f3c521746066235eb3f3bdd6f1ec068180d9f1 cb0d36379fff2483e30e54e75d8b63dc92669e8a129c8fcb24495cfad6456cfc lib/codeql/swift/elements/expr/internal/AnyTryExprImpl.qll 8225177728e36e4cdab514d060052b7174e99146ddfeb1a0cacbaab5bcd7f7a4 074ee2100466303ee268fbe50a3c4d4f93d920b24e17e1a2c60c9f7d3e7b46c2 @@ -698,7 +701,7 @@ lib/codeql/swift/elements/type/internal/UnresolvedTypeImpl.qll ee1499dd568753898 lib/codeql/swift/elements/type/internal/VariadicSequenceTypeConstructor.qll fc74a5a2a2effa28ef24509b20ee4373d97cf6e8c71840121bb031c6adedf584 c9b2effc1d01c13c5e6a74a111122fa79a2f6554dda3cb016d68ba397e566ec4 lib/codeql/swift/elements/type/internal/WeakStorageTypeConstructor.qll 5fdce3716aba6318522174a2c455a63480970222ae81c732fb19c6dd3ae2d271 60ea79d6943e129deba0deccb566cf9d73f78398b0f7f0212674d91287d6b2ae lib/codeql/swift/elements/type/internal/WeakStorageTypeImpl.qll 74f79b458f3204ec2519bd654de21bc4fb6b76816bd8ca01990fe897563a1383 34e1810f74cecda5b580ed050438ae1d914b97a36b8f4e2de1c25254c0cac633 -lib/codeql/swift/elements.qll 913ca9d6eda0972ab2e1922c40cc5f3519bcdfc36db70873b4802822852eac44 913ca9d6eda0972ab2e1922c40cc5f3519bcdfc36db70873b4802822852eac44 +lib/codeql/swift/elements.qll 397f257159ffcad583f3944333f99406289ee2ef85c6da781d72dc52a59477e4 397f257159ffcad583f3944333f99406289ee2ef85c6da781d72dc52a59477e4 lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99 lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119 @@ -715,12 +718,12 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f -lib/codeql/swift/generated/ParentChild.qll 6208de45f7dbf7713f91c710c6bcca1e14800cb025bdc054ea21df5f23ad9075 c6450faaf5d027fd3f43372588b893855cc72d61eab1a6efa7d9266c00a84aa2 +lib/codeql/swift/generated/ParentChild.qll 2411882684c204243d9ea793ea8c9d02355e31f606ffc43cf8882e985d799c3d e7ab1c802ea38c0c048d43482852916b62df36b58e6033f87002ec362f11ea61 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 855cacf92f587700c5408b9e17bb360dbcc57656d936148d96a3d4f747593e47 13fde0d5c2644691d6e89f9b62d528a0bdc01c32e1990769c53b65fb4b87526e -lib/codeql/swift/generated/Synth.qll 96e48b93040580edb77d94f1c3b5974899808d507fab2f3c2eab0d50367a3d3f 7e6b50a342e45cb8b3ed53150dbcdb75be07264885fde15d19fd98ae61d1ba05 -lib/codeql/swift/generated/SynthConstructors.qll 6367ac382b6516cdf793922702acd6187c7e873eac9f4c215955a67825ab6bf4 6367ac382b6516cdf793922702acd6187c7e873eac9f4c215955a67825ab6bf4 +lib/codeql/swift/generated/Raw.qll 7ae3ca2a8c219aeeb7be1fb2b8f4be74ce8e6ce728bc97c259693ebd3c7bf8a5 8d0713432ec6355d9a9bd208c35e3751cee173996d9bea032796042bf39014e9 +lib/codeql/swift/generated/Synth.qll a009cd58c63421832a02bad44551350b1af97fcedd6c13e920df5f66ea30d4ad f2107a40928c833da54e5f6e4bc58d4db6a982d144c59c66e449baee3d4b5848 +lib/codeql/swift/generated/SynthConstructors.qll 4d984e2e839c082b9bc70d3b6166303d81eae9baa4cef5e072a792405a014cc8 4d984e2e839c082b9bc70d3b6166303d81eae9baa4cef5e072a792405a014cc8 lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022 @@ -768,6 +771,7 @@ lib/codeql/swift/generated/decl/TypeDecl.qll 92f74709cce7e9f0f713598d3b20b730475 lib/codeql/swift/generated/decl/ValueDecl.qll d3b9c241fd6cb1ce8274435c0242775c28c08f6a47caae01ad1ecd38897b2cd5 bc81291b1394b47972d7b75b6a767ed847f881932a7d9345d28d161a55b66bd1 lib/codeql/swift/generated/decl/VarDecl.qll 8978a73fa2d7a9f952b68a2638788eda857e62502311a33fa6de1dad49a6cb1c b8b6c8cf6773056c3a90494754b0a257dcae494c03d933f138ece7f531fb9158 lib/codeql/swift/generated/expr/AbiSafeConversionExpr.qll 9d8f0f895a5e1abb89bed9671a9b398e48eca4664eb10b4b41263eb2a29bb2cf 4f65b8e62876664a357433f886baccaf40e4bf7e9ca7eebeb9f5d999354578f9 +lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll 0ebade7950363d63a3d0e86877174e763522ba5119253ec6b9dbf6506ab7ab6d a5a94ef22d198b7325c8dda3ca380c600f4f0147534fc1b12e57fd19e4e63961 lib/codeql/swift/generated/expr/AnyHashableErasureExpr.qll e9040afb7bf3d2d79fe931aa98f565bf1b8ad4ba56a9f2ee579e61afa7c50719 1e6e4fa2519522a117b7ca05c060f060376974a4148cbad38bb238ac432509c6 lib/codeql/swift/generated/expr/AnyTryExpr.qll 32b5df81d686959183af42c0ba30976360f3062bd6279b88d8578ac010740b24 b8a78d4e06d7160b83b31bbd033e4697f607bd6ea294f2e0dbbe96a0c665014d lib/codeql/swift/generated/expr/AppliedPropertyWrapperExpr.qll a272cddf6e161406a886a779939a88b4536eace5579ac6930f1b5f7c234c6525 1c93e30d1850fb3be09cc250f4e645b8c36878c7ea3d028bc06a3255f764605d diff --git a/swift/ql/.gitattributes b/swift/ql/.gitattributes index 66bb4123005b..b0508b65d756 100644 --- a/swift/ql/.gitattributes +++ b/swift/ql/.gitattributes @@ -113,6 +113,7 @@ /lib/codeql/swift/elements/decl/internal/TopLevelCodeDeclConstructor.qll linguist-generated /lib/codeql/swift/elements/decl/internal/TypeAliasDeclConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/AbiSafeConversionExpr.qll linguist-generated +/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll linguist-generated /lib/codeql/swift/elements/expr/AnyHashableErasureExpr.qll linguist-generated /lib/codeql/swift/elements/expr/AnyTryExpr.qll linguist-generated /lib/codeql/swift/elements/expr/AppliedPropertyWrapperExpr.qll linguist-generated @@ -243,6 +244,8 @@ /lib/codeql/swift/elements/expr/VarargExpansionExpr.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AbiSafeConversionExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AbiSafeConversionExprImpl.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AnyHashableErasureExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AnyHashableErasureExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AnyTryExprImpl.qll linguist-generated @@ -770,6 +773,7 @@ /lib/codeql/swift/generated/decl/ValueDecl.qll linguist-generated /lib/codeql/swift/generated/decl/VarDecl.qll linguist-generated /lib/codeql/swift/generated/expr/AbiSafeConversionExpr.qll linguist-generated +/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll linguist-generated /lib/codeql/swift/generated/expr/AnyHashableErasureExpr.qll linguist-generated /lib/codeql/swift/generated/expr/AnyTryExpr.qll linguist-generated /lib/codeql/swift/generated/expr/AppliedPropertyWrapperExpr.qll linguist-generated diff --git a/swift/ql/lib/codeql/swift/elements.qll b/swift/ql/lib/codeql/swift/elements.qll index 5db89ec95773..56dcd06aa13a 100644 --- a/swift/ql/lib/codeql/swift/elements.qll +++ b/swift/ql/lib/codeql/swift/elements.qll @@ -66,6 +66,7 @@ import codeql.swift.elements.decl.TypeDecl import codeql.swift.elements.decl.ValueDecl import codeql.swift.elements.decl.VarDecl import codeql.swift.elements.expr.AbiSafeConversionExpr +import codeql.swift.elements.expr.ActorIsolationErasureExpr import codeql.swift.elements.expr.AnyHashableErasureExpr import codeql.swift.elements.expr.AnyTryExpr import codeql.swift.elements.expr.AppliedPropertyWrapperExpr diff --git a/swift/ql/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll b/swift/ql/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll new file mode 100644 index 000000000000..d49275490b8e --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll @@ -0,0 +1,13 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the public class `ActorIsolationErasureExpr`. + */ + +private import internal.ActorIsolationErasureExprImpl +import codeql.swift.elements.expr.ImplicitConversionExpr + +/** + * A conversion that erases the actor isolation of an expression with `@isolated(any)` function + * type. + */ +final class ActorIsolationErasureExpr = Impl::ActorIsolationErasureExpr; diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll new file mode 100644 index 000000000000..26690bc64dea --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `ActorIsolationErasureExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.Raw + +/** + * The characteristic predicate of `ActorIsolationErasureExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructActorIsolationErasureExpr(Raw::ActorIsolationErasureExpr id) { any() } diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll new file mode 100644 index 000000000000..0cbc16f09084 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll @@ -0,0 +1,20 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `ActorIsolationErasureExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.expr.ActorIsolationErasureExpr + +/** + * INTERNAL: This module contains the customizable definition of `ActorIsolationErasureExpr` and should not + * be referenced directly. + */ +module Impl { + /** + * A conversion that erases the actor isolation of an expression with `@isolated(any)` function + * type. + */ + class ActorIsolationErasureExpr extends Generated::ActorIsolationErasureExpr { } +} diff --git a/swift/ql/lib/codeql/swift/generated/ParentChild.qll b/swift/ql/lib/codeql/swift/generated/ParentChild.qll index 2e0b69ca8e0c..859db4a32f1b 100644 --- a/swift/ql/lib/codeql/swift/generated/ParentChild.qll +++ b/swift/ql/lib/codeql/swift/generated/ParentChild.qll @@ -2148,6 +2148,23 @@ private module Impl { ) } + private Element getImmediateChildOfActorIsolationErasureExpr( + ActorIsolationErasureExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bImplicitConversionExpr, int n | + b = 0 and + bImplicitConversionExpr = + b + 1 + + max(int i | i = -1 or exists(getImmediateChildOfImplicitConversionExpr(e, i, _)) | i) and + n = bImplicitConversionExpr and + ( + none() + or + result = getImmediateChildOfImplicitConversionExpr(e, index - b, partialPredicateCall) + ) + ) + } + private Element getImmediateChildOfAnyHashableErasureExpr( AnyHashableErasureExpr e, int index, string partialPredicateCall ) { @@ -5345,6 +5362,8 @@ private module Impl { or result = getImmediateChildOfAbiSafeConversionExpr(e, index, partialAccessor) or + result = getImmediateChildOfActorIsolationErasureExpr(e, index, partialAccessor) + or result = getImmediateChildOfAnyHashableErasureExpr(e, index, partialAccessor) or result = getImmediateChildOfArchetypeToSuperExpr(e, index, partialAccessor) diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index a28175b1e749..ccd0e205555d 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -1937,6 +1937,15 @@ module Raw { override string toString() { result = "AbiSafeConversionExpr" } } + /** + * INTERNAL: Do not use. + * A conversion that erases the actor isolation of an expression with `@isolated(any)` function + * type. + */ + class ActorIsolationErasureExpr extends @actor_isolation_erasure_expr, ImplicitConversionExpr { + override string toString() { result = "ActorIsolationErasureExpr" } + } + /** * INTERNAL: Do not use. */ diff --git a/swift/ql/lib/codeql/swift/generated/Synth.qll b/swift/ql/lib/codeql/swift/generated/Synth.qll index 9e34c7785128..8e76dc24e0dd 100644 --- a/swift/ql/lib/codeql/swift/generated/Synth.qll +++ b/swift/ql/lib/codeql/swift/generated/Synth.qll @@ -192,6 +192,12 @@ module Synth { * INTERNAL: Do not use. */ TAbiSafeConversionExpr(Raw::AbiSafeConversionExpr id) { constructAbiSafeConversionExpr(id) } or + /** + * INTERNAL: Do not use. + */ + TActorIsolationErasureExpr(Raw::ActorIsolationErasureExpr id) { + constructActorIsolationErasureExpr(id) + } or /** * INTERNAL: Do not use. */ @@ -1266,8 +1272,8 @@ module Synth { * INTERNAL: Do not use. */ class TImplicitConversionExpr = - TAbiSafeConversionExpr or TAnyHashableErasureExpr or TArchetypeToSuperExpr or - TArrayToPointerExpr or TBridgeFromObjCExpr or TBridgeToObjCExpr or + TAbiSafeConversionExpr or TActorIsolationErasureExpr or TAnyHashableErasureExpr or + TArchetypeToSuperExpr or TArrayToPointerExpr or TBridgeFromObjCExpr or TBridgeToObjCExpr or TClassMetatypeToObjectExpr or TCollectionUpcastConversionExpr or TConditionalBridgeFromObjCExpr or TCovariantFunctionConversionExpr or TCovariantReturnConversionExpr or TDerivedToBaseExpr or TDestructureTupleExpr or @@ -1710,6 +1716,14 @@ module Synth { result = TAbiSafeConversionExpr(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TActorIsolationErasureExpr`, if possible. + */ + TActorIsolationErasureExpr convertActorIsolationErasureExprFromRaw(Raw::Element e) { + result = TActorIsolationErasureExpr(e) + } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TAnyHashableErasureExpr`, if possible. @@ -3675,6 +3689,8 @@ module Synth { TImplicitConversionExpr convertImplicitConversionExprFromRaw(Raw::Element e) { result = convertAbiSafeConversionExprFromRaw(e) or + result = convertActorIsolationErasureExprFromRaw(e) + or result = convertAnyHashableErasureExprFromRaw(e) or result = convertArchetypeToSuperExprFromRaw(e) @@ -4402,6 +4418,14 @@ module Synth { e = TAbiSafeConversionExpr(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TActorIsolationErasureExpr` to a raw DB element, if possible. + */ + Raw::Element convertActorIsolationErasureExprToRaw(TActorIsolationErasureExpr e) { + e = TActorIsolationErasureExpr(result) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TAnyHashableErasureExpr` to a raw DB element, if possible. @@ -6365,6 +6389,8 @@ module Synth { Raw::Element convertImplicitConversionExprToRaw(TImplicitConversionExpr e) { result = convertAbiSafeConversionExprToRaw(e) or + result = convertActorIsolationErasureExprToRaw(e) + or result = convertAnyHashableErasureExprToRaw(e) or result = convertArchetypeToSuperExprToRaw(e) diff --git a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll index 635e9cbb5bb1..27c0949bce99 100644 --- a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll +++ b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll @@ -45,6 +45,7 @@ import codeql.swift.elements.decl.internal.SubscriptDeclConstructor import codeql.swift.elements.decl.internal.TopLevelCodeDeclConstructor import codeql.swift.elements.decl.internal.TypeAliasDeclConstructor import codeql.swift.elements.expr.internal.AbiSafeConversionExprConstructor +import codeql.swift.elements.expr.internal.ActorIsolationErasureExprConstructor import codeql.swift.elements.expr.internal.AnyHashableErasureExprConstructor import codeql.swift.elements.expr.internal.AppliedPropertyWrapperExprConstructor import codeql.swift.elements.expr.internal.ArchetypeToSuperExprConstructor diff --git a/swift/ql/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll new file mode 100644 index 000000000000..0811908bbabe --- /dev/null +++ b/swift/ql/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll @@ -0,0 +1,27 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the generated definition of `ActorIsolationErasureExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.swift.generated.Synth +private import codeql.swift.generated.Raw +import codeql.swift.elements.expr.internal.ImplicitConversionExprImpl::Impl as ImplicitConversionExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `ActorIsolationErasureExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * A conversion that erases the actor isolation of an expression with `@isolated(any)` function + * type. + * INTERNAL: Do not reference the `Generated::ActorIsolationErasureExpr` class directly. + * Use the subclass `ActorIsolationErasureExpr`, where the following predicates are available. + */ + class ActorIsolationErasureExpr extends Synth::TActorIsolationErasureExpr, + ImplicitConversionExprImpl::ImplicitConversionExpr + { + override string getAPrimaryQlClass() { result = "ActorIsolationErasureExpr" } + } +} diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 0928a72ec712..3a26c579e525 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -1034,6 +1034,7 @@ if_exprs( //dir=expr @implicit_conversion_expr = @abi_safe_conversion_expr +| @actor_isolation_erasure_expr | @any_hashable_erasure_expr | @archetype_to_super_expr | @array_to_pointer_expr @@ -1318,6 +1319,10 @@ abi_safe_conversion_exprs( //dir=expr unique int id: @abi_safe_conversion_expr ); +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + any_hashable_erasure_exprs( //dir=expr unique int id: @any_hashable_erasure_expr ); diff --git a/swift/schema.py b/swift/schema.py index 9a777f6c7c7e..0fb770406e39 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1450,3 +1450,10 @@ class CurrentContextIsolationExpr(Expr): the source. """ actor: Expr + + +class ActorIsolationErasureExpr(ImplicitConversionExpr): + """ + A conversion that erases the actor isolation of an expression with `@isolated(any)` function + type. + """ From fa6deaf87a4fd41813348a2539e02517fb23ab62 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 10:34:53 +0200 Subject: [PATCH 072/240] Swift: extract `UnreachableExpr` --- swift/extractor/infra/SwiftTagTraits.h | 2 +- swift/ql/.generated.list | 14 ++++++---- swift/ql/.gitattributes | 4 +++ swift/ql/lib/codeql/swift/elements.qll | 1 + .../swift/elements/expr/UnreachableExpr.qll | 12 +++++++++ .../internal/UnreachableExprConstructor.qll | 14 ++++++++++ .../expr/internal/UnreachableExprImpl.qll | 19 ++++++++++++++ .../codeql/swift/generated/ParentChild.qll | 19 ++++++++++++++ swift/ql/lib/codeql/swift/generated/Raw.qll | 8 ++++++ swift/ql/lib/codeql/swift/generated/Synth.qll | 23 +++++++++++++++- .../swift/generated/SynthConstructors.qll | 1 + .../swift/generated/expr/UnreachableExpr.qll | 26 +++++++++++++++++++ swift/ql/lib/swift.dbscheme | 5 ++++ swift/schema.py | 6 +++++ 14 files changed, 147 insertions(+), 7 deletions(-) create mode 100644 swift/ql/lib/codeql/swift/elements/expr/UnreachableExpr.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll create mode 100644 swift/ql/lib/codeql/swift/generated/expr/UnreachableExpr.qll diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index d1f4c4c915c8..6c7e2309e840 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -176,7 +176,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::LinearToDifferentiableFunctionExpr, LinearToDifferentiableFunctionExprTag) MAP(swift::ABISafeConversionExpr, AbiSafeConversionExprTag) // different acronym convention MAP(swift::ActorIsolationErasureExpr, ActorIsolationErasureExprTag) - MAP(swift::UnreachableExpr, void) // TODO swift 6.0 + MAP(swift::UnreachableExpr, UnreachableExprTag) MAP(swift::ExplicitCastExpr, ExplicitCastExprTag) MAP(swift::CheckedCastExpr, CheckedCastExprTag) MAP(swift::ForcedCheckedCastExpr, ForcedCheckedCastExprTag) diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 14134c8c89aa..61bc11662f52 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -232,6 +232,7 @@ lib/codeql/swift/elements/expr/TupleExpr.qll 11efe0f2737b561a392bbd684c7c1cc2e29 lib/codeql/swift/elements/expr/TypeExpr.qll c3f7272b77aadd8a4a0e5c7e3876bba6bba45343415c8ce96de26e1e898d11c0 91cd440b768e4d9aa60a165ddb62ecdcad85eb4a676ab0d60ca8777e753bffc7 lib/codeql/swift/elements/expr/UnderlyingToOpaqueExpr.qll f319daff97d13a5cacf2efcd1f2b77e58ec9b9a30413ddb30cc0333197cbef9f 9c6a97a66a452a6167b26f48b0f31a42e2c528fcd30e76c9f4dd146f6609b5d3 lib/codeql/swift/elements/expr/UnevaluatedInstanceExpr.qll 7eca15f753e81d99a275ca1d29986d5209d8ffea4034746945227fedc1b74c38 714c9a7a09f525187f53a4c9599a141a32ec6071c405c2a425dc2cfb6f2457e6 +lib/codeql/swift/elements/expr/UnreachableExpr.qll 930822d66d99422603725161f55fec7b861ef33aa8fe57afbdbea2a68a764fcb e8005f5ac66a97e614f3792e8053b0fb6d6bb1f99bc1d0f7d0d0b41e703efe9c lib/codeql/swift/elements/expr/UnresolvedDeclRefExpr.qll 356dacb2b2ece20366a2d4b809210aeedcec31b8362a204854a77a192a01c0e1 7705b39752be30ab6bff12ccc690ed3b0fd843978721558e18f5f57e65f1f688 lib/codeql/swift/elements/expr/UnresolvedDotExpr.qll 97c05188380cb890049db519d70168c3ca69c356fd15efd1ec52555519518a68 01455fb6e2c57941b209d844b65a0e6778d2d8d3db6081fb96c375c528574c41 lib/codeql/swift/elements/expr/UnresolvedMemberChainResultExpr.qll 2a5747bdd60c30b9b32552ef48a1ba94bfa4c593896d7e1ba1992403680d10af c92cfd85209a0314b99a2f8549c73eb878ab251453330298da72aa9d2208e7ac @@ -410,6 +411,8 @@ lib/codeql/swift/elements/expr/internal/UnderlyingToOpaqueExprConstructor.qll 8b lib/codeql/swift/elements/expr/internal/UnderlyingToOpaqueExprImpl.qll cf2637b44a96fce2d8e618469692305181490a28f3b2698b6f9db2d58e7c474d 9b062defb7c19e217bea6e5bd65ccf28e1ff25fb1e784405eb92406806a3349c lib/codeql/swift/elements/expr/internal/UnevaluatedInstanceExprConstructor.qll 4560f4737cb47512b8348fd2a37599227df4a05bfad84873f6666d121a524e0a b49bfdfa550330bab087c5a6b7a3885fd22360e557adf984ce7a35534d882510 lib/codeql/swift/elements/expr/internal/UnevaluatedInstanceExprImpl.qll 35107b79b01c1304167ce211e081991a2a8e05e9831da7d6523363d59a9dbb7a bc4811a0b40380b1a065f64dbd4b4f756e80cb11ee3b5c4f6ce035c5629db852 +lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll 53ff660f143f073f2675c37e2a471b79b82864051a3f5305faf33cd642904d3e 35d37b022f6c6f0b1d6483a2698c2e08f0bd545fd573edbf642815ad7d34bafd +lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll 3c305339fb8eef3b521638164290d630fc166106006a634c7ccec2198a4cb035 7ff8f246f567689305a44b04e990f31cb696ad2533dbb8c40f1cf82e3e8100ff lib/codeql/swift/elements/expr/internal/UnresolvedDeclRefExprConstructor.qll 344072439e0d95d1148d361ff764c17eaa47e5c0be82a3320cd9ab3868ac415f 25553a602da130b30e69ae9844e9be9da73ee579ba74c3bb84a9aa8e24801b46 lib/codeql/swift/elements/expr/internal/UnresolvedDotExprConstructor.qll 2945ae07a65a7262e97cb28d35b9c3a9dfee662f2af54a8d9aba5f0c49216190 297485aa44da7ce69c7e33bc3ffde66bee79615fa947159b76e6ed73d1886b25 lib/codeql/swift/elements/expr/internal/UnresolvedMemberChainResultExprConstructor.qll 1086b09aa950efd4e8ed1ce4723f6a6e6b43bbc147085375f589654f2dc04008 8adf6b2f415b69b8eb235c7e76eb5f0e5320939a0904d0b6823b28293eaa3b57 @@ -701,7 +704,7 @@ lib/codeql/swift/elements/type/internal/UnresolvedTypeImpl.qll ee1499dd568753898 lib/codeql/swift/elements/type/internal/VariadicSequenceTypeConstructor.qll fc74a5a2a2effa28ef24509b20ee4373d97cf6e8c71840121bb031c6adedf584 c9b2effc1d01c13c5e6a74a111122fa79a2f6554dda3cb016d68ba397e566ec4 lib/codeql/swift/elements/type/internal/WeakStorageTypeConstructor.qll 5fdce3716aba6318522174a2c455a63480970222ae81c732fb19c6dd3ae2d271 60ea79d6943e129deba0deccb566cf9d73f78398b0f7f0212674d91287d6b2ae lib/codeql/swift/elements/type/internal/WeakStorageTypeImpl.qll 74f79b458f3204ec2519bd654de21bc4fb6b76816bd8ca01990fe897563a1383 34e1810f74cecda5b580ed050438ae1d914b97a36b8f4e2de1c25254c0cac633 -lib/codeql/swift/elements.qll 397f257159ffcad583f3944333f99406289ee2ef85c6da781d72dc52a59477e4 397f257159ffcad583f3944333f99406289ee2ef85c6da781d72dc52a59477e4 +lib/codeql/swift/elements.qll 9648ab501b413dc327513d9ed1d6e620a9eab6096e1130dc7e78cd6a2b6b549b 9648ab501b413dc327513d9ed1d6e620a9eab6096e1130dc7e78cd6a2b6b549b lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99 lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119 @@ -718,12 +721,12 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f -lib/codeql/swift/generated/ParentChild.qll 2411882684c204243d9ea793ea8c9d02355e31f606ffc43cf8882e985d799c3d e7ab1c802ea38c0c048d43482852916b62df36b58e6033f87002ec362f11ea61 +lib/codeql/swift/generated/ParentChild.qll 7c9537f74a4c5a02622ce28c3de4b0ce02a7027d2e9aea9a860ece6a1e2ec340 49c1993b2a96df66903bffde78d63d8f4c68b2d604c419b20d88b63406366156 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 7ae3ca2a8c219aeeb7be1fb2b8f4be74ce8e6ce728bc97c259693ebd3c7bf8a5 8d0713432ec6355d9a9bd208c35e3751cee173996d9bea032796042bf39014e9 -lib/codeql/swift/generated/Synth.qll a009cd58c63421832a02bad44551350b1af97fcedd6c13e920df5f66ea30d4ad f2107a40928c833da54e5f6e4bc58d4db6a982d144c59c66e449baee3d4b5848 -lib/codeql/swift/generated/SynthConstructors.qll 4d984e2e839c082b9bc70d3b6166303d81eae9baa4cef5e072a792405a014cc8 4d984e2e839c082b9bc70d3b6166303d81eae9baa4cef5e072a792405a014cc8 +lib/codeql/swift/generated/Raw.qll 522f8500ce46d62fca22730ade5fa4716452adece25ffc36c50582b653f2fe6f 4d870e0695fff541c1a14eadc8ba51960a264ba2e6e53d0ccc32b34c7fd2cadd +lib/codeql/swift/generated/Synth.qll a14dddab40979df82d30b2d73407fe0058a803ed6e1a882cd9a6ae5ffd240526 0879d2476a42123b46eee216d4ea03523e0c04fe0b68d9a68e0046253edb1bc9 +lib/codeql/swift/generated/SynthConstructors.qll f64121911e082aa15478eb8779025cee96e97503724c02aff31741e65a894a4b f64121911e082aa15478eb8779025cee96e97503724c02aff31741e65a894a4b lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022 @@ -895,6 +898,7 @@ lib/codeql/swift/generated/expr/TupleExpr.qll 860dde65c440ffa74648c663126194182c lib/codeql/swift/generated/expr/TypeExpr.qll 1f38f463b11b9f10878dab7266f05f455a0802e6d7464d81d4c05855d41adc64 b3c3f6b61b466be86a8cc0cea18d85b7a23b1f8dcf876ef2a050ef69778df32b lib/codeql/swift/generated/expr/UnderlyingToOpaqueExpr.qll 3d68175d73056e6f5afea5040ad2f9a8447adf078c490bb06769008857ee2ca7 f0ec8f0bf7271289b8be32038e60c2b1053d6563354c8bced53a42fef6292152 lib/codeql/swift/generated/expr/UnevaluatedInstanceExpr.qll bac438970bc12eef2ace318b97d37ef58ab7a9c2c43c3f4515780f65cdc5de70 11810cdd753c744f3ee274fce889d272c3c94b6087c124cdd09e99188eb3f926 +lib/codeql/swift/generated/expr/UnreachableExpr.qll ab17ea1f01eb1b22b1012b57582b170936244c98f42374e0e21b9d468db9249c 93a2a3685a9f8d4eab06cf700bc6465915e29b49249a14fe6aa68d1af96c86ca lib/codeql/swift/generated/expr/UnresolvedDeclRefExpr.qll b6a72b3052829ac56f16b72baa7fc62926e8dde781ab9fa29b2cb7d87b5e287d df8fe19e9487c3ae83a19f38d98fd365add5b010ccab2f8699e4a2b841bb00a0 lib/codeql/swift/generated/expr/UnresolvedDotExpr.qll 78a6d4cf27b3b6012b9880cae52604c49e7300d1b02e9f7a9157705078423d7a 79ca200646616ddb17fb72112469985b18718cba676e3bd94d8bcb234627ea93 lib/codeql/swift/generated/expr/UnresolvedMemberChainResultExpr.qll 8277a5c54c868441217beab4b5f7f4bb937098611ce1e1fb098ad39f17660970 15996c1c571579db3e2ea861fa850294d916dde6ba437cabc6f18d18bcc6b785 diff --git a/swift/ql/.gitattributes b/swift/ql/.gitattributes index b0508b65d756..32c1865ff305 100644 --- a/swift/ql/.gitattributes +++ b/swift/ql/.gitattributes @@ -234,6 +234,7 @@ /lib/codeql/swift/elements/expr/TypeExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnderlyingToOpaqueExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnevaluatedInstanceExpr.qll linguist-generated +/lib/codeql/swift/elements/expr/UnreachableExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnresolvedDeclRefExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnresolvedDotExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnresolvedMemberChainResultExpr.qll linguist-generated @@ -412,6 +413,8 @@ /lib/codeql/swift/elements/expr/internal/UnderlyingToOpaqueExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnevaluatedInstanceExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnevaluatedInstanceExprImpl.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnresolvedDeclRefExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnresolvedDotExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnresolvedMemberChainResultExprConstructor.qll linguist-generated @@ -897,6 +900,7 @@ /lib/codeql/swift/generated/expr/TypeExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnderlyingToOpaqueExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnevaluatedInstanceExpr.qll linguist-generated +/lib/codeql/swift/generated/expr/UnreachableExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnresolvedDeclRefExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnresolvedDotExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnresolvedMemberChainResultExpr.qll linguist-generated diff --git a/swift/ql/lib/codeql/swift/elements.qll b/swift/ql/lib/codeql/swift/elements.qll index 56dcd06aa13a..53d630d9f197 100644 --- a/swift/ql/lib/codeql/swift/elements.qll +++ b/swift/ql/lib/codeql/swift/elements.qll @@ -187,6 +187,7 @@ import codeql.swift.elements.expr.TupleExpr import codeql.swift.elements.expr.TypeExpr import codeql.swift.elements.expr.UnderlyingToOpaqueExpr import codeql.swift.elements.expr.UnevaluatedInstanceExpr +import codeql.swift.elements.expr.UnreachableExpr import codeql.swift.elements.expr.UnresolvedDeclRefExpr import codeql.swift.elements.expr.UnresolvedDotExpr import codeql.swift.elements.expr.UnresolvedMemberChainResultExpr diff --git a/swift/ql/lib/codeql/swift/elements/expr/UnreachableExpr.qll b/swift/ql/lib/codeql/swift/elements/expr/UnreachableExpr.qll new file mode 100644 index 000000000000..23c79595be11 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/UnreachableExpr.qll @@ -0,0 +1,12 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the public class `UnreachableExpr`. + */ + +private import internal.UnreachableExprImpl +import codeql.swift.elements.expr.ImplicitConversionExpr + +/** + * A conversion from the uninhabited type to any other type. It's never evaluated. + */ +final class UnreachableExpr = Impl::UnreachableExpr; diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll new file mode 100644 index 000000000000..8689ded006ed --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `UnreachableExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.Raw + +/** + * The characteristic predicate of `UnreachableExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructUnreachableExpr(Raw::UnreachableExpr id) { any() } diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll new file mode 100644 index 000000000000..35dda80350c1 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll @@ -0,0 +1,19 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `UnreachableExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.expr.UnreachableExpr + +/** + * INTERNAL: This module contains the customizable definition of `UnreachableExpr` and should not + * be referenced directly. + */ +module Impl { + /** + * A conversion from the uninhabited type to any other type. It's never evaluated. + */ + class UnreachableExpr extends Generated::UnreachableExpr { } +} diff --git a/swift/ql/lib/codeql/swift/generated/ParentChild.qll b/swift/ql/lib/codeql/swift/generated/ParentChild.qll index 859db4a32f1b..2925620f24f0 100644 --- a/swift/ql/lib/codeql/swift/generated/ParentChild.qll +++ b/swift/ql/lib/codeql/swift/generated/ParentChild.qll @@ -3108,6 +3108,23 @@ private module Impl { ) } + private Element getImmediateChildOfUnreachableExpr( + UnreachableExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bImplicitConversionExpr, int n | + b = 0 and + bImplicitConversionExpr = + b + 1 + + max(int i | i = -1 or exists(getImmediateChildOfImplicitConversionExpr(e, i, _)) | i) and + n = bImplicitConversionExpr and + ( + none() + or + result = getImmediateChildOfImplicitConversionExpr(e, index - b, partialPredicateCall) + ) + ) + } + private Element getImmediateChildOfUnresolvedMemberChainResultExpr( UnresolvedMemberChainResultExpr e, int index, string partialPredicateCall ) { @@ -5470,6 +5487,8 @@ private module Impl { or result = getImmediateChildOfUnevaluatedInstanceExpr(e, index, partialAccessor) or + result = getImmediateChildOfUnreachableExpr(e, index, partialAccessor) + or result = getImmediateChildOfUnresolvedMemberChainResultExpr(e, index, partialAccessor) or result = getImmediateChildOfUnresolvedTypeConversionExpr(e, index, partialAccessor) diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index ccd0e205555d..2e0e08599cea 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -2462,6 +2462,14 @@ module Raw { override string toString() { result = "UnevaluatedInstanceExpr" } } + /** + * INTERNAL: Do not use. + * A conversion from the uninhabited type to any other type. It's never evaluated. + */ + class UnreachableExpr extends @unreachable_expr, ImplicitConversionExpr { + override string toString() { result = "UnreachableExpr" } + } + /** * INTERNAL: Do not use. */ diff --git a/swift/ql/lib/codeql/swift/generated/Synth.qll b/swift/ql/lib/codeql/swift/generated/Synth.qll index 8e76dc24e0dd..ce6eca080afb 100644 --- a/swift/ql/lib/codeql/swift/generated/Synth.qll +++ b/swift/ql/lib/codeql/swift/generated/Synth.qll @@ -678,6 +678,10 @@ module Synth { TUnevaluatedInstanceExpr(Raw::UnevaluatedInstanceExpr id) { constructUnevaluatedInstanceExpr(id) } or + /** + * INTERNAL: Do not use. + */ + TUnreachableExpr(Raw::UnreachableExpr id) { constructUnreachableExpr(id) } or /** * INTERNAL: Do not use. */ @@ -1283,7 +1287,8 @@ module Synth { TLinearFunctionExpr or TLinearFunctionExtractOriginalExpr or TLinearToDifferentiableFunctionExpr or TLoadExpr or TMetatypeConversionExpr or TPointerToPointerExpr or TProtocolMetatypeToObjectExpr or TStringToPointerExpr or - TUnderlyingToOpaqueExpr or TUnevaluatedInstanceExpr or TUnresolvedTypeConversionExpr; + TUnderlyingToOpaqueExpr or TUnevaluatedInstanceExpr or TUnreachableExpr or + TUnresolvedTypeConversionExpr; /** * INTERNAL: Do not use. @@ -2494,6 +2499,12 @@ module Synth { result = TUnevaluatedInstanceExpr(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TUnreachableExpr`, if possible. + */ + TUnreachableExpr convertUnreachableExprFromRaw(Raw::Element e) { result = TUnreachableExpr(e) } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TUnresolvedDeclRefExpr`, if possible. @@ -3751,6 +3762,8 @@ module Synth { or result = convertUnevaluatedInstanceExprFromRaw(e) or + result = convertUnreachableExprFromRaw(e) + or result = convertUnresolvedTypeConversionExprFromRaw(e) } @@ -5194,6 +5207,12 @@ module Synth { e = TUnevaluatedInstanceExpr(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TUnreachableExpr` to a raw DB element, if possible. + */ + Raw::Element convertUnreachableExprToRaw(TUnreachableExpr e) { e = TUnreachableExpr(result) } + /** * INTERNAL: Do not use. * Converts a synthesized `TUnresolvedDeclRefExpr` to a raw DB element, if possible. @@ -6451,6 +6470,8 @@ module Synth { or result = convertUnevaluatedInstanceExprToRaw(e) or + result = convertUnreachableExprToRaw(e) + or result = convertUnresolvedTypeConversionExprToRaw(e) } diff --git a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll index 27c0949bce99..1da3dcbc0134 100644 --- a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll +++ b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll @@ -154,6 +154,7 @@ import codeql.swift.elements.expr.internal.TupleExprConstructor import codeql.swift.elements.expr.internal.TypeExprConstructor import codeql.swift.elements.expr.internal.UnderlyingToOpaqueExprConstructor import codeql.swift.elements.expr.internal.UnevaluatedInstanceExprConstructor +import codeql.swift.elements.expr.internal.UnreachableExprConstructor import codeql.swift.elements.expr.internal.UnresolvedDeclRefExprConstructor import codeql.swift.elements.expr.internal.UnresolvedDotExprConstructor import codeql.swift.elements.expr.internal.UnresolvedMemberChainResultExprConstructor diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnreachableExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnreachableExpr.qll new file mode 100644 index 000000000000..5737d6b9172f --- /dev/null +++ b/swift/ql/lib/codeql/swift/generated/expr/UnreachableExpr.qll @@ -0,0 +1,26 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the generated definition of `UnreachableExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.swift.generated.Synth +private import codeql.swift.generated.Raw +import codeql.swift.elements.expr.internal.ImplicitConversionExprImpl::Impl as ImplicitConversionExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `UnreachableExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * A conversion from the uninhabited type to any other type. It's never evaluated. + * INTERNAL: Do not reference the `Generated::UnreachableExpr` class directly. + * Use the subclass `UnreachableExpr`, where the following predicates are available. + */ + class UnreachableExpr extends Synth::TUnreachableExpr, + ImplicitConversionExprImpl::ImplicitConversionExpr + { + override string getAPrimaryQlClass() { result = "UnreachableExpr" } + } +} diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 3a26c579e525..be2357fd0023 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -1065,6 +1065,7 @@ if_exprs( //dir=expr | @string_to_pointer_expr | @underlying_to_opaque_expr | @unevaluated_instance_expr +| @unreachable_expr | @unresolved_type_conversion_expr ; @@ -1643,6 +1644,10 @@ unevaluated_instance_exprs( //dir=expr unique int id: @unevaluated_instance_expr ); +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + unresolved_member_chain_result_exprs( //dir=expr unique int id: @unresolved_member_chain_result_expr ); diff --git a/swift/schema.py b/swift/schema.py index 0fb770406e39..d99a00c2e67d 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1457,3 +1457,9 @@ class ActorIsolationErasureExpr(ImplicitConversionExpr): A conversion that erases the actor isolation of an expression with `@isolated(any)` function type. """ + + +class UnreachableExpr(ImplicitConversionExpr): + """ + A conversion from the uninhabited type to any other type. It's never evaluated. + """ From 1316e08365900be11720b4d1150ceb7aaf86ee5d Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 10:56:52 +0200 Subject: [PATCH 073/240] Swift: add upgrade/downgrade scripts --- .../downgrade.ql | 40 + .../old.dbscheme | 2815 +++++++++++++++++ .../swift.dbscheme | 2793 ++++++++++++++++ .../upgrade.properties | 11 + .../old.dbscheme | 2793 ++++++++++++++++ .../swift.dbscheme | 2815 +++++++++++++++++ .../upgrade.properties | 2 + 7 files changed, 11269 insertions(+) create mode 100644 swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/downgrade.ql create mode 100644 swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme create mode 100644 swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme create mode 100644 swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties create mode 100644 swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/old.dbscheme create mode 100644 swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/swift.dbscheme create mode 100644 swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/upgrade.properties diff --git a/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/downgrade.ql b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/downgrade.ql new file mode 100644 index 000000000000..bab33cc0962b --- /dev/null +++ b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/downgrade.ql @@ -0,0 +1,40 @@ +class Element extends @element { + string toString() { none() } +} + +predicate removedClass(Element e, string name, Element child) { + current_context_isolation_exprs(e, child) and name = "CurrentContextIsolationExpr" + or + extract_function_isolation_exprs(e, child) and name = "ExtractFunctionIsolationExpr" + or + ( + actor_isolation_erasure_exprs(e) and name = "ActorIsolationErasureExpr" + or + unreachable_exprs(e) and name = "UnreachableExpr" + ) and + implicit_conversion_exprs(e, child) +} + +query predicate new_unspecified_elements(Element e, string property, string error) { + unspecified_elements(e, property, error) + or + exists(string name | + removedClass(e, name, _) and + property = "" and + error = name + " nodes removed during database downgrade. Please update your CodeQL code." + ) +} + +query predicate new_unspecified_element_children(Element e, int index, Element child) { + unspecified_element_children(e, index, child) + or + removedClass(e, _, child) and index = 0 +} + +query predicate new_implicit_conversion_exprs(Element e, Element child) { + implicit_conversion_exprs(e, child) and not removedClass(e, _, _) +} + +query predicate new_expr_types(Element e, Element type) { + expr_types(e, type) and not removedClass(e, _, _) +} diff --git a/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme new file mode 100644 index 000000000000..be2357fd0023 --- /dev/null +++ b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme @@ -0,0 +1,2815 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme new file mode 100644 index 000000000000..33db81ad4b60 --- /dev/null +++ b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme @@ -0,0 +1,2793 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties new file mode 100644 index 000000000000..60c3adffe850 --- /dev/null +++ b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties @@ -0,0 +1,11 @@ +description: Remove `ExtracFunctionIsolationExpr`, `CurrentContextIsolationExpr`, `ActorIsolationErasureExpr` and `UnreachableExpr`. +compatibility: backwards + +current_context_isolation_exprs.rel: delete +extract_function_isolation_exprs.rel: delete +actor_isolation_erasure_exprs.rel: delete +unreachable_exprs.rel: delete +unspecified_elements.rel: run downgrade.ql new_unspecified_elements +unspecified_element_children.rel: run downgrade.ql new_unspecified_element_children +implicit_conversion_exprs.rel: run downgrade.ql new_implicit_conversion_exprs +expr_types.rel: run downgrade.ql new_expr_types diff --git a/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/old.dbscheme b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/old.dbscheme new file mode 100644 index 000000000000..33db81ad4b60 --- /dev/null +++ b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/old.dbscheme @@ -0,0 +1,2793 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/swift.dbscheme b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/swift.dbscheme new file mode 100644 index 000000000000..be2357fd0023 --- /dev/null +++ b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/swift.dbscheme @@ -0,0 +1,2815 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/upgrade.properties b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/upgrade.properties new file mode 100644 index 000000000000..f09284fb3d45 --- /dev/null +++ b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/upgrade.properties @@ -0,0 +1,2 @@ +description: Add `ExtracFunctionIsolationExpr`, `CurrentContextIsolationExpr`, `ActorIsolationErasureExpr` and `UnreachableExpr`. +compatibility: full From cef3cd9b54e9194128c839af696fd84f0bc05a51 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 10 Apr 2025 14:58:23 +0100 Subject: [PATCH 074/240] Rust: Add tests for std::io sources. --- .../dataflow/sources/TaintSources.expected | 2 +- .../library-tests/dataflow/sources/test.rs | 149 ++++++++++++++++++ 2 files changed, 150 insertions(+), 1 deletion(-) diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index 8448ee783720..6edfbb562da0 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -22,4 +22,4 @@ | test.rs:80:24:80:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:112:35:112:46 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:119:31:119:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:203:16:203:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | +| test.rs:352:16:352:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index e4c6b2736d74..3e5e55568704 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -198,6 +198,155 @@ async fn test_hyper_http(case: i64) -> Result<(), Box> { Ok(()) } +use std::io::Read; +use std::io::BufRead; + +fn test_io_fs() -> std::io::Result<()> { + // --- stdin --- + + { + let mut buffer = [0u8; 100]; + let _bytes = std::io::stdin().read(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = Vec::::new(); + let _bytes = std::io::stdin().read_to_end(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let _bytes = std::io::stdin().read_to_string(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = [0; 100]; + std::io::stdin().read_exact(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + for byte in std::io::stdin().bytes() { // $ MISSING: Alert[rust/summary/taint-sources] + sink(byte); // $ MISSING: hasTaintFlow + } + + // --- file --- + + let mut file = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + + { + let mut buffer = [0u8; 100]; + let _bytes = file.read(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = Vec::::new(); + let _bytes = file.read_to_end(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let _bytes = file.read_to_string(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = [0; 100]; + file.read_exact(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + for byte in file.bytes() { + sink(byte); // $ MISSING: hasTaintFlow + } + + // --- BufReader --- + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let data = reader.fill_buf()?; + sink(&data); // $ MISSING: hasTaintFlow + } + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let data = reader.buffer(); + sink(&data); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + reader.read_line(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = Vec::::new(); + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + reader.read_until(b',', &mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = Vec::::new(); + let mut reader_split = std::io::BufReader::new(std::io::stdin()).split(b','); // $ MISSING: Alert[rust/summary/taint-sources] + while let Some(chunk) = reader_split.next() { + sink(chunk.unwrap()); // $ MISSING: hasTaintFlow + } + } + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + for line in reader.lines() { + sink(line); // $ MISSING: Alert[rust/summary/taint-sources] + } + } + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let line = reader.lines().nth(1).unwrap(); + sink(line.unwrap().clone()); // $ MISSING: hasTaintFlow + } + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let lines: Vec<_> = reader.lines().collect(); + sink(lines[1].as_ref().unwrap().clone()); // $ MISSING: hasTaintFlow + } + + // --- misc operations --- + + { + let mut buffer = String::new(); + let mut file1 = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut file2 = std::fs::File::open("another_file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = file1.chain(file2); + reader.read_to_string(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let mut file1 = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = file1.take(100); + reader.read_to_string(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let _bytes = std::io::stdin().lock().read_to_string(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + Ok(()) +} + #[tokio::main] async fn main() -> Result<(), Box> { let case = std::env::args().nth(1).unwrap_or(String::from("1")).parse::().unwrap(); // $ Alert[rust/summary/taint-sources] From 258c1afe27d7c108b931df752efe90a4ba11bb1c Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Apr 2025 10:06:49 +0100 Subject: [PATCH 075/240] Rust: Add tests for std::fs sources. --- .../dataflow/sources/TaintSources.expected | 2 +- .../library-tests/dataflow/sources/test.rs | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index 6edfbb562da0..312842134d5e 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -22,4 +22,4 @@ | test.rs:80:24:80:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:112:35:112:46 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:119:31:119:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:352:16:352:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | +| test.rs:386:16:386:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index 3e5e55568704..fa6f3ec37b1d 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -198,6 +198,40 @@ async fn test_hyper_http(case: i64) -> Result<(), Box> { Ok(()) } +use std::fs; + +fn test_fs() -> Result<(), Box> { + { + let buffer: Vec = std::fs::read("file.bin")?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(buffer); // $ MISSING: hasTaintFlow + } + + { + let buffer: Vec = fs::read("file.bin")?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(buffer); // $ MISSING: hasTaintFlow + } + + { + let buffer = fs::read_to_string("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(buffer); // $ MISSING: hasTaintFlow + } + + for entry in fs::read_dir("directory")? { + let e = entry?; + let path = e.path(); // $ MISSING: Alert[rust/summary/taint-sources] + let file_name = e.file_name(); // $ MISSING: Alert[rust/summary/taint-sources] + sink(path); // $ MISSING: hasTaintFlow + sink(file_name); // $ MISSING: hasTaintFlow + } + + { + let target = fs::read_link("symlink.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(target); // $ MISSING: hasTaintFlow + } + + Ok(()) +} + use std::io::Read; use std::io::BufRead; From 4f9f550ba62863e9c1ce3a681e5ffcc6190b3d30 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Apr 2025 16:18:37 +0100 Subject: [PATCH 076/240] Rust: Add source models for fs. --- rust/ql/lib/codeql/rust/Concepts.qll | 26 +++++++++++++++ .../rust/frameworks/stdlib/fs.model.yml | 10 ++++-- .../dataflow/sources/TaintSources.expected | 10 ++++++ .../library-tests/dataflow/sources/test.rs | 32 +++++++++---------- 4 files changed, 60 insertions(+), 18 deletions(-) diff --git a/rust/ql/lib/codeql/rust/Concepts.qll b/rust/ql/lib/codeql/rust/Concepts.qll index 723cde6913a8..10bf4d86998b 100644 --- a/rust/ql/lib/codeql/rust/Concepts.qll +++ b/rust/ql/lib/codeql/rust/Concepts.qll @@ -102,6 +102,32 @@ class ModeledEnvironmentSource extends EnvironmentSource::Range { ModeledEnvironmentSource() { sourceNode(this, "environment-source") } } +/** + * A data flow source corresponding to a file access. + */ +final class FileSource = FileSource::Range; + +/** + * An externally modeled source for data from a file access. + */ +class ModeledFileSource extends FileSource::Range { + ModeledFileSource() { sourceNode(this, "file") } +} + +/** + * Provides a class for modeling new sources for file accesses. + */ +module FileSource { + /** + * A data flow source corresponding to a file access. + */ + abstract class Range extends ThreatModelSource::Range { + override string getThreatModel() { result = "file" } + + override string getSourceType() { result = "FileSource" } + } +} + /** * A data flow source corresponding to the program's database reads. */ diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml index c7fa72793306..436ff2002baa 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml @@ -2,7 +2,14 @@ extensions: - addsTo: pack: codeql/rust-all extensible: sourceModel - data: [] + data: + - ["lang:std", "crate::fs::read", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] + - ["lang:std", "crate::fs::read_to_string", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] + - ["lang:std", "crate::fs::read_link", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] + - ["lang:std", "::path", "ReturnValue", "file", "manual"] + - ["lang:std", "::file_name", "ReturnValue", "file", "manual"] + - ["lang:std", "::open", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] + - ["lang:std", "::open_buffered", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] - addsTo: pack: codeql/rust-all extensible: sinkModel @@ -34,7 +41,6 @@ extensions: - ["lang:std", "::create_new", "Argument[0]", "path-injection", "manual"] - ["lang:std", "::open", "Argument[0]", "path-injection", "manual"] - ["lang:std", "::open_buffered", "Argument[0]", "path-injection", "manual"] - - addsTo: pack: codeql/rust-all extensible: summaryModel diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index 312842134d5e..5f02eb718457 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -22,4 +22,14 @@ | test.rs:80:24:80:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:112:35:112:46 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:119:31:119:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | +| test.rs:205:31:205:43 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:210:31:210:38 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:215:22:215:39 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:221:22:221:25 | path | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:222:27:222:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:228:22:228:34 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:271:20:271:38 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:360:25:360:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:361:25:361:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:369:25:369:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:386:16:386:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index fa6f3ec37b1d..ed33e5841287 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -202,31 +202,31 @@ use std::fs; fn test_fs() -> Result<(), Box> { { - let buffer: Vec = std::fs::read("file.bin")?; // $ MISSING: Alert[rust/summary/taint-sources] - sink(buffer); // $ MISSING: hasTaintFlow + let buffer: Vec = std::fs::read("file.bin")?; // $ Alert[rust/summary/taint-sources] + sink(buffer); // $ hasTaintFlow="file.bin" } { - let buffer: Vec = fs::read("file.bin")?; // $ MISSING: Alert[rust/summary/taint-sources] - sink(buffer); // $ MISSING: hasTaintFlow + let buffer: Vec = fs::read("file.bin")?; // $ Alert[rust/summary/taint-sources] + sink(buffer); // $ hasTaintFlow="file.bin" } { - let buffer = fs::read_to_string("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] - sink(buffer); // $ MISSING: hasTaintFlow + let buffer = fs::read_to_string("file.txt")?; // $ Alert[rust/summary/taint-sources] + sink(buffer); // $ hasTaintFlow="file.txt" } for entry in fs::read_dir("directory")? { let e = entry?; - let path = e.path(); // $ MISSING: Alert[rust/summary/taint-sources] - let file_name = e.file_name(); // $ MISSING: Alert[rust/summary/taint-sources] - sink(path); // $ MISSING: hasTaintFlow - sink(file_name); // $ MISSING: hasTaintFlow + let path = e.path(); // $ Alert[rust/summary/taint-sources] + let file_name = e.file_name(); // $ Alert[rust/summary/taint-sources] + sink(path); // $ hasTaintFlow + sink(file_name); // $ hasTaintFlow } { - let target = fs::read_link("symlink.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] - sink(target); // $ MISSING: hasTaintFlow + let target = fs::read_link("symlink.txt")?; // $ Alert[rust/summary/taint-sources] + sink(target); // $ hasTaintFlow="symlink.txt" } Ok(()) @@ -268,7 +268,7 @@ fn test_io_fs() -> std::io::Result<()> { // --- file --- - let mut file = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut file = std::fs::File::open("file.txt")?; // $ Alert[rust/summary/taint-sources] { let mut buffer = [0u8; 100]; @@ -357,8 +357,8 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = String::new(); - let mut file1 = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] - let mut file2 = std::fs::File::open("another_file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut file1 = std::fs::File::open("file.txt")?; // $ Alert[rust/summary/taint-sources] + let mut file2 = std::fs::File::open("another_file.txt")?; // $ Alert[rust/summary/taint-sources] let mut reader = file1.chain(file2); reader.read_to_string(&mut buffer)?; sink(&buffer); // $ MISSING: hasTaintFlow @@ -366,7 +366,7 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = String::new(); - let mut file1 = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut file1 = std::fs::File::open("file.txt")?; // $ Alert[rust/summary/taint-sources] let mut reader = file1.take(100); reader.read_to_string(&mut buffer)?; sink(&buffer); // $ MISSING: hasTaintFlow From 7a9ea52bc79a693c749dca09e512add9568260dc Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Apr 2025 17:00:36 +0100 Subject: [PATCH 077/240] Rust: Add source models for io. --- rust/ql/lib/codeql/rust/Concepts.qll | 26 +++++++++++++++++ .../rust/frameworks/stdlib/io.model.yml | 6 ++++ .../dataflow/sources/TaintSources.expected | 14 ++++++++++ .../library-tests/dataflow/sources/test.rs | 28 +++++++++---------- 4 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml diff --git a/rust/ql/lib/codeql/rust/Concepts.qll b/rust/ql/lib/codeql/rust/Concepts.qll index 10bf4d86998b..544a87e11f18 100644 --- a/rust/ql/lib/codeql/rust/Concepts.qll +++ b/rust/ql/lib/codeql/rust/Concepts.qll @@ -128,6 +128,32 @@ module FileSource { } } +/** + * A data flow source corresponding to standard input. + */ +final class StdInSource = StdInSource::Range; + +/** + * An externally modeled source for data from standard input. + */ +class ModeledStdInSourceSource extends StdInSource::Range { + ModeledStdInSourceSource() { sourceNode(this, "stdin") } +} + +/** + * Provides a class for modeling new sources for standard input. + */ +module StdInSource { + /** + * A data flow source corresponding to standard input. + */ + abstract class Range extends ThreatModelSource::Range { + override string getThreatModel() { result = "stdin" } + + override string getSourceType() { result = "StdInSource" } + } +} + /** * A data flow source corresponding to the program's database reads. */ diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml new file mode 100644 index 000000000000..91eab1cab898 --- /dev/null +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/rust-all + extensible: sourceModel + data: + - ["lang:std", "crate::io::stdio::stdin", "ReturnValue", "stdin", "manual"] diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index 5f02eb718457..ba7eeae00081 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -28,8 +28,22 @@ | test.rs:221:22:221:25 | path | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:222:27:222:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:228:22:228:34 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:243:22:243:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:249:22:249:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:255:22:255:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:261:9:261:22 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:265:17:265:30 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | | test.rs:271:20:271:38 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:304:50:304:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:310:50:310:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:317:50:317:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:324:50:324:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:331:56:331:69 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:338:50:338:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:345:50:345:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:351:50:351:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | | test.rs:360:25:360:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:361:25:361:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:369:25:369:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:377:22:377:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | | test.rs:386:16:386:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index ed33e5841287..f6aa96767786 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -240,29 +240,29 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = [0u8; 100]; - let _bytes = std::io::stdin().read(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + let _bytes = std::io::stdin().read(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = Vec::::new(); - let _bytes = std::io::stdin().read_to_end(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + let _bytes = std::io::stdin().read_to_end(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = String::new(); - let _bytes = std::io::stdin().read_to_string(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + let _bytes = std::io::stdin().read_to_string(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = [0; 100]; - std::io::stdin().read_exact(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + std::io::stdin().read_exact(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } - for byte in std::io::stdin().bytes() { // $ MISSING: Alert[rust/summary/taint-sources] + for byte in std::io::stdin().bytes() { // $ Alert[rust/summary/taint-sources] sink(byte); // $ MISSING: hasTaintFlow } @@ -301,54 +301,54 @@ fn test_io_fs() -> std::io::Result<()> { // --- BufReader --- { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let data = reader.fill_buf()?; sink(&data); // $ MISSING: hasTaintFlow } { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let data = reader.buffer(); sink(&data); // $ MISSING: hasTaintFlow } { let mut buffer = String::new(); - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] reader.read_line(&mut buffer)?; sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = Vec::::new(); - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] reader.read_until(b',', &mut buffer)?; sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = Vec::::new(); - let mut reader_split = std::io::BufReader::new(std::io::stdin()).split(b','); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader_split = std::io::BufReader::new(std::io::stdin()).split(b','); // $ Alert[rust/summary/taint-sources] while let Some(chunk) = reader_split.next() { sink(chunk.unwrap()); // $ MISSING: hasTaintFlow } } { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] for line in reader.lines() { sink(line); // $ MISSING: Alert[rust/summary/taint-sources] } } { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let line = reader.lines().nth(1).unwrap(); sink(line.unwrap().clone()); // $ MISSING: hasTaintFlow } { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let lines: Vec<_> = reader.lines().collect(); sink(lines[1].as_ref().unwrap().clone()); // $ MISSING: hasTaintFlow } @@ -374,7 +374,7 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = String::new(); - let _bytes = std::io::stdin().lock().read_to_string(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + let _bytes = std::io::stdin().lock().read_to_string(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } From 91daca1a6babb9bef353f8c54626c6b4c15bd696 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Mon, 14 Apr 2025 13:51:30 +0200 Subject: [PATCH 078/240] Improve code quality based on PR review --- .../BuildScripts.cs | 17 +++++++------ .../BuildScripts.cs | 4 ++++ .../Semmle.Autobuild.Shared/MsBuildRule.cs | 7 +----- csharp/extractor/Semmle.Util/BuildActions.cs | 24 +++++++++++++++++++ 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs index db445c591a52..eb75af79082f 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs @@ -46,11 +46,6 @@ bool IBuildActions.FileExists(string file) public IList RunProcessIn { get; } = new List(); public IDictionary RunProcess { get; } = new Dictionary(); - - /// - /// (process-exit code) pairs for commands that are executed during the assembly of the autobuild script. - /// - public IDictionary RunProcessExecuteDuring { get; } = new Dictionary(); public IDictionary RunProcessOut { get; } = new Dictionary(); public IDictionary RunProcessWorkingDirectory { get; } = new Dictionary(); public HashSet CreateDirectories { get; } = new HashSet(); @@ -71,7 +66,7 @@ int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory, if (wd != workingDirectory) throw new ArgumentException($"Unexpected RunProcessWorkingDirectory, got {wd ?? "null"} expected {workingDirectory ?? "null"} in {pattern}"); - if (!RunProcess.TryGetValue(pattern, out var ret) && !RunProcessExecuteDuring.TryGetValue(pattern, out ret)) + if (!RunProcess.TryGetValue(pattern, out var ret)) throw new ArgumentException("Missing RunProcess " + pattern); return ret; @@ -86,7 +81,7 @@ int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory, if (wd != workingDirectory) throw new ArgumentException($"Unexpected RunProcessWorkingDirectory, got {wd ?? "null"} expected {workingDirectory ?? "null"} in {pattern}"); - if (!RunProcess.TryGetValue(pattern, out var ret) && !RunProcessExecuteDuring.TryGetValue(pattern, out ret)) + if (!RunProcess.TryGetValue(pattern, out var ret)) throw new ArgumentException("Missing RunProcess " + pattern); return ret; @@ -167,6 +162,10 @@ IEnumerable IBuildActions.EnumerateDirectories(string dir) bool IBuildActions.IsRunningOnAppleSilicon() => IsRunningOnAppleSilicon; + public bool IsMonoInstalled { get; set; } + + bool IBuildActions.IsMonoInstalled() => IsMonoInstalled; + public string PathCombine(params string[] parts) { return string.Join(IsWindows ? '\\' : '/', parts.Where(p => !string.IsNullOrWhiteSpace(p))); @@ -804,7 +803,7 @@ public void TestDirsProjWindows() [Fact] public void TestDirsProjLinux_WithMono() { - actions.RunProcessExecuteDuring[@"mono --version"] = 0; + actions.IsMonoInstalled = true; actions.RunProcess[@"nuget restore C:\Project/dirs.proj -DisableParallelProcessing"] = 1; actions.RunProcess[@"mono scratch/.nuget/nuget.exe restore C:\Project/dirs.proj -DisableParallelProcessing"] = 0; @@ -817,7 +816,7 @@ public void TestDirsProjLinux_WithMono() [Fact] public void TestDirsProjLinux_WithoutMono() { - actions.RunProcessExecuteDuring[@"mono --version"] = 1; + actions.IsMonoInstalled = false; actions.RunProcess[@"dotnet msbuild /t:restore C:\Project/dirs.proj"] = 0; actions.RunProcess[@"dotnet msbuild C:\Project/dirs.proj /t:rebuild"] = 0; diff --git a/csharp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs b/csharp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs index c74692bed750..afa4ea4b41c3 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs @@ -150,6 +150,10 @@ IEnumerable IBuildActions.EnumerateDirectories(string dir) bool IBuildActions.IsRunningOnAppleSilicon() => IsRunningOnAppleSilicon; + public bool IsMonoInstalled { get; set; } + + bool IBuildActions.IsMonoInstalled() => IsMonoInstalled; + string IBuildActions.PathCombine(params string[] parts) { return string.Join(IsWindows ? '\\' : '/', parts.Where(p => !string.IsNullOrWhiteSpace(p))); diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs index 72ede13da42b..4295f71df9d4 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs @@ -74,12 +74,7 @@ BuildScript GetNugetRestoreScript() => Argument("-DisableParallelProcessing"). Script; - BuildScript GetMonoVersionScript() => new CommandBuilder(builder.Actions). - RunCommand("mono"). - Argument("--version"). - Script; - - var preferDotnet = !builder.Actions.IsWindows() && GetMonoVersionScript().Run(builder.Actions, (_, _) => { }, (_, _, _) => { }) != 0; + var preferDotnet = !builder.Actions.IsWindows() && !builder.Actions.IsMonoInstalled(); var nugetRestore = GetNugetRestoreScript(); var msbuildRestoreCommand = new CommandBuilder(builder.Actions). diff --git a/csharp/extractor/Semmle.Util/BuildActions.cs b/csharp/extractor/Semmle.Util/BuildActions.cs index 507af96d13ca..38210402945b 100644 --- a/csharp/extractor/Semmle.Util/BuildActions.cs +++ b/csharp/extractor/Semmle.Util/BuildActions.cs @@ -125,6 +125,11 @@ public interface IBuildActions /// True if we are running on Apple Silicon. bool IsRunningOnAppleSilicon(); + /// + /// Checks if Mono is installed. + /// + bool IsMonoInstalled(); + /// /// Combine path segments, Path.Combine(). /// @@ -261,6 +266,25 @@ bool IBuildActions.IsRunningOnAppleSilicon() } } + bool IBuildActions.IsMonoInstalled() + { + var thisBuildActions = (IBuildActions)this; + + if (thisBuildActions.IsWindows()) + { + return false; + } + + try + { + return 0 == thisBuildActions.RunProcess("mono", "--version", workingDirectory: null, env: null); + } + catch (Exception) + { + return false; + } + } + string IBuildActions.PathCombine(params string[] parts) => Path.Combine(parts); void IBuildActions.WriteAllText(string filename, string contents) => File.WriteAllText(filename, contents); From 8d571672e9256ce021f556bebe167f32b7ef4043 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 14 Apr 2025 13:54:43 +0200 Subject: [PATCH 079/240] C#: Convert cs/missing-access-control to inline expectations test. --- .../MVCTests/MissingAccessControl.expected | 2 +- .../MVCTests/MissingAccessControl.qlref | 5 ++- .../MVCTests/ProfileController.cs | 35 ++++++++++++------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected index 87fc29167beb..b0cd401adf00 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected @@ -1 +1 @@ -| ProfileController.cs:9:25:9:31 | Delete1 | This action is missing an authorization check. | +| ProfileController.cs:10:25:10:31 | Delete1 | This action is missing an authorization check. | diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.qlref b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.qlref index a4173778d9fa..304adda34284 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.qlref +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.qlref @@ -1 +1,4 @@ -Security Features/CWE-285/MissingAccessControl.ql +query: Security Features/CWE-285/MissingAccessControl.ql +postprocess: + - utils/test/PrettyPrintModels.ql + - utils/test/InlineExpectationsTestQuery.ql diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs index 8fb88eacd3ef..071dd9e9839a 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs @@ -1,19 +1,23 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; -public class ProfileController : Controller { +public class ProfileController : Controller +{ private void doThings() { } private bool isAuthorized() { return false; } // BAD: This is a Delete method, but no auth is specified. - public ActionResult Delete1(int id) { + public ActionResult Delete1(int id) // $ Alert + { doThings(); return View(); } // GOOD: isAuthorized is checked. - public ActionResult Delete2(int id) { - if (!isAuthorized()) { + public ActionResult Delete2(int id) + { + if (!isAuthorized()) + { return null; } doThings(); @@ -22,7 +26,8 @@ public ActionResult Delete2(int id) { // GOOD: The Authorize attribute is used. [Authorize] - public ActionResult Delete3(int id) { + public ActionResult Delete3(int id) + { doThings(); return View(); } @@ -30,27 +35,33 @@ public ActionResult Delete3(int id) { } [Authorize] -public class AuthBaseController : Controller { +public class AuthBaseController : Controller +{ protected void doThings() { } } -public class SubController : AuthBaseController { +public class SubController : AuthBaseController +{ // GOOD: The Authorize attribute is used on the base class. - public ActionResult Delete4(int id) { + public ActionResult Delete4(int id) + { doThings(); return View(); } } [Authorize] -public class AuthBaseGenericController : Controller { +public class AuthBaseGenericController : Controller +{ protected void doThings() { } } -public class SubGenericController : AuthBaseGenericController { +public class SubGenericController : AuthBaseGenericController +{ // GOOD: The Authorize attribute is used on the base class. - public ActionResult Delete5(int id) { + public ActionResult Delete5(int id) + { doThings(); return View(); } -} \ No newline at end of file +} From 2e7e276806a82a12ed0d2310cc7fbd138490a3c5 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 14 Apr 2025 14:18:30 +0200 Subject: [PATCH 080/240] C#: Add test case for authorization attribute that extends Authorize. --- .../MVCTests/MissingAccessControl.expected | 6 +++++- .../MissingAccessControl/MVCTests/ProfileController.cs | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected index b0cd401adf00..539a53c21937 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected @@ -1 +1,5 @@ -| ProfileController.cs:10:25:10:31 | Delete1 | This action is missing an authorization check. | +#select +| ProfileController.cs:12:25:12:31 | Delete1 | This action is missing an authorization check. | +| ProfileController.cs:39:25:39:31 | Delete4 | This action is missing an authorization check. | +testFailures +| ProfileController.cs:39:25:39:31 | This action is missing an authorization check. | Unexpected result: Alert | diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs index 071dd9e9839a..9c20313b84b7 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs @@ -1,6 +1,8 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; +public class RequirePermissionAttribute : AuthorizeAttribute { } + public class ProfileController : Controller { private void doThings() { } @@ -32,6 +34,13 @@ public ActionResult Delete3(int id) return View(); } + // GOOD: The RequirePermission attribute is used (which extends AuthorizeAttribute). + [RequirePermission] + public ActionResult Delete4(int id) + { + doThings(); + return View(); + } } [Authorize] From c15d1ab3bdd92f57a4a0901508dcd312fef21216 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 14 Apr 2025 14:25:31 +0200 Subject: [PATCH 081/240] C#: Consider an attribute to be authorization like, if it extends an attribute that has an authorization like name. --- .../security/auth/MissingFunctionLevelAccessControlQuery.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/security/auth/MissingFunctionLevelAccessControlQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/auth/MissingFunctionLevelAccessControlQuery.qll index f43d42b87142..0e3074065f46 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/auth/MissingFunctionLevelAccessControlQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/auth/MissingFunctionLevelAccessControlQuery.qll @@ -81,7 +81,7 @@ predicate hasAuthViaXml(ActionMethod m) { /** Holds if the given action has an attribute that indications authorization. */ predicate hasAuthViaAttribute(ActionMethod m) { - exists(Attribute attr | attr.getType().getName().toLowerCase().matches("%auth%") | + exists(Attribute attr | attr.getType().getABaseType*().getName().toLowerCase().matches("%auth%") | attr = m.getOverridee*().getAnAttribute() or attr = getAnUnboundBaseType*(m.getDeclaringType()).getAnAttribute() ) From f11aec35921acb2443b6dbe80bc8a067a96f6ad7 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 14 Apr 2025 14:26:51 +0200 Subject: [PATCH 082/240] C#: Update test expected output. --- .../MVCTests/MissingAccessControl.expected | 4 ---- 1 file changed, 4 deletions(-) diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected index 539a53c21937..513fab4804a9 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected @@ -1,5 +1 @@ -#select | ProfileController.cs:12:25:12:31 | Delete1 | This action is missing an authorization check. | -| ProfileController.cs:39:25:39:31 | Delete4 | This action is missing an authorization check. | -testFailures -| ProfileController.cs:39:25:39:31 | This action is missing an authorization check. | Unexpected result: Alert | From 1c11c5562ae5ca6eb948e884b62c958f853306e7 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 14:50:46 +0200 Subject: [PATCH 083/240] Swift: add change note --- swift/ql/lib/change-notes/2025-04-14-new-entities.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 swift/ql/lib/change-notes/2025-04-14-new-entities.md diff --git a/swift/ql/lib/change-notes/2025-04-14-new-entities.md b/swift/ql/lib/change-notes/2025-04-14-new-entities.md new file mode 100644 index 000000000000..a0555d9cbda7 --- /dev/null +++ b/swift/ql/lib/change-notes/2025-04-14-new-entities.md @@ -0,0 +1,6 @@ +--- +category: minorAnalysis +--- +* Added AST nodes `ActorIsolationErasureExpr`, `CurrentContextIsolationExpr`, + `ExtracFunctionIsolationExpr` and `UnreachableExpr` that correspond to new nodes + added by Swift 6.0. From a70536f002d5de3e8c8a57bf62b7c678d165a7ce Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Mon, 14 Apr 2025 14:54:56 +0200 Subject: [PATCH 084/240] Improve code quality --- csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs index 4295f71df9d4..748a22fb9d3c 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs @@ -16,7 +16,9 @@ public static CommandBuilder MsBuildCommand(this CommandBuilder cmdBuilder, IAut // mono doesn't ship with `msbuild` on Arm-based Macs, but we can fall back to // msbuild that ships with `dotnet` which can be invoked with `dotnet msbuild` // perhaps we should do this on all platforms? - return builder.Actions.IsRunningOnAppleSilicon() || preferDotnet + // Similarly, there's no point in trying to rely on mono if it's not installed. + // In which case we can still fall back to `dotnet msbuild`. + return preferDotnet ? cmdBuilder.RunCommand("dotnet").Argument("msbuild") : cmdBuilder.RunCommand("msbuild"); } @@ -74,7 +76,7 @@ BuildScript GetNugetRestoreScript() => Argument("-DisableParallelProcessing"). Script; - var preferDotnet = !builder.Actions.IsWindows() && !builder.Actions.IsMonoInstalled(); + var preferDotnet = builder.Actions.IsRunningOnAppleSilicon() || !builder.Actions.IsWindows() && !builder.Actions.IsMonoInstalled(); var nugetRestore = GetNugetRestoreScript(); var msbuildRestoreCommand = new CommandBuilder(builder.Actions). @@ -82,7 +84,7 @@ BuildScript GetNugetRestoreScript() => Argument("/t:restore"). QuoteArgument(projectOrSolution.FullPath); - if (builder.Actions.IsRunningOnAppleSilicon() || preferDotnet) + if (preferDotnet) { // On Apple Silicon, only try package restore with `dotnet msbuild /t:restore` ret &= BuildScript.Try(msbuildRestoreCommand.Script); From 24bcd041b8825ef8b6c1349c11eb36ec7c1ad437 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Apr 2025 19:05:23 +0100 Subject: [PATCH 085/240] Rust: Add flow models for io. --- .../rust/frameworks/stdlib/io.model.yml | 32 +++++++++++++++++ .../library-tests/dataflow/sources/test.rs | 34 +++++++++---------- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml index 91eab1cab898..3cdbb911b5b8 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml @@ -4,3 +4,35 @@ extensions: extensible: sourceModel data: - ["lang:std", "crate::io::stdio::stdin", "ReturnValue", "stdin", "manual"] + - addsTo: + pack: codeql/rust-all + extensible: summaryModel + data: + - ["lang:std", "::new", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["lang:std", "::fill_buf", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:std", "::buffer", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::Read::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::Read::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", ":::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", ":::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::Read::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::Read::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::BufRead::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::BufRead::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"] + - ["lang:std", "crate::io::BufRead::split", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::BufRead::lines", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::Read::bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::Read::chain", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::Read::chain", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::Read::take", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "::lock", "Argument[self]", "ReturnValue", "taint", "manual"] diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index f6aa96767786..2ec0b8964ca2 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -241,7 +241,7 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = [0u8; 100]; let _bytes = std::io::stdin().read(&mut buffer)?; // $ Alert[rust/summary/taint-sources] - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } { @@ -253,17 +253,17 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = String::new(); let _bytes = std::io::stdin().read_to_string(&mut buffer)?; // $ Alert[rust/summary/taint-sources] - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } { let mut buffer = [0; 100]; std::io::stdin().read_exact(&mut buffer)?; // $ Alert[rust/summary/taint-sources] - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } for byte in std::io::stdin().bytes() { // $ Alert[rust/summary/taint-sources] - sink(byte); // $ MISSING: hasTaintFlow + sink(byte); // $ hasTaintFlow } // --- file --- @@ -273,29 +273,29 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = [0u8; 100]; let _bytes = file.read(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } { let mut buffer = Vec::::new(); let _bytes = file.read_to_end(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } { let mut buffer = String::new(); let _bytes = file.read_to_string(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } { let mut buffer = [0; 100]; file.read_exact(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } for byte in file.bytes() { - sink(byte); // $ MISSING: hasTaintFlow + sink(byte); // $ hasTaintFlow="file.txt" } // --- BufReader --- @@ -303,27 +303,27 @@ fn test_io_fs() -> std::io::Result<()> { { let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let data = reader.fill_buf()?; - sink(&data); // $ MISSING: hasTaintFlow + sink(&data); // $ hasTaintFlow } { let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let data = reader.buffer(); - sink(&data); // $ MISSING: hasTaintFlow + sink(&data); // $ hasTaintFlow } { let mut buffer = String::new(); let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] reader.read_line(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } { let mut buffer = Vec::::new(); let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] reader.read_until(b',', &mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } { @@ -337,7 +337,7 @@ fn test_io_fs() -> std::io::Result<()> { { let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] for line in reader.lines() { - sink(line); // $ MISSING: Alert[rust/summary/taint-sources] + sink(line); // $ hasTaintFlow } } @@ -361,7 +361,7 @@ fn test_io_fs() -> std::io::Result<()> { let mut file2 = std::fs::File::open("another_file.txt")?; // $ Alert[rust/summary/taint-sources] let mut reader = file1.chain(file2); reader.read_to_string(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" hasTaintFlow="another_file.txt" } { @@ -369,13 +369,13 @@ fn test_io_fs() -> std::io::Result<()> { let mut file1 = std::fs::File::open("file.txt")?; // $ Alert[rust/summary/taint-sources] let mut reader = file1.take(100); reader.read_to_string(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } { let mut buffer = String::new(); let _bytes = std::io::stdin().lock().read_to_string(&mut buffer)?; // $ Alert[rust/summary/taint-sources] - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } Ok(()) From a8b552200a1ca973e7608b44db94359cc551f26f Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:03:04 +0100 Subject: [PATCH 086/240] Rust: Impact on dataflow/local test. --- .../dataflow/local/DataFlowStep.expected | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index fcd4d2786106..2721ef7092de 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -1940,8 +1940,25 @@ storeStep | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:proc_macro::_::::decode | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:proc_macro::_::::decode | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:proc_macro::_::::decode | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_:::::read_to_end | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_:::::read_to_end | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_:::::read_to_end | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_:::::read_to_end | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_exact | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_exact | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_to_end | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_to_end | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_to_string | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_to_string | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::advance_slices | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::advance_slices | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::advance_slices | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::advance_slices | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_exact | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_exact | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_to_string | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_to_string | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_exact | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_exact | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_to_string | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_to_string | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::BufRead::read_line | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::BufRead::read_line | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::Read::read | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::Read::read | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::Read::read_exact | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::Read::read_exact | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::Read::read_to_end | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::Read::read_to_end | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::Read::read_to_string | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::Read::read_to_string | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference.Reference in lang:proc_macro::_::<&[u8] as crate::bridge::rpc::DecodeMut>::decode | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::<&[u8] as crate::bridge::rpc::DecodeMut>::decode | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference.Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference.Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | @@ -1957,6 +1974,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: Argument[1].Parameter[0].Reference in lang:core::_::::map_split | &ref | file://:0:0:0:0 | [summary] to write: Argument[1].Parameter[0] in lang:core::_::::map_split | | file://:0:0:0:0 | [summary] to write: Argument[1].Parameter[0].Reference in lang:std::_::::wait_while | &ref | file://:0:0:0:0 | [summary] to write: Argument[1].Parameter[0] in lang:std::_::::wait_while | | file://:0:0:0:0 | [summary] to write: Argument[1].Reference in lang:core::_::<_ as crate::clone::uninit::CopySpec>::clone_one | &ref | file://:0:0:0:0 | [post] [summary param] 1 in lang:core::_::<_ as crate::clone::uninit::CopySpec>::clone_one | +| file://:0:0:0:0 | [summary] to write: Argument[1].Reference in lang:std::_::crate::io::BufRead::read_until | &ref | file://:0:0:0:0 | [post] [summary param] 1 in lang:std::_::crate::io::BufRead::read_until | | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0].Reference in lang:core::_::crate::cmp::max_by | &ref | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0] in lang:core::_::crate::cmp::max_by | | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0].Reference in lang:core::_::crate::cmp::max_by_key | &ref | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0] in lang:core::_::crate::cmp::max_by_key | | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0].Reference in lang:core::_::crate::cmp::min_by | &ref | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0] in lang:core::_::crate::cmp::min_by | @@ -2178,6 +2196,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::or_else | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::or_else | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::parse | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::parse | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::<&[u8] as crate::io::BufRead>::fill_buf | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::<&[u8] as crate::io::BufRead>::fill_buf | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::fill_buf | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::::fill_buf | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::canonicalize | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::::canonicalize | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::wait | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::::wait | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::wait_timeout | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::::wait_timeout | From bdd5717c09e426b15352223ca74d905e9a02642b Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:39:40 +0100 Subject: [PATCH 087/240] Rust: Remove the models output from the dataflow/local test. --- .../dataflow/local/DataFlowStep.expected | 1062 ----------------- .../dataflow/local/DataFlowStep.ql | 2 - 2 files changed, 1064 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index fcd4d2786106..029f00cf82b6 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -860,1068 +860,6 @@ localStep | main.rs:565:13:565:33 | result_questionmark(...) | main.rs:565:9:565:9 | _ | | main.rs:577:36:577:41 | ...::new(...) | main.rs:577:36:577:41 | MacroExpr | | main.rs:577:36:577:41 | [post] MacroExpr | main.rs:577:36:577:41 | [post] ...::new(...) | -models -| 1 | Sink: lang:std; crate::io::stdio::_print; log-injection; Argument[0] | -| 2 | Summary: lang:alloc; <&&str as crate::string::SpecToString>::spec_to_string; Argument[self].Reference.Reference; ReturnValue; value | -| 3 | Summary: lang:alloc; <&str as crate::string::SpecToString>::spec_to_string; Argument[self].Reference; ReturnValue; value | -| 4 | Summary: lang:alloc; <_ as crate::borrow::ToOwned>::clone_into; Argument[self]; Argument[0].Reference; value | -| 5 | Summary: lang:alloc; <_ as crate::borrow::ToOwned>::to_owned; Argument[self]; ReturnValue; value | -| 6 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 7 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 8 | Summary: lang:alloc; ::add_assign; Argument[0]; Argument[self].Reference; value | -| 9 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 10 | Summary: lang:alloc; ::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 11 | Summary: lang:alloc; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 12 | Summary: lang:alloc; ::as_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 13 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 14 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 15 | Summary: lang:alloc; ::deref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 16 | Summary: lang:alloc; ::deref_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 17 | Summary: lang:alloc; ::allocator; Argument[0].Field[1]; ReturnValue.Reference; value | -| 18 | Summary: lang:alloc; ::as_mut_ptr; Argument[0].Reference.Reference; ReturnValue.Reference; value | -| 19 | Summary: lang:alloc; ::as_ptr; Argument[0].Reference.Reference; ReturnValue.Reference; value | -| 20 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 21 | Summary: lang:alloc; ::into_inner; Argument[0].Reference; ReturnValue; value | -| 22 | Summary: lang:alloc; ::borrow; Argument[self].Field[0]; ReturnValue.Reference; value | -| 23 | Summary: lang:alloc; ::borrow_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 24 | Summary: lang:alloc; ::as_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 25 | Summary: lang:alloc; ::as_ref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 26 | Summary: lang:alloc; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 27 | Summary: lang:alloc; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 28 | Summary: lang:alloc; ::index; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 29 | Summary: lang:alloc; ::index_mut; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 30 | Summary: lang:alloc; ::as_bytes; Argument[self].Field[0]; ReturnValue.Reference; value | -| 31 | Summary: lang:alloc; ::as_inner; Argument[self]; ReturnValue; value | -| 32 | Summary: lang:alloc; ::get_or_insert_with; Argument[0]; Argument[1].Parameter[0]; value | -| 33 | Summary: lang:alloc; ::clone; Argument[self].Reference; ReturnValue; value | -| 34 | Summary: lang:alloc; ::left_kv; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 35 | Summary: lang:alloc; ::right_kv; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 36 | Summary: lang:alloc; ::clone; Argument[self].Reference; ReturnValue; value | -| 37 | Summary: lang:alloc; ::ascend; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 38 | Summary: lang:alloc; ::choose_parent_kv; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 39 | Summary: lang:alloc; ::find_lower_bound_edge; Argument[0]; ReturnValue.Field[1]; value | -| 40 | Summary: lang:alloc; ::find_upper_bound_edge; Argument[0]; ReturnValue.Field[1]; value | -| 41 | Summary: lang:alloc; ::search_tree_for_bifurcation; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 42 | Summary: lang:alloc; ::visit_nodes_in_order; Argument[0].ReturnValue; ReturnValue; value | -| 43 | Summary: lang:alloc; ::get_or_insert_with; Argument[0]; Argument[1].Parameter[0]; value | -| 44 | Summary: lang:alloc; ::split_off; Argument[self].Reference; ReturnValue; value | -| 45 | Summary: lang:alloc; ::retain; Argument[self].Element; Argument[0].Parameter[0].Reference; value | -| 46 | Summary: lang:alloc; ::retain_mut; Argument[self].Element; Argument[0].Parameter[0].Reference; value | -| 47 | Summary: lang:alloc; ::rfold; Argument[0]; ReturnValue; value | -| 48 | Summary: lang:alloc; ::try_rfold; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 49 | Summary: lang:alloc; ::try_rfold; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 50 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | -| 51 | Summary: lang:alloc; ::try_fold; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 52 | Summary: lang:alloc; ::try_fold; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 53 | Summary: lang:alloc; ::rfold; Argument[0]; ReturnValue; value | -| 54 | Summary: lang:alloc; ::try_rfold; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 55 | Summary: lang:alloc; ::try_rfold; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 56 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | -| 57 | Summary: lang:alloc; ::try_fold; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 58 | Summary: lang:alloc; ::try_fold; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 59 | Summary: lang:alloc; ::borrow; Argument[self]; ReturnValue; value | -| 60 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 61 | Summary: lang:alloc; ::index; Argument[self]; ReturnValue; value | -| 62 | Summary: lang:alloc; ::as_c_str; Argument[self].Reference; ReturnValue.Reference; value | -| 63 | Summary: lang:alloc; ::into_vec; Argument[self].Field[1]; ReturnValue; value | -| 64 | Summary: lang:alloc; ::nul_position; Argument[self].Field[0]; ReturnValue; value | -| 65 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 66 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 67 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 68 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 69 | Summary: lang:alloc; ::try_unwrap; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 70 | Summary: lang:alloc; ::unwrap_or_clone; Argument[0].Reference; ReturnValue; value | -| 71 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 72 | Summary: lang:alloc; ::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 73 | Summary: lang:alloc; ::as_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 74 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 75 | Summary: lang:alloc; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 76 | Summary: lang:alloc; ::borrow_mut; Argument[self].Element; ReturnValue.Reference; value | -| 77 | Summary: lang:alloc; ::as_mut; Argument[self]; ReturnValue; value | -| 78 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 79 | Summary: lang:alloc; ::from; Argument[0]; ReturnValue; value | -| 80 | Summary: lang:alloc; ::add; Argument[self]; ReturnValue; value | -| 81 | Summary: lang:alloc; ::from_str; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 82 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | -| 83 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 84 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 85 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 86 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 87 | Summary: lang:alloc; ::try_unwrap; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 88 | Summary: lang:alloc; ::unwrap_or_clone; Argument[0].Reference; ReturnValue; value | -| 89 | Summary: lang:alloc; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 90 | Summary: lang:alloc; ::borrow_mut; Argument[self].Element; ReturnValue.Reference; value | -| 91 | Summary: lang:alloc; ::as_mut; Argument[self]; ReturnValue; value | -| 92 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 93 | Summary: lang:alloc; ::from; Argument[0].Field[0]; ReturnValue; value | -| 94 | Summary: lang:alloc; ::push_within_capacity; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 95 | Summary: lang:alloc; ::as_inner; Argument[self]; ReturnValue; value | -| 96 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | -| 97 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 98 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 99 | Summary: lang:alloc; ::as_into_iter; Argument[self]; ReturnValue; value | -| 100 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 101 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | -| 102 | Summary: lang:alloc; <{766}::StringError as crate::error::Error>::description; Argument[self].Field[0]; ReturnValue.Reference; value | -| 103 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[0].Reference; Argument[1].Parameter[0]; value | -| 104 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[1].ReturnValue; Argument[0].Reference; value | -| 105 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[0].Reference; Argument[1].Parameter[0]; value | -| 106 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[1].ReturnValue; Argument[0].Reference; value | -| 107 | Summary: lang:core; <&_ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 108 | Summary: lang:core; <&_ as crate::clone::Clone>::clone; Argument[self].Reference; ReturnValue; value | -| 109 | Summary: lang:core; <&_ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | -| 110 | Summary: lang:core; <&mut _ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 111 | Summary: lang:core; <&mut _ as crate::borrow::BorrowMut>::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 112 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[0]; ReturnValue; value | -| 113 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 114 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | -| 115 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[0]; ReturnValue; value | -| 116 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 117 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 118 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[0]; ReturnValue; value | -| 119 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 120 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 121 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[0]; ReturnValue; value | -| 122 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 123 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 124 | Summary: lang:core; <&mut _ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | -| 125 | Summary: lang:core; <&mut _ as crate::ops::deref::DerefMut>::deref_mut; Argument[self].Reference; ReturnValue; value | -| 126 | Summary: lang:core; <[_] as crate::convert::AsMut>::as_mut; Argument[self]; ReturnValue; value | -| 127 | Summary: lang:core; <[_] as crate::convert::AsRef>::as_ref; Argument[self]; ReturnValue; value | -| 128 | Summary: lang:core; <[_] as crate::slice::SlicePattern>::as_slice; Argument[self]; ReturnValue; value | -| 129 | Summary: lang:core; <[_]>::align_to; Argument[self]; ReturnValue.Field[0]; value | -| 130 | Summary: lang:core; <[_]>::align_to_mut; Argument[self]; ReturnValue.Field[0]; value | -| 131 | Summary: lang:core; <[_]>::as_simd; Argument[self]; ReturnValue.Field[0]; value | -| 132 | Summary: lang:core; <[_]>::as_simd_mut; Argument[self]; ReturnValue.Field[0]; value | -| 133 | Summary: lang:core; <[_]>::partition_dedup; Argument[self]; ReturnValue.Field[0]; value | -| 134 | Summary: lang:core; <[_]>::partition_dedup_by; Argument[self]; ReturnValue.Field[0]; value | -| 135 | Summary: lang:core; <[_]>::partition_dedup_by_key; Argument[self]; ReturnValue.Field[0]; value | -| 136 | Summary: lang:core; <[u8]>::trim_ascii; Argument[self]; ReturnValue; value | -| 137 | Summary: lang:core; <[u8]>::trim_ascii_end; Argument[self]; ReturnValue; value | -| 138 | Summary: lang:core; <[u8]>::trim_ascii_start; Argument[self]; ReturnValue; value | -| 139 | Summary: lang:core; <_ as crate::array::SpecArrayClone>::clone; Argument[0].Reference; ReturnValue; value | -| 140 | Summary: lang:core; <_ as crate::async_iter::async_iter::IntoAsyncIterator>::into_async_iter; Argument[self]; ReturnValue; value | -| 141 | Summary: lang:core; <_ as crate::borrow::Borrow>::borrow; Argument[self]; ReturnValue; value | -| 142 | Summary: lang:core; <_ as crate::borrow::BorrowMut>::borrow_mut; Argument[self]; ReturnValue; value | -| 143 | Summary: lang:core; <_ as crate::clone::uninit::CopySpec>::clone_one; Argument[0]; Argument[1].Reference; value | -| 144 | Summary: lang:core; <_ as crate::convert::From>::from; Argument[0]; ReturnValue; value | -| 145 | Summary: lang:core; <_ as crate::future::into_future::IntoFuture>::into_future; Argument[self]; ReturnValue; value | -| 146 | Summary: lang:core; <_ as crate::iter::adapters::step_by::SpecRangeSetup>::setup; Argument[0]; ReturnValue; value | -| 147 | Summary: lang:core; <_ as crate::iter::traits::collect::IntoIterator>::into_iter; Argument[self]; ReturnValue; value | -| 148 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[0]; Argument[self].Reference.Parameter[0]; value | -| 149 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[self].Reference.ReturnValue; ReturnValue; value | -| 150 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 151 | Summary: lang:core; ::select_unpredictable; Argument[0]; ReturnValue; value | -| 152 | Summary: lang:core; ::select_unpredictable; Argument[1]; ReturnValue; value | -| 153 | Summary: lang:core; ::then; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 154 | Summary: lang:core; ::then_some; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 155 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 156 | Summary: lang:core; ::to_ascii_lowercase; Argument[self].Reference; ReturnValue; value | -| 157 | Summary: lang:core; ::to_ascii_uppercase; Argument[self].Reference; ReturnValue; value | -| 158 | Summary: lang:core; ::borrow; Argument[self].Field[0]; ReturnValue.Reference; value | -| 159 | Summary: lang:core; ::borrow_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 160 | Summary: lang:core; ::as_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 161 | Summary: lang:core; ::as_ref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 162 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 163 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 164 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 165 | Summary: lang:core; ::index; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 166 | Summary: lang:core; ::index; Argument[self]; ReturnValue; value | -| 167 | Summary: lang:core; ::index_mut; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 168 | Summary: lang:core; ::index_mut; Argument[self]; ReturnValue; value | -| 169 | Summary: lang:core; ::as_bytes; Argument[self].Field[0]; ReturnValue.Reference; value | -| 170 | Summary: lang:core; ::update; Argument[0].ReturnValue; ReturnValue; value | -| 171 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 172 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 173 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 174 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 175 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 176 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 177 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 178 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 179 | Summary: lang:core; ::get_or_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 180 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 181 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 182 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue; ReturnValue; value | -| 183 | Summary: lang:core; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 184 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | -| 185 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 186 | Summary: lang:core; ::then; Argument[0]; ReturnValue; value | -| 187 | Summary: lang:core; ::then; Argument[self]; ReturnValue; value | -| 188 | Summary: lang:core; ::then_with; Argument[0].ReturnValue; ReturnValue; value | -| 189 | Summary: lang:core; ::then_with; Argument[self]; ReturnValue; value | -| 190 | Summary: lang:core; ::from; Argument[0]; ReturnValue; value | -| 191 | Summary: lang:core; ::provide_ref; Argument[self]; ReturnValue; value | -| 192 | Summary: lang:core; ::provide_ref_with; Argument[self]; ReturnValue; value | -| 193 | Summary: lang:core; ::provide_value; Argument[self]; ReturnValue; value | -| 194 | Summary: lang:core; ::provide_value_with; Argument[self]; ReturnValue; value | -| 195 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 196 | Summary: lang:core; ::with_copy; Argument[0].ReturnValue; ReturnValue; value | -| 197 | Summary: lang:core; ::align; Argument[self]; ReturnValue; value | -| 198 | Summary: lang:core; ::alternate; Argument[self]; ReturnValue; value | -| 199 | Summary: lang:core; ::debug_as_hex; Argument[self]; ReturnValue; value | -| 200 | Summary: lang:core; ::fill; Argument[self]; ReturnValue; value | -| 201 | Summary: lang:core; ::precision; Argument[self]; ReturnValue; value | -| 202 | Summary: lang:core; ::sign; Argument[self]; ReturnValue; value | -| 203 | Summary: lang:core; ::sign_aware_zero_pad; Argument[self]; ReturnValue; value | -| 204 | Summary: lang:core; ::width; Argument[self]; ReturnValue; value | -| 205 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 206 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 207 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | -| 208 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 209 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 210 | Summary: lang:core; ::key; Argument[self]; ReturnValue; value | -| 211 | Summary: lang:core; ::key_with; Argument[self]; ReturnValue; value | -| 212 | Summary: lang:core; ::value; Argument[self]; ReturnValue; value | -| 213 | Summary: lang:core; ::value_with; Argument[self]; ReturnValue; value | -| 214 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 215 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 216 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | -| 217 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | -| 218 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | -| 219 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | -| 220 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | -| 221 | Summary: lang:core; ::into_inner; Argument[self].Field[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 222 | Summary: lang:core; ::clear; Argument[self]; ReturnValue; value | -| 223 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | -| 224 | Summary: lang:core; ::advance; Argument[self]; ReturnValue; value | -| 225 | Summary: lang:core; ::advance_unchecked; Argument[self]; ReturnValue; value | -| 226 | Summary: lang:core; ::ensure_init; Argument[self]; ReturnValue; value | -| 227 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | -| 228 | Summary: lang:core; ::fold; Argument[0].Field[0]; ReturnValue; value | -| 229 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 230 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 231 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 232 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 233 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | -| 234 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | -| 235 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | -| 236 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 237 | Summary: lang:core; ::rfold; Argument[self].Field[0].Field[0]; ReturnValue; value | -| 238 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 239 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 240 | Summary: lang:core; ::try_rfold; Argument[self].Field[0]; ReturnValue; value | -| 241 | Summary: lang:core; ::fold; Argument[self].Field[0].Field[0]; ReturnValue; value | -| 242 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 243 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 244 | Summary: lang:core; ::try_fold; Argument[self].Field[0]; ReturnValue; value | -| 245 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 246 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 247 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 248 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 249 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 250 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 251 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 252 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 253 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 254 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 255 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 256 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 257 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 258 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 259 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 260 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 261 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 262 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 263 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 264 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 265 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 266 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 267 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 268 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 269 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 270 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 271 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 272 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 273 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 274 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 275 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 276 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 277 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 278 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 279 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 280 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 281 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 282 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 283 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 284 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 285 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 286 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 287 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 288 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 289 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 290 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 291 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 292 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 293 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 294 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 295 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 296 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 297 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 298 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 299 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 300 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 301 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 302 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 303 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 304 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 305 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 306 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 307 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 308 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 309 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 310 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 311 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 312 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 313 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 314 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 315 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 316 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 317 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 318 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 319 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 320 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 321 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 322 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 323 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 324 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 325 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 326 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 327 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 328 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 329 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 330 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 331 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 332 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 333 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 334 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 335 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 336 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 337 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 338 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 339 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 340 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 341 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 342 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 343 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 344 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 345 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 346 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 347 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 348 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 349 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 350 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 351 | Summary: lang:core; ::fold; Argument[0]; Argument[1].Parameter[0]; value | -| 352 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 353 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 354 | Summary: lang:core; ::try_fold; Argument[0]; Argument[1].Parameter[0]; value | -| 355 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 356 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 357 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 358 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 359 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 360 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 361 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 362 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 363 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 364 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 365 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 366 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 367 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 368 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 369 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 370 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 371 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 372 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 373 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 374 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 375 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 376 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 377 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 378 | Summary: lang:core; ::spec_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 379 | Summary: lang:core; ::spec_rfold; Argument[0]; ReturnValue; value | -| 380 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 381 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | -| 382 | Summary: lang:core; ::spec_try_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 383 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | -| 384 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 385 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 386 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 387 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 388 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 389 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | -| 390 | Summary: lang:core; ::rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 391 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 392 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 393 | Summary: lang:core; ::try_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 394 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 395 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 396 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 397 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 398 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 399 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 400 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 401 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 402 | Summary: lang:core; ::spec_fold; Argument[0].Field[0]; ReturnValue; value | -| 403 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 404 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 405 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 406 | Summary: lang:core; ::rfold; Argument[0].ReturnValue; ReturnValue; value | -| 407 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 408 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 409 | Summary: lang:core; ::rfold; Argument[self].Field[0]; ReturnValue; value | -| 410 | Summary: lang:core; ::rfold; Argument[self]; ReturnValue; value | -| 411 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 412 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 413 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 414 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | -| 415 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | -| 416 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | -| 417 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 418 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 419 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 420 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 421 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 422 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 423 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 424 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 425 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 426 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 427 | Summary: lang:core; ::nth_back; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 428 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 429 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 430 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 431 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 432 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 433 | Summary: lang:core; ::to_canonical; Argument[self].Reference; ReturnValue; value | -| 434 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | -| 435 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | -| 436 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | -| 437 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | -| 438 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | -| 439 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | -| 440 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | -| 441 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | -| 442 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | -| 443 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | -| 444 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | -| 445 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | -| 446 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | -| 447 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 448 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | -| 449 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | -| 450 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | -| 451 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | -| 452 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | -| 453 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | -| 454 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | -| 455 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 456 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 457 | Summary: lang:core; ::from_mut_unchecked; Argument[0]; ReturnValue; value | -| 458 | Summary: lang:core; ::new_unchecked; Argument[0]; ReturnValue; value | -| 459 | Summary: lang:core; ::get; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 460 | Summary: lang:core; ::get_mut; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 461 | Summary: lang:core; ::get_unchecked; Argument[0]; ReturnValue; value | -| 462 | Summary: lang:core; ::get_unchecked_mut; Argument[0]; ReturnValue; value | -| 463 | Summary: lang:core; ::index; Argument[0]; ReturnValue; value | -| 464 | Summary: lang:core; ::index_mut; Argument[0]; ReturnValue; value | -| 465 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | -| 466 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | -| 467 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 468 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 469 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 470 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 471 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 472 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 473 | Summary: lang:core; ::wrap_mut_1; Argument[0]; ReturnValue; value | -| 474 | Summary: lang:core; ::wrap_mut_2; Argument[0]; ReturnValue; value | -| 475 | Summary: lang:core; ::clone; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 476 | Summary: lang:core; ::from; Argument[0].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 477 | Summary: lang:core; ::from; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 478 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 479 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | -| 480 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | -| 481 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 482 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 483 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 484 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 485 | Summary: lang:core; ::cloned; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 486 | Summary: lang:core; ::copied; Argument[self].Field[crate::option::Option::Some(0)].Reference; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 487 | Summary: lang:core; ::expect; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 488 | Summary: lang:core; ::flatten; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 489 | Summary: lang:core; ::get_or_insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 490 | Summary: lang:core; ::get_or_insert; Argument[0]; ReturnValue.Reference; value | -| 491 | Summary: lang:core; ::get_or_insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 492 | Summary: lang:core; ::get_or_insert_default; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 493 | Summary: lang:core; ::get_or_insert_with; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 494 | Summary: lang:core; ::insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 495 | Summary: lang:core; ::insert; Argument[0]; ReturnValue.Reference; value | -| 496 | Summary: lang:core; ::insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 497 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | -| 498 | Summary: lang:core; ::is_none_or; Argument[0].ReturnValue; ReturnValue; value | -| 499 | Summary: lang:core; ::is_none_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 500 | Summary: lang:core; ::is_some_and; Argument[0].ReturnValue; ReturnValue; value | -| 501 | Summary: lang:core; ::is_some_and; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 502 | Summary: lang:core; ::map; Argument[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 503 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 504 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 505 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 506 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 507 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | -| 508 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | -| 509 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 510 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 511 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 512 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | -| 513 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 514 | Summary: lang:core; ::ok_or; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 515 | Summary: lang:core; ::ok_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 516 | Summary: lang:core; ::ok_or_else; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 517 | Summary: lang:core; ::ok_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 518 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | -| 519 | Summary: lang:core; ::or; Argument[self]; ReturnValue; value | -| 520 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | -| 521 | Summary: lang:core; ::or_else; Argument[self]; ReturnValue; value | -| 522 | Summary: lang:core; ::replace; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 523 | Summary: lang:core; ::replace; Argument[self].Reference; ReturnValue; value | -| 524 | Summary: lang:core; ::take; Argument[self].Reference; ReturnValue; value | -| 525 | Summary: lang:core; ::take_if; Argument[self].Reference.Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0].Reference; value | -| 526 | Summary: lang:core; ::take_if; Argument[self].Reference; ReturnValue; value | -| 527 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 528 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; value | -| 529 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 530 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | -| 531 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 532 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 533 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 534 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 535 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 536 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[0].Field[crate::option::Option::Some(0)]; value | -| 537 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[1]; ReturnValue.Field[1].Field[crate::option::Option::Some(0)]; value | -| 538 | Summary: lang:core; ::xor; Argument[0]; ReturnValue; value | -| 539 | Summary: lang:core; ::xor; Argument[self]; ReturnValue; value | -| 540 | Summary: lang:core; ::zip; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 541 | Summary: lang:core; ::zip; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 542 | Summary: lang:core; ::zip_with; Argument[0].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[1]; value | -| 543 | Summary: lang:core; ::zip_with; Argument[1].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 544 | Summary: lang:core; ::zip_with; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 545 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 546 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 547 | Summary: lang:core; ::max; Argument[0]; ReturnValue; value | -| 548 | Summary: lang:core; ::max; Argument[1]; ReturnValue; value | -| 549 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 550 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 551 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 552 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 553 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 554 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 555 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 556 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | -| 557 | Summary: lang:core; ::and; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 558 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | -| 559 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 560 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | -| 561 | Summary: lang:core; ::as_deref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 562 | Summary: lang:core; ::as_deref_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 563 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 564 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 565 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 566 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 567 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 568 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 569 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 570 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Ok(0)].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 571 | Summary: lang:core; ::err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 572 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 573 | Summary: lang:core; ::expect_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 574 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 575 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 576 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | -| 577 | Summary: lang:core; ::inspect_err; Argument[self]; ReturnValue; value | -| 578 | Summary: lang:core; ::into_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 579 | Summary: lang:core; ::into_ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 580 | Summary: lang:core; ::is_err_and; Argument[0].ReturnValue; ReturnValue; value | -| 581 | Summary: lang:core; ::is_err_and; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 582 | Summary: lang:core; ::is_ok_and; Argument[0].ReturnValue; ReturnValue; value | -| 583 | Summary: lang:core; ::is_ok_and; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | -| 584 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 585 | Summary: lang:core; ::map_err; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 586 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 587 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 588 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | -| 589 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | -| 590 | Summary: lang:core; ::map_or; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | -| 591 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 592 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | -| 593 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 594 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | -| 595 | Summary: lang:core; ::ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 596 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | -| 597 | Summary: lang:core; ::or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 598 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | -| 599 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 600 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 601 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; value | -| 602 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; value | -| 603 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 604 | Summary: lang:core; ::unwrap_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 605 | Summary: lang:core; ::unwrap_err_unchecked; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 606 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | -| 607 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 608 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 609 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 610 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)].Reference; ReturnValue; value | -| 611 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 612 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 613 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 614 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 615 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 616 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 617 | Summary: lang:core; ::collect; Argument[self].Element; ReturnValue.Element; value | -| 618 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 619 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 620 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 621 | Summary: lang:core; ::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | -| 622 | Summary: lang:core; ::map; Argument[self].Element; Argument[0].Parameter[0]; value | -| 623 | Summary: lang:core; ::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 624 | Summary: lang:core; ::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 625 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 626 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 627 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 628 | Summary: lang:core; ::call; Argument[0].Field[0]; ReturnValue; value | -| 629 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 630 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 631 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 632 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 633 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 634 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 635 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 636 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 637 | Summary: lang:core; ::matching; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 638 | Summary: lang:core; ::matching; Argument[1]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 639 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 640 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 641 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 642 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 643 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 644 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 645 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 646 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 647 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 648 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 649 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 650 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 651 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 652 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 653 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 654 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 655 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 656 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 657 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 658 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 659 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 660 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 661 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 662 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 663 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 664 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 665 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 666 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 667 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 668 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 669 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 670 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 671 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 672 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 673 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 674 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 675 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 676 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 677 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 678 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 679 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 680 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 681 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 682 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 683 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 684 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 685 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 686 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 687 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 688 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 689 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 690 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 691 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 692 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 693 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 694 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 695 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 696 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 697 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 698 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 699 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 700 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 701 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 702 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 703 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 704 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 705 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 706 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 707 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 708 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 709 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 710 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 711 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 712 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 713 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 714 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 715 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 716 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 717 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 718 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 719 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 720 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 721 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 722 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 723 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 724 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 725 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 726 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 727 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 728 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 729 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 730 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 731 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 732 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 733 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 734 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 735 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 736 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 737 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 738 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 739 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 740 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 741 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 742 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 743 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 744 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 745 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 746 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 747 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 748 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 749 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 750 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 751 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 752 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 753 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 754 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 755 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 756 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 757 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 758 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 759 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 760 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 761 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 762 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 763 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 764 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 765 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 766 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 767 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 768 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 769 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 770 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 771 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 772 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 773 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 774 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 775 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 776 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 777 | Summary: lang:core; ::as_mut; Argument[self]; ReturnValue; value | -| 778 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 779 | Summary: lang:core; ::as_str; Argument[self]; ReturnValue; value | -| 780 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 781 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 782 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 783 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 784 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 785 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 786 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 787 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 788 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 789 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 790 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 791 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 792 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 793 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 794 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 795 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 796 | Summary: lang:core; ::index; Argument[0].Reference.Element; ReturnValue.Reference; value | -| 797 | Summary: lang:core; ::index_mut; Argument[0].Reference.Element; ReturnValue.Reference; value | -| 798 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 799 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 800 | Summary: lang:core; crate::array::drain::drain_array_with; Argument[1].ReturnValue; ReturnValue; value | -| 801 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | -| 802 | Summary: lang:core; crate::cmp::max; Argument[1]; ReturnValue; value | -| 803 | Summary: lang:core; crate::cmp::max_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 804 | Summary: lang:core; crate::cmp::max_by; Argument[0]; ReturnValue; value | -| 805 | Summary: lang:core; crate::cmp::max_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 806 | Summary: lang:core; crate::cmp::max_by; Argument[1]; ReturnValue; value | -| 807 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 808 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; ReturnValue; value | -| 809 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 810 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; ReturnValue; value | -| 811 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | -| 812 | Summary: lang:core; crate::cmp::min; Argument[1]; ReturnValue; value | -| 813 | Summary: lang:core; crate::cmp::min_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 814 | Summary: lang:core; crate::cmp::min_by; Argument[0]; ReturnValue; value | -| 815 | Summary: lang:core; crate::cmp::min_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 816 | Summary: lang:core; crate::cmp::min_by; Argument[1]; ReturnValue; value | -| 817 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 818 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; ReturnValue; value | -| 819 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 820 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; ReturnValue; value | -| 821 | Summary: lang:core; crate::cmp::minmax; Argument[0]; ReturnValue.Element; value | -| 822 | Summary: lang:core; crate::cmp::minmax; Argument[1]; ReturnValue.Element; value | -| 823 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 824 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; ReturnValue.Element; value | -| 825 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 826 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; ReturnValue.Element; value | -| 827 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 828 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; ReturnValue.Element; value | -| 829 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 830 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; ReturnValue.Element; value | -| 831 | Summary: lang:core; crate::contracts::build_check_ensures; Argument[0]; ReturnValue; value | -| 832 | Summary: lang:core; crate::convert::identity; Argument[0]; ReturnValue; value | -| 833 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | -| 834 | Summary: lang:core; crate::intrinsics::contract_check_ensures; Argument[0]; Argument[1].Parameter[0]; value | -| 835 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[1]; ReturnValue; value | -| 836 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[2]; ReturnValue; value | -| 837 | Summary: lang:core; crate::iter::traits::iterator::Iterator::collect; Argument[self].Element; ReturnValue.Element; value | -| 838 | Summary: lang:core; crate::iter::traits::iterator::Iterator::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | -| 839 | Summary: lang:core; crate::iter::traits::iterator::Iterator::map; Argument[self].Element; Argument[0].Parameter[0]; value | -| 840 | Summary: lang:core; crate::iter::traits::iterator::Iterator::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 841 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 842 | Summary: lang:core; crate::mem::copy; Argument[0].Reference; ReturnValue; value | -| 843 | Summary: lang:core; crate::mem::replace; Argument[0].Reference; ReturnValue; value | -| 844 | Summary: lang:core; crate::mem::replace; Argument[1]; Argument[0].Reference; value | -| 845 | Summary: lang:core; crate::mem::take; Argument[0].Reference; ReturnValue; value | -| 846 | Summary: lang:core; crate::num::flt2dec::strategy::dragon::mul_pow10; Argument[0]; ReturnValue; value | -| 847 | Summary: lang:core; crate::num::flt2dec::to_exact_exp_str; Argument[5].Element; Argument[0].Parameter[1].Reference; value | -| 848 | Summary: lang:core; crate::num::flt2dec::to_exact_fixed_str; Argument[4].Element; Argument[0].Parameter[1].Reference; value | -| 849 | Summary: lang:core; crate::num::flt2dec::to_shortest_exp_str; Argument[5]; Argument[0].Parameter[1]; value | -| 850 | Summary: lang:core; crate::num::flt2dec::to_shortest_str; Argument[4]; Argument[0].Parameter[1]; value | -| 851 | Summary: lang:core; crate::panic::abort_unwind; Argument[0].ReturnValue; ReturnValue; value | -| 852 | Summary: lang:core; crate::ptr::from_mut; Argument[0]; ReturnValue; value | -| 853 | Summary: lang:core; crate::ptr::from_ref; Argument[0]; ReturnValue; value | -| 854 | Summary: lang:core; crate::ptr::read; Argument[0].Reference; ReturnValue; value | -| 855 | Summary: lang:core; crate::ptr::read_unaligned; Argument[0].Reference; ReturnValue; value | -| 856 | Summary: lang:core; crate::ptr::read_volatile; Argument[0].Reference; ReturnValue; value | -| 857 | Summary: lang:core; crate::ptr::replace; Argument[0].Reference; ReturnValue; value | -| 858 | Summary: lang:core; crate::ptr::write; Argument[1]; Argument[0].Reference; value | -| 859 | Summary: lang:core; crate::ptr::write_unaligned; Argument[1]; Argument[0].Reference; value | -| 860 | Summary: lang:core; crate::ptr::write_volatile; Argument[1]; Argument[0].Reference; value | -| 861 | Summary: lang:core; crate::slice::sort::shared::find_existing_run; Argument[1].ReturnValue; ReturnValue.Field[1]; value | -| 862 | Summary: lang:core; crate::slice::sort::shared::smallsort::sort4_stable; Argument[0].Reference; Argument[2].Parameter[1].Reference; value | -| 863 | Summary: lang:core; crate::str::validations::next_code_point; Argument[0].Element; ReturnValue; value | -| 864 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_lower; Argument[0]; ReturnValue.Element; value | -| 865 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_upper; Argument[0]; ReturnValue.Element; value | -| 866 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | -| 867 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | -| 868 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 869 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; ReturnValue.Reference; value | -| 870 | Summary: lang:proc_macro; <&str as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | -| 871 | Summary: lang:proc_macro; <&str as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | -| 872 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 873 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 874 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 875 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 876 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 877 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 878 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 879 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 880 | Summary: lang:proc_macro; ::into_token_stream; Argument[self]; ReturnValue; value | -| 881 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 882 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 883 | Summary: lang:proc_macro; ::take; Argument[self].Reference; ReturnValue; value | -| 884 | Summary: lang:proc_macro; ::clone; Argument[self].Reference; ReturnValue; value | -| 885 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | -| 886 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | -| 887 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | -| 888 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | -| 889 | Summary: lang:proc_macro; ::next; Argument[self].Field[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 890 | Summary: lang:proc_macro; ::error; Argument[self]; ReturnValue; value | -| 891 | Summary: lang:proc_macro; ::help; Argument[self]; ReturnValue; value | -| 892 | Summary: lang:proc_macro; ::note; Argument[self]; ReturnValue; value | -| 893 | Summary: lang:proc_macro; ::span_error; Argument[self]; ReturnValue; value | -| 894 | Summary: lang:proc_macro; ::span_help; Argument[self]; ReturnValue; value | -| 895 | Summary: lang:proc_macro; ::span_note; Argument[self]; ReturnValue; value | -| 896 | Summary: lang:proc_macro; ::span_warning; Argument[self]; ReturnValue; value | -| 897 | Summary: lang:proc_macro; ::warning; Argument[self]; ReturnValue; value | -| 898 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 899 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 900 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 901 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 902 | Summary: lang:proc_macro; ::into_spans; Argument[self]; ReturnValue; value | -| 903 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 904 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 905 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 906 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 907 | Summary: lang:proc_macro; ::decode; Argument[0].Element; ReturnValue; value | -| 908 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 909 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 910 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 911 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1].ReturnValue; ReturnValue; value | -| 912 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1]; Argument[1].Parameter[0]; value | -| 913 | Summary: lang:proc_macro; crate::bridge::client::state::with; Argument[0].ReturnValue; ReturnValue; value | -| 914 | Summary: lang:std; <&[u8] as crate::io::BufRead>::consume; Argument[self].Element; Argument[self].Reference.Reference; value | -| 915 | Summary: lang:std; <&[u8] as crate::io::BufRead>::fill_buf; Argument[self].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 916 | Summary: lang:std; <&[u8] as crate::io::Read>::read_buf_exact; Argument[self].Element; Argument[self].Reference.Reference; value | -| 917 | Summary: lang:std; <&[u8] as crate::io::Read>::read_exact; Argument[self].Element; Argument[self].Reference.Reference; value | -| 918 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_end; Argument[self].Element; Argument[self].Reference.Reference; value | -| 919 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_string; Argument[self].Element; Argument[self].Reference.Reference; value | -| 920 | Summary: lang:std; <&[u8] as crate::io::copy::BufferedReaderSpec>::copy_to; Argument[self].Element; Argument[self].Reference.Reference; value | -| 921 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | -| 922 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | -| 923 | Summary: lang:std; ::pretty; Argument[self]; ReturnValue; value | -| 924 | Summary: lang:std; ::show_backtrace; Argument[self]; ReturnValue; value | -| 925 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 926 | Summary: lang:std; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 927 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 928 | Summary: lang:std; ::deref; Argument[self].Element; ReturnValue.Reference; value | -| 929 | Summary: lang:std; ::deref_mut; Argument[self].Element; ReturnValue.Reference; value | -| 930 | Summary: lang:std; ::as_os_str; Argument[self]; ReturnValue; value | -| 931 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | -| 932 | Summary: lang:std; ::recursive; Argument[self]; ReturnValue; value | -| 933 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 934 | Summary: lang:std; ::set_created; Argument[self]; ReturnValue; value | -| 935 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 936 | Summary: lang:std; ::set_accessed; Argument[self]; ReturnValue; value | -| 937 | Summary: lang:std; ::set_modified; Argument[self]; ReturnValue; value | -| 938 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 939 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 940 | Summary: lang:std; ::custom_flags; Argument[self]; ReturnValue; value | -| 941 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | -| 942 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 943 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 944 | Summary: lang:std; ::append; Argument[self]; ReturnValue; value | -| 945 | Summary: lang:std; ::create; Argument[self]; ReturnValue; value | -| 946 | Summary: lang:std; ::create_new; Argument[self]; ReturnValue; value | -| 947 | Summary: lang:std; ::read; Argument[self]; ReturnValue; value | -| 948 | Summary: lang:std; ::truncate; Argument[self]; ReturnValue; value | -| 949 | Summary: lang:std; ::write; Argument[self]; ReturnValue; value | -| 950 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 951 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | -| 952 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | -| 953 | Summary: lang:std; ::error; Argument[self].Field[1]; ReturnValue.Reference; value | -| 954 | Summary: lang:std; ::into_error; Argument[self].Field[1]; ReturnValue; value | -| 955 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 956 | Summary: lang:std; ::into_parts; Argument[self].Field[0]; ReturnValue.Field[1]; value | -| 957 | Summary: lang:std; ::into_parts; Argument[self].Field[1]; ReturnValue.Field[0]; value | -| 958 | Summary: lang:std; ::from; Argument[0].Field[1]; ReturnValue; value | -| 959 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 960 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 961 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 962 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 963 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 964 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 965 | Summary: lang:std; ::as_fd; Argument[self].Reference; ReturnValue; value | -| 966 | Summary: lang:std; ::new; Argument[0].ReturnValue; ReturnValue; value | -| 967 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 968 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 969 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 970 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 971 | Summary: lang:std; ::as_path; Argument[self]; ReturnValue; value | -| 972 | Summary: lang:std; ::arg0; Argument[self]; ReturnValue; value | -| 973 | Summary: lang:std; ::gid; Argument[self]; ReturnValue; value | -| 974 | Summary: lang:std; ::groups; Argument[self]; ReturnValue; value | -| 975 | Summary: lang:std; ::pre_exec; Argument[self]; ReturnValue; value | -| 976 | Summary: lang:std; ::process_group; Argument[self]; ReturnValue; value | -| 977 | Summary: lang:std; ::uid; Argument[self]; ReturnValue; value | -| 978 | Summary: lang:std; ::arg; Argument[self]; ReturnValue; value | -| 979 | Summary: lang:std; ::args; Argument[self]; ReturnValue; value | -| 980 | Summary: lang:std; ::current_dir; Argument[self]; ReturnValue; value | -| 981 | Summary: lang:std; ::env; Argument[self]; ReturnValue; value | -| 982 | Summary: lang:std; ::env_clear; Argument[self]; ReturnValue; value | -| 983 | Summary: lang:std; ::env_remove; Argument[self]; ReturnValue; value | -| 984 | Summary: lang:std; ::envs; Argument[self]; ReturnValue; value | -| 985 | Summary: lang:std; ::stderr; Argument[self]; ReturnValue; value | -| 986 | Summary: lang:std; ::stdin; Argument[self]; ReturnValue; value | -| 987 | Summary: lang:std; ::stdout; Argument[self]; ReturnValue; value | -| 988 | Summary: lang:std; ::report; Argument[self]; ReturnValue; value | -| 989 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 990 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 991 | Summary: lang:std; ::is_leader; Argument[self].Field[0]; ReturnValue; value | -| 992 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 993 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 994 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 995 | Summary: lang:std; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 996 | Summary: lang:std; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | -| 997 | Summary: lang:std; ::wait; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 998 | Summary: lang:std; ::wait_timeout; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 999 | Summary: lang:std; ::wait_timeout_ms; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 1000 | Summary: lang:std; ::wait_timeout_while; Argument[0].Reference; Argument[2].Parameter[0].Reference; value | -| 1001 | Summary: lang:std; ::wait_timeout_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 1002 | Summary: lang:std; ::wait_while; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 1003 | Summary: lang:std; ::wait_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1004 | Summary: lang:std; ::timed_out; Argument[self].Field[0]; ReturnValue; value | -| 1005 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1006 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1007 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1008 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1009 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1010 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1011 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1012 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1013 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1014 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1015 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1016 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1017 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1018 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1019 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1020 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1021 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1022 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1023 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1024 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1025 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1026 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1027 | Summary: lang:std; ::as_file_desc; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1028 | Summary: lang:std; ::into_raw; Argument[self].Field[0]; ReturnValue; value | -| 1029 | Summary: lang:std; ::index; Argument[self]; ReturnValue; value | -| 1030 | Summary: lang:std; ::into_string; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1031 | Summary: lang:std; ::name; Argument[self]; ReturnValue; value | -| 1032 | Summary: lang:std; ::no_hooks; Argument[self]; ReturnValue; value | -| 1033 | Summary: lang:std; ::stack_size; Argument[self]; ReturnValue; value | -| 1034 | Summary: lang:std; ::as_u64; Argument[self].Field[0]; ReturnValue; value | -| 1035 | Summary: lang:std; ::try_with; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1036 | Summary: lang:std; ::with; Argument[0].ReturnValue; ReturnValue; value | -| 1037 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1038 | Summary: lang:std; ::duration; Argument[self].Field[0]; ReturnValue; value | -| 1039 | Summary: lang:std; ::as_raw_fd; Argument[self].Reference; ReturnValue; value | -| 1040 | Summary: lang:std; ::from_raw_fd; Argument[0]; ReturnValue; value | -| 1041 | Summary: lang:std; ::into_raw_fd; Argument[self]; ReturnValue; value | -| 1042 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::as_str; Argument[self].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 1043 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::get; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1044 | Summary: lang:std; <{491}::RewrapBox as crate::panic::PanicPayload>::get; Argument[self].Field[0].Reference; ReturnValue.Reference; value | -| 1045 | Summary: lang:std; crate::backtrace::helper::lazy_resolve; Argument[0]; ReturnValue; value | -| 1046 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1047 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue; ReturnValue; value | -| 1048 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1049 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1050 | Summary: lang:std; crate::io::default_read_vectored; Argument[0].ReturnValue; ReturnValue; value | -| 1051 | Summary: lang:std; crate::io::default_write_vectored; Argument[0].ReturnValue; ReturnValue; value | -| 1052 | Summary: lang:std; crate::sys::backtrace::__rust_begin_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | -| 1053 | Summary: lang:std; crate::sys::backtrace::__rust_end_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | -| 1054 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_path_with_cstr; Argument[1].ReturnValue; ReturnValue; value | -| 1055 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_with_cstr; Argument[1].ReturnValue; ReturnValue; value | -| 1056 | Summary: lang:std; crate::sys::pal::unix::cvt; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1057 | Summary: lang:std; crate::sys_common::ignore_notfound; Argument[0].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1058 | Summary: lang:std; crate::thread::current::set_current; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1059 | Summary: lang:std; crate::thread::current::try_with_current; Argument[0].ReturnValue; ReturnValue; value | -| 1060 | Summary: lang:std; crate::thread::with_current_name; Argument[0].ReturnValue; ReturnValue; value | -| 1061 | Summary: repo:https://github.com/rust-lang/futures-rs:futures-executor; crate::local_pool::block_on; Argument[0]; ReturnValue; value | storeStep | file://:0:0:0:0 | [summary] to write: Argument[0].Field[crate::option::Option::Some(0)] in lang:core::_::::zip_with | Some | file://:0:0:0:0 | [post] [summary param] 0 in lang:core::_::::zip_with | | file://:0:0:0:0 | [summary] to write: Argument[0].Parameter[0].Reference in lang:alloc::_::::retain | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Parameter[0] in lang:alloc::_::::retain | diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql index 6d81896d2291..396a4b7caa8f 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql @@ -6,8 +6,6 @@ private predicate provenance(string model) { RustDataFlow::simpleLocalFlowStep(_ private module Tm = TranslateModels; -query predicate models = Tm::models/2; - query predicate localStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) { // Local flow steps that don't originate from a flow summary. RustDataFlow::simpleLocalFlowStep(nodeFrom, nodeTo, "") From 32f191cd9d0f48d61f605933c5a6de9dca5babf9 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 13:21:59 -0700 Subject: [PATCH 088/240] Docs: Remove public preview notice for Actions support Ready for GA. --- docs/codeql/reusables/supported-versions-compilers.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/codeql/reusables/supported-versions-compilers.rst b/docs/codeql/reusables/supported-versions-compilers.rst index 7d5a9bdb34ab..bbefaf79ccef 100644 --- a/docs/codeql/reusables/supported-versions-compilers.rst +++ b/docs/codeql/reusables/supported-versions-compilers.rst @@ -16,7 +16,7 @@ .NET Core up to 3.1 .NET 5, .NET 6, .NET 7, .NET 8, .NET 9","``.sln``, ``.csproj``, ``.cs``, ``.cshtml``, ``.xaml``" - GitHub Actions [12]_,"Not applicable",Not applicable,"``.github/workflows/*.yml``, ``.github/workflows/*.yaml``, ``**/action.yml``, ``**/action.yaml``" + GitHub Actions,"Not applicable",Not applicable,"``.github/workflows/*.yml``, ``.github/workflows/*.yaml``, ``**/action.yml``, ``**/action.yaml``" Go (aka Golang), "Go up to 1.24", "Go 1.11 or more recent", ``.go`` Java,"Java 7 to 24 [5]_","javac (OpenJDK and Oracle JDK), @@ -41,4 +41,3 @@ .. [9] Requires glibc 2.17. .. [10] Support for the analysis of Swift requires macOS. .. [11] TypeScript analysis is performed by running the JavaScript extractor with TypeScript enabled. This is the default. - .. [12] Support for GitHub Actions is in public preview. From eeb938a76de013fcacda6ccf0708f72e1c911125 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 13:25:54 -0700 Subject: [PATCH 089/240] Docs: Minor fixes for Actions query help --- actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md | 2 +- actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md b/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md index cc35402b804d..5d2c61150972 100644 --- a/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md +++ b/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md @@ -109,7 +109,7 @@ An attacker could craft a malicious artifact that writes dangerous environment v ### Exploitation -An attacker is be able to run arbitrary code by injecting environment variables such as `LD_PRELOAD`, `BASH_ENV`, etc. +An attacker would be able to run arbitrary code by injecting environment variables such as `LD_PRELOAD`, `BASH_ENV`, etc. ## References diff --git a/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md b/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md index 6c681856a7b3..c33b89fdcec6 100644 --- a/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md +++ b/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md @@ -2,11 +2,11 @@ ## Description -Secrets derived from other secrets are not know to the workflow runner and therefore not masked unless explicitly registered. +Secrets derived from other secrets are not known to the workflow runner, and therefore are not masked unless explicitly registered. ## Recommendations -Avoid defining non-plain secrets. For example, do not define a new secret containing a JSON object and then read properties out of it from the workflow since these read values will not be masked by the workflow runner. +Avoid defining non-plain secrets. For example, do not define a new secret containing a JSON object and then read properties out of it from the workflow, since these read values will not be masked by the workflow runner. ## Examples From 93fbb9fe6155de2d0ca44448ae930f3b3597b5d5 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 14:39:31 -0700 Subject: [PATCH 090/240] Actions: Update description of missing permissions query --- actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql b/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql index aedf65bc564e..a8bd8a5f93dc 100644 --- a/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql +++ b/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql @@ -1,6 +1,6 @@ /** * @name Workflow does not contain permissions - * @description Workflows should contain permissions to provide a clear understanding has permissions to run the workflow. + * @description Workflows should contain explicit permissions to restrict the scope of the default GITHUB_TOKEN. * @kind problem * @security-severity 5.0 * @problem.severity warning From 6eb060f16a2a16075ffa50bc28d16b8da553a394 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 14:41:08 -0700 Subject: [PATCH 091/240] Actions: Add security-severity to excessive secrets exposure query Same value as missing actions permissions, both providing warnings to follow the principle of least privilege within a workflow. --- actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql | 1 + 1 file changed, 1 insertion(+) diff --git a/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql b/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql index a83685207bc2..1a01033c5676 100644 --- a/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql +++ b/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql @@ -3,6 +3,7 @@ * @description All organization and repository secrets are passed to the workflow runner. * @kind problem * @precision high + * @security-severity 5.0 * @problem.severity warning * @id actions/excessive-secrets-exposure * @tags actions From f9103f8ddc3b09a80ec8a5dbffaee3f54f38e493 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 14:48:33 -0700 Subject: [PATCH 092/240] Actions: Add change note for missing severity --- ...025-04-14-excessive-secrets-exposure-security-severity.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md diff --git a/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md b/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md new file mode 100644 index 000000000000..9beaabecbe65 --- /dev/null +++ b/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md @@ -0,0 +1,5 @@ +--- +category: fix +--- +* Assigned a `security-severity` to the query `actions + excessive-secrets-exposure`. \ No newline at end of file From 0b10d34cae0ca325a93e5c90b25186d4779754a4 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 10:53:40 +0200 Subject: [PATCH 093/240] C#: Add change note. --- .../2025-04-15-missing-function-level-access-control.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md diff --git a/csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md b/csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md new file mode 100644 index 000000000000..dbea56dbeb84 --- /dev/null +++ b/csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Improved detection of authorization checks in the `cs/web/missing-function-level-access-control` query. The query now recognizes authorization attributes inherited from base classes and interfaces. From 033bade0ab815ca92c71cccec6ec7b9a921bb59f Mon Sep 17 00:00:00 2001 From: idrissrio Date: Mon, 14 Apr 2025 09:14:36 +0200 Subject: [PATCH 094/240] C++: add isVLA() to ArrayType to identify variable-length arrays --- cpp/ql/lib/semmle/code/cpp/Type.qll | 5 +++++ cpp/ql/lib/semmlecode.cpp.dbscheme | 2 ++ 2 files changed, 7 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/Type.qll b/cpp/ql/lib/semmle/code/cpp/Type.qll index 9c33dbec1b59..fbc894a7e075 100644 --- a/cpp/ql/lib/semmle/code/cpp/Type.qll +++ b/cpp/ql/lib/semmle/code/cpp/Type.qll @@ -1369,6 +1369,11 @@ class ArrayType extends DerivedType { override predicate isDeeplyConst() { this.getBaseType().isDeeplyConst() } // No such thing as a const array type override predicate isDeeplyConstBelow() { this.getBaseType().isDeeplyConst() } + + /** + * Holds if this array is a variable-length array (VLA). + */ + predicate isVla() { type_is_vla(underlyingElement(this)) } } /** diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme b/cpp/ql/lib/semmlecode.cpp.dbscheme index e594389175c0..0f0a390468a5 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme @@ -2178,6 +2178,8 @@ variable_vla( int decl: @stmt_vla_decl ref ); +type_is_vla(unique int type_id: @derivedtype ref) + if_initialization( unique int if_stmt: @stmt_if ref, int init_id: @stmt ref From 15ba9e0c66583233647868ff44abc525afcf0f67 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Mon, 14 Apr 2025 09:20:15 +0200 Subject: [PATCH 095/240] C++: add change note for VLAs --- cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md diff --git a/cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md b/cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md new file mode 100644 index 000000000000..e7e6cfb849e8 --- /dev/null +++ b/cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Added the `isVla()` predicate to the `ArrayType` class. This allows queries to identify variable-length arrays (VLAs). \ No newline at end of file From ae07272c44a8d226f1278ad5271c04f17b5efab7 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Tue, 15 Apr 2025 11:08:58 +0200 Subject: [PATCH 096/240] C++: add upgrade and downgrade scripts --- .../old.dbscheme | 2446 +++++++++++++++++ .../semmlecode.cpp.dbscheme | 2444 ++++++++++++++++ .../upgrade.properties | 3 + .../old.dbscheme | 2444 ++++++++++++++++ .../semmlecode.cpp.dbscheme | 2446 +++++++++++++++++ .../upgrade.properties | 2 + 6 files changed, 9785 insertions(+) create mode 100644 cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme create mode 100644 cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme create mode 100644 cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties create mode 100644 cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/old.dbscheme create mode 100644 cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme create mode 100644 cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties diff --git a/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme new file mode 100644 index 000000000000..0f0a390468a5 --- /dev/null +++ b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme @@ -0,0 +1,2446 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..e594389175c0 --- /dev/null +++ b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme @@ -0,0 +1,2444 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties new file mode 100644 index 000000000000..92a9acc13277 --- /dev/null +++ b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties @@ -0,0 +1,3 @@ +description: Add a new predicate `isVla()` to the `ArrayType` class +compatibility: full +type_is_vla.rel: delete \ No newline at end of file diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/old.dbscheme b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/old.dbscheme new file mode 100644 index 000000000000..e594389175c0 --- /dev/null +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/old.dbscheme @@ -0,0 +1,2444 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..0f0a390468a5 --- /dev/null +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme @@ -0,0 +1,2446 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties new file mode 100644 index 000000000000..f6105ce157b4 --- /dev/null +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties @@ -0,0 +1,2 @@ +description: Add a new predicate `isVla()` to the `ArrayType` class +compatibility: backwards \ No newline at end of file From bfe9cdfed5220d337d79b024851e9c473e73c992 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:53:01 +0100 Subject: [PATCH 097/240] Rust: Add model for str.trim and as_bytes. --- .../rust/frameworks/stdlib/lang-core.model.yml | 2 ++ .../CWE-328/WeakSensitiveDataHashing.expected | 14 ++++++++++++++ rust/ql/test/query-tests/security/CWE-328/test.rs | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml index 69c5a1f3ba49..d0e77aec0eef 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml @@ -26,6 +26,8 @@ extensions: - ["lang:core", "crate::ptr::write_volatile", "Argument[1]", "Argument[0].Reference", "value", "manual"] # Str - ["lang:core", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:core", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] + - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - addsTo: pack: codeql/rust-all extensible: sourceModel diff --git a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected index 69e03bcca1ca..fed054703977 100644 --- a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected +++ b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected @@ -12,6 +12,8 @@ | test.rs:62:9:62:24 | ...::digest | test.rs:62:26:62:37 | password_arr | test.rs:62:9:62:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:62:26:62:37 | password_arr | Sensitive data (password) | | test.rs:64:9:64:24 | ...::digest | test.rs:64:26:64:37 | password_vec | test.rs:64:9:64:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:64:26:64:37 | password_vec | Sensitive data (password) | | test.rs:77:9:77:33 | ...::new_with_prefix | test.rs:77:35:77:42 | password | test.rs:77:9:77:33 | ...::new_with_prefix | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:77:35:77:42 | password | Sensitive data (password) | +| test.rs:81:9:81:24 | ...::digest | test.rs:81:26:81:33 | password | test.rs:81:9:81:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:81:26:81:33 | password | Sensitive data (password) | +| test.rs:83:9:83:24 | ...::digest | test.rs:83:26:83:33 | password | test.rs:83:9:83:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:83:26:83:33 | password | Sensitive data (password) | edges | test.rs:14:26:14:39 | credit_card_no | test.rs:14:9:14:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | | test.rs:15:26:15:33 | password | test.rs:15:9:15:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | @@ -26,10 +28,16 @@ edges | test.rs:62:26:62:37 | password_arr | test.rs:62:9:62:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | | test.rs:64:26:64:37 | password_vec | test.rs:64:9:64:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | | test.rs:77:35:77:42 | password | test.rs:77:9:77:33 | ...::new_with_prefix | provenance | MaD:2 Sink:MaD:2 | +| test.rs:81:26:81:33 | password | test.rs:81:26:81:40 | password.trim() [&ref] | provenance | MaD:5 | +| test.rs:81:26:81:40 | password.trim() [&ref] | test.rs:81:9:81:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | +| test.rs:83:26:83:33 | password | test.rs:83:26:83:44 | password.as_bytes() [&ref] | provenance | MaD:4 | +| test.rs:83:26:83:44 | password.as_bytes() [&ref] | test.rs:83:9:83:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | models | 1 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::digest; hasher-input; Argument[0] | | 2 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::new_with_prefix; hasher-input; Argument[0] | | 3 | Sink: repo:https://github.com/stainless-steel/md5:md5; crate::compute; hasher-input; Argument[0] | +| 4 | Summary: lang:core; ::as_bytes; Argument[self]; ReturnValue.Reference; taint | +| 5 | Summary: lang:core; ::trim; Argument[self]; ReturnValue.Reference; taint | nodes | test.rs:14:9:14:24 | ...::digest | semmle.label | ...::digest | | test.rs:14:26:14:39 | credit_card_no | semmle.label | credit_card_no | @@ -57,4 +65,10 @@ nodes | test.rs:64:26:64:37 | password_vec | semmle.label | password_vec | | test.rs:77:9:77:33 | ...::new_with_prefix | semmle.label | ...::new_with_prefix | | test.rs:77:35:77:42 | password | semmle.label | password | +| test.rs:81:9:81:24 | ...::digest | semmle.label | ...::digest | +| test.rs:81:26:81:33 | password | semmle.label | password | +| test.rs:81:26:81:40 | password.trim() [&ref] | semmle.label | password.trim() [&ref] | +| test.rs:83:9:83:24 | ...::digest | semmle.label | ...::digest | +| test.rs:83:26:83:33 | password | semmle.label | password | +| test.rs:83:26:83:44 | password.as_bytes() [&ref] | semmle.label | password.as_bytes() [&ref] | subpaths diff --git a/rust/ql/test/query-tests/security/CWE-328/test.rs b/rust/ql/test/query-tests/security/CWE-328/test.rs index bb7316b3dce6..56b6fe7821d9 100644 --- a/rust/ql/test/query-tests/security/CWE-328/test.rs +++ b/rust/ql/test/query-tests/security/CWE-328/test.rs @@ -78,9 +78,9 @@ fn test_hash_code_patterns( // hash transformed data _ = md5::Md5::digest(harmless.trim()); - _ = md5::Md5::digest(password.trim()); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password.trim()); // $ Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::digest(harmless.as_bytes()); - _ = md5::Md5::digest(password.as_bytes()); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password.as_bytes()); // $ Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::digest(std::str::from_utf8(harmless_arr).unwrap()); _ = md5::Md5::digest(std::str::from_utf8(password_arr).unwrap()); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] } From 9170993cf03b4aafdae85c9ee8c86694725ad1ed Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 12:46:31 +0200 Subject: [PATCH 098/240] C#: Adjust comments and remove compilation warnings. --- csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs index 37a8feee186c..32c5cdeca28d 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs @@ -34,9 +34,9 @@ private static bool AnyElement(XmlNodeList l, Func f) => /// /// According to https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2022#reference-a-project-sdk /// there are three ways to reference a project SDK: - /// 1. As an attribute on the . - /// 2. As a top level element of . - /// 3. As an attribute on an element. + /// 1. As an attribute on the <Project/>. + /// 2. As a top level element of <Project>. + /// 3. As an attribute on an <Import> element. /// /// Returns true, if the Sdk attribute is used, otherwise false. /// From c06f340bd8972a995752880abaa9f6ef9762e8f0 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 15 Apr 2025 11:42:22 +0100 Subject: [PATCH 099/240] Rust: Make str / String models consistent. --- .../codeql/rust/frameworks/stdlib/lang-alloc.model.yml | 2 ++ .../lib/codeql/rust/frameworks/stdlib/lang-core.model.yml | 4 +++- .../security/CWE-328/WeakSensitiveDataHashing.expected | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml index fba9ae5fea33..549a7afdad36 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml @@ -9,6 +9,8 @@ extensions: - ["lang:alloc", "::as_str", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:alloc", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:alloc", "<_ as crate::string::ToString>::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:alloc", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:alloc", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - addsTo: pack: codeql/rust-all extensible: sourceModel diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml index d0e77aec0eef..fe34df885517 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml @@ -25,9 +25,11 @@ extensions: - ["lang:core", "crate::ptr::write_unaligned", "Argument[1]", "Argument[0].Reference", "value", "manual"] - ["lang:core", "crate::ptr::write_volatile", "Argument[1]", "Argument[0].Reference", "value", "manual"] # Str + - ["lang:core", "::as_str", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:core", "::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:core", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] - ["lang:core", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - addsTo: pack: codeql/rust-all extensible: sourceModel diff --git a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected index fed054703977..d2ea36bbebf8 100644 --- a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected +++ b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected @@ -30,13 +30,13 @@ edges | test.rs:77:35:77:42 | password | test.rs:77:9:77:33 | ...::new_with_prefix | provenance | MaD:2 Sink:MaD:2 | | test.rs:81:26:81:33 | password | test.rs:81:26:81:40 | password.trim() [&ref] | provenance | MaD:5 | | test.rs:81:26:81:40 | password.trim() [&ref] | test.rs:81:9:81:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:83:26:83:33 | password | test.rs:83:26:83:44 | password.as_bytes() [&ref] | provenance | MaD:4 | -| test.rs:83:26:83:44 | password.as_bytes() [&ref] | test.rs:83:9:83:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | +| test.rs:83:26:83:33 | password | test.rs:83:26:83:44 | password.as_bytes() | provenance | MaD:4 | +| test.rs:83:26:83:44 | password.as_bytes() | test.rs:83:9:83:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | models | 1 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::digest; hasher-input; Argument[0] | | 2 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::new_with_prefix; hasher-input; Argument[0] | | 3 | Sink: repo:https://github.com/stainless-steel/md5:md5; crate::compute; hasher-input; Argument[0] | -| 4 | Summary: lang:core; ::as_bytes; Argument[self]; ReturnValue.Reference; taint | +| 4 | Summary: lang:core; ::as_bytes; Argument[self]; ReturnValue; taint | | 5 | Summary: lang:core; ::trim; Argument[self]; ReturnValue.Reference; taint | nodes | test.rs:14:9:14:24 | ...::digest | semmle.label | ...::digest | @@ -70,5 +70,5 @@ nodes | test.rs:81:26:81:40 | password.trim() [&ref] | semmle.label | password.trim() [&ref] | | test.rs:83:9:83:24 | ...::digest | semmle.label | ...::digest | | test.rs:83:26:83:33 | password | semmle.label | password | -| test.rs:83:26:83:44 | password.as_bytes() [&ref] | semmle.label | password.as_bytes() [&ref] | +| test.rs:83:26:83:44 | password.as_bytes() | semmle.label | password.as_bytes() | subpaths From 40a5db6736f3f9212414e2d3786272b800f6a245 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 15 Apr 2025 11:52:23 +0100 Subject: [PATCH 100/240] Rust: Other tests affected. --- .../ql/test/library-tests/dataflow/local/DataFlowStep.expected | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index fcd4d2786106..cf138a824d5b 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -2162,6 +2162,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Err(0)].Reference in lang:core::_::::as_ref | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Err(0)] in lang:core::_::::as_ref | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:alloc::_::::search_tree_for_bifurcation | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::search_tree_for_bifurcation | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:alloc::_::::from_str | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::from_str | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:alloc::_::::parse | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::parse | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::try_insert | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::try_insert | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::ok_or | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::ok_or | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::ok_or_else | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::ok_or_else | @@ -2231,6 +2232,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::as_ref | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::as_ref | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::borrow | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::borrow | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::borrow_mut | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::borrow_mut | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::trim | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::trim | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::borrow | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::borrow | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::as_ref | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::as_ref | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::borrow | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::borrow | @@ -2254,6 +2256,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::insert | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::insert | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::deref | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::deref | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::deref_mut | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::deref_mut | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::trim | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::trim | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::index | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::index | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::index_mut | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::index_mut | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:proc_macro::_::<&[u8] as crate::bridge::rpc::DecodeMut>::decode | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:proc_macro::_::<&[u8] as crate::bridge::rpc::DecodeMut>::decode | From 202040fad44e0b722bbe36a156dceeb1a606a3bb Mon Sep 17 00:00:00 2001 From: idrissrio Date: Tue, 15 Apr 2025 13:36:24 +0200 Subject: [PATCH 101/240] C++: update stats file --- cpp/ql/lib/semmlecode.cpp.dbscheme.stats | 2504 +++++++++++----------- 1 file changed, 1260 insertions(+), 1244 deletions(-) diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats index 5f0f15438374..585e8f31e0a1 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats @@ -18,15 +18,15 @@ @location_default - 31650404 + 31650363 @location_stmt - 5202910 + 5202903 @location_expr - 17958942 + 17958919 @diagnostic @@ -42,35 +42,35 @@ @macro_expansion - 40298943 + 40299208 @other_macro_reference - 314182 + 314184 @function - 3356850 + 3356874 @fun_decl - 3388814 + 3388838 @var_decl - 6734234 + 6734225 @type_decl - 1890757 + 1890777 @namespace_decl - 425651 + 425650 @using_declaration - 333243 + 333244 @using_directive @@ -86,15 +86,15 @@ @parameter - 4798833 + 4798867 @membervariable - 1441780 + 1441778 @globalvariable - 425546 + 425545 @localvariable @@ -334,7 +334,7 @@ @type_with_specifiers - 725883 + 725882 @array @@ -342,11 +342,11 @@ @routineptr - 862680 + 862686 @reference - 1024847 + 1024846 @gnu_vector @@ -370,15 +370,15 @@ @usertype - 4992117 + 4987434 @mangledname - 5808009 + 5807194 @type_mention - 5507865 + 5507858 @concept_template @@ -386,7 +386,7 @@ @routinetype - 762063 + 762068 @ptrtomember @@ -394,7 +394,7 @@ @specifier - 7131 + 8341 @gnuattribute @@ -402,11 +402,11 @@ @stdattribute - 346325 + 346324 @declspec - 326925 + 326924 @msattribute @@ -422,7 +422,7 @@ @attribute_arg_constant_expr - 89599 + 89600 @attribute_arg_expr @@ -442,15 +442,15 @@ @derivation - 599880 + 599885 @frienddecl - 883302 + 883308 @comment - 11290145 + 11290131 @namespace @@ -462,15 +462,15 @@ @namequalifier - 3258064 + 3258067 @value - 14099266 + 14099248 @initialiser - 2336673 + 2336670 @address_of @@ -478,19 +478,19 @@ @indirect - 399728 + 399727 @array_to_pointer - 1951449 + 1951447 @parexpr - 4895384 + 4895377 @arithnegexpr - 585843 + 585842 @unaryplusexpr @@ -506,7 +506,7 @@ @postincrexpr - 84817 + 84816 @postdecrexpr @@ -514,7 +514,7 @@ @preincrexpr - 96451 + 96450 @predecrexpr @@ -522,7 +522,7 @@ @conditionalexpr - 896445 + 896444 @addexpr @@ -530,7 +530,7 @@ @subexpr - 466249 + 466248 @mulexpr @@ -538,7 +538,7 @@ @divexpr - 60351 + 60352 @remexpr @@ -546,7 +546,7 @@ @paddexpr - 118344 + 118343 @psubexpr @@ -558,7 +558,7 @@ @lshiftexpr - 610849 + 610848 @rshiftexpr @@ -566,7 +566,7 @@ @andexpr - 536666 + 536665 @orexpr @@ -578,15 +578,15 @@ @eqexpr - 641622 + 641621 @neexpr - 411385 + 411384 @gtexpr - 110847 + 110846 @ltexpr @@ -594,7 +594,7 @@ @geexpr - 80994 + 80993 @leexpr @@ -602,7 +602,7 @@ @assignexpr - 1277660 + 1277658 @assignaddexpr @@ -658,7 +658,7 @@ @orlogicalexpr - 1203319 + 1203317 @commaexpr @@ -666,11 +666,11 @@ @subscriptexpr - 433959 + 433958 @callexpr - 302410 + 302370 @vastartexpr @@ -690,15 +690,15 @@ @varaccess - 8226118 + 8226107 @runtime_sizeof - 397856 + 397855 @runtime_alignof - 61478 + 61479 @expr_stmt @@ -706,11 +706,11 @@ @routineexpr - 6144464 + 6144489 @type_operand - 1532455 + 1532453 @offsetofexpr @@ -718,11 +718,11 @@ @typescompexpr - 765413 + 765411 @literal - 6101418 + 6101411 @aggregateliteral @@ -730,11 +730,11 @@ @c_style_cast - 6024777 + 6024778 @temp_init - 1075849 + 1076139 @errorexpr @@ -742,11 +742,11 @@ @reference_to - 2194465 + 2194481 @ref_indirect - 2657383 + 2657402 @vacuous_destructor_call @@ -806,11 +806,11 @@ @thisaccess - 1525361 + 1525359 @new_expr - 58256 + 58257 @delete_expr @@ -818,19 +818,19 @@ @throw_expr - 26214 + 26159 @condition_decl - 438290 + 438294 @braced_init_list - 2334 + 2335 @type_id - 60404 + 60405 @sizeof_pack @@ -922,7 +922,7 @@ @uuidof - 27728 + 27727 @delete_array_expr @@ -938,7 +938,7 @@ @ctordirectinit - 142247 + 142248 @ctorvirtualinit @@ -946,7 +946,7 @@ @ctorfieldinit - 259362 + 259364 @ctordelegatinginit @@ -962,11 +962,11 @@ @dtorfielddestruct - 50222 + 50223 @static_cast - 335478 + 335479 @reinterpret_cast @@ -986,7 +986,7 @@ @param_ref - 177918 + 177993 @noopexpr @@ -1090,7 +1090,7 @@ @noexceptexpr - 30759 + 30772 @builtinshufflevector @@ -1262,7 +1262,7 @@ @reuseexpr - 907876 + 907883 @istriviallycopyassignable @@ -1382,11 +1382,11 @@ @stmt_expr - 2026088 + 2026085 @stmt_if - 987521 + 987520 @stmt_while @@ -1394,7 +1394,7 @@ @stmt_goto - 151172 + 151171 @stmt_label @@ -1402,11 +1402,11 @@ @stmt_return - 1515834 + 1515845 @stmt_block - 1897791 + 1897789 @stmt_end_test_while @@ -1418,11 +1418,11 @@ @stmt_switch_case - 896207 + 896214 @stmt_switch - 441450 + 441453 @stmt_asm @@ -1430,11 +1430,11 @@ @stmt_decl - 770893 + 770895 @stmt_empty - 460245 + 460249 @stmt_continue @@ -1442,11 +1442,11 @@ @stmt_break - 140999 + 140998 @stmt_try_block - 29027 + 28973 @stmt_microsoft_try @@ -1470,7 +1470,7 @@ @stmt_handler - 47521 + 47475 @stmt_constexpr_if @@ -1490,7 +1490,7 @@ @ppd_if - 511549 + 511548 @ppd_ifdef @@ -1498,7 +1498,7 @@ @ppd_ifndef - 154178 + 154177 @ppd_elif @@ -1506,19 +1506,19 @@ @ppd_else - 241109 + 241108 @ppd_endif - 846303 + 846302 @ppd_plain_include - 401967 + 408579 @ppd_define - 3130381 + 3130376 @ppd_undef @@ -1558,7 +1558,7 @@ @ppd_warning - 6 + 13 @link_target @@ -1640,7 +1640,7 @@ compilation_args - 1298224 + 1298229 id @@ -1985,7 +1985,7 @@ 2 3 - 16269 + 16270 3 @@ -2221,7 +2221,7 @@ seconds - 17489 + 17407 @@ -2267,7 +2267,7 @@ 2 3 - 203 + 149 3 @@ -2277,7 +2277,7 @@ 4 5 - 7667 + 7721 @@ -2323,8 +2323,8 @@ 12 - 1291 - 1292 + 1285 + 1286 13 @@ -2381,13 +2381,13 @@ 13 - 714 - 715 + 718 + 719 13 - 787 - 788 + 769 + 770 13 @@ -2404,27 +2404,27 @@ 1 2 - 10891 + 10837 2 3 - 3806 + 3617 3 4 - 1463 + 1368 4 - 662 - 1314 + 10 + 1327 - 689 - 690 - 13 + 10 + 694 + 257 @@ -2440,7 +2440,7 @@ 1 2 - 17489 + 17407 @@ -2461,12 +2461,12 @@ 2 3 - 3048 + 2980 3 - 5 - 27 + 4 + 13 @@ -2730,11 +2730,11 @@ cpu_seconds - 11921 + 12083 elapsed_seconds - 243 + 257 @@ -2780,17 +2780,17 @@ 1 2 - 9916 + 10241 2 3 - 1354 + 1246 3 - 42 - 650 + 35 + 596 @@ -2806,12 +2806,12 @@ 1 2 - 11054 + 11365 2 3 - 867 + 717 @@ -2827,66 +2827,61 @@ 1 2 - 40 + 67 2 3 - 27 - - - 5 - 6 13 - 7 - 8 + 3 + 4 13 - 9 - 10 - 27 + 6 + 7 + 13 - 10 - 11 - 13 + 11 + 12 + 54 20 21 - 27 + 13 - 24 - 25 + 31 + 32 13 - 46 - 47 + 43 + 44 13 - 128 - 129 + 127 + 128 13 - 275 - 276 + 265 + 266 13 - 306 - 307 + 321 + 322 13 - 331 - 332 + 330 + 331 13 @@ -2903,61 +2898,61 @@ 1 2 - 40 + 67 2 3 - 27 + 13 - 5 - 6 + 3 + 4 13 - 7 - 8 + 6 + 7 13 - 9 - 10 - 40 + 11 + 12 + 54 20 21 - 27 + 13 - 24 - 25 + 31 + 32 13 - 46 - 47 + 43 + 44 13 - 122 - 123 + 120 + 121 13 - 166 - 167 + 171 + 172 13 - 248 - 249 + 233 + 234 13 - 252 - 253 + 267 + 268 13 @@ -4730,11 +4725,11 @@ locations_default - 31650404 + 31650363 id - 31650404 + 31650363 container @@ -4742,7 +4737,7 @@ startLine - 7709299 + 7709289 startColumn @@ -4750,7 +4745,7 @@ endLine - 7708627 + 7708617 endColumn @@ -4768,7 +4763,7 @@ 1 2 - 31650404 + 31650363 @@ -4784,7 +4779,7 @@ 1 2 - 31650404 + 31650363 @@ -4800,7 +4795,7 @@ 1 2 - 31650404 + 31650363 @@ -4816,7 +4811,7 @@ 1 2 - 31650404 + 31650363 @@ -4832,7 +4827,7 @@ 1 2 - 31650404 + 31650363 @@ -5233,27 +5228,27 @@ 1 2 - 5187073 + 5187066 2 3 - 787640 + 787639 3 4 - 633853 + 633852 4 10 - 618380 + 618379 10 414 - 482352 + 482351 @@ -5269,17 +5264,17 @@ 1 2 - 5247619 + 5247612 2 3 - 1198817 + 1198816 3 5 - 636005 + 636004 5 @@ -5305,7 +5300,7 @@ 1 2 - 5929506 + 5929498 2 @@ -5315,7 +5310,7 @@ 3 5 - 581379 + 581378 5 @@ -5341,12 +5336,12 @@ 1 2 - 7561432 + 7558596 2 82 - 147867 + 150692 @@ -5362,17 +5357,17 @@ 1 2 - 5256096 + 5256089 2 3 - 764364 + 764363 3 4 - 626991 + 626990 4 @@ -5685,7 +5680,7 @@ 2521 - 56781 + 56782 807 @@ -5778,27 +5773,27 @@ 1 2 - 5183440 + 5183433 2 3 - 792888 + 792752 3 4 - 630623 + 630892 4 9 - 579630 + 579495 9 412 - 522044 + 522043 @@ -5814,27 +5809,27 @@ 1 2 - 5242910 + 5242903 2 3 - 1200970 + 1200968 3 5 - 638831 + 638830 5 54 - 579495 + 579629 54 312 - 46418 + 46284 @@ -5850,12 +5845,12 @@ 1 2 - 7548112 + 7545276 2 7 - 160515 + 163340 @@ -5871,22 +5866,22 @@ 1 2 - 5929640 + 5929632 2 3 - 579092 + 578956 3 5 - 581379 + 581513 5 42 - 578957 + 578956 42 @@ -5907,27 +5902,27 @@ 1 2 - 5253136 + 5253129 2 3 - 768938 + 768803 3 4 - 623761 + 624030 4 10 - 600619 + 600484 10 225 - 462170 + 462169 @@ -6257,11 +6252,11 @@ locations_stmt - 5202910 + 5202903 id - 5202910 + 5202903 container @@ -6269,7 +6264,7 @@ startLine - 272852 + 272851 startColumn @@ -6295,7 +6290,7 @@ 1 2 - 5202910 + 5202903 @@ -6311,7 +6306,7 @@ 1 2 - 5202910 + 5202903 @@ -6327,7 +6322,7 @@ 1 2 - 5202910 + 5202903 @@ -6343,7 +6338,7 @@ 1 2 - 5202910 + 5202903 @@ -6359,7 +6354,7 @@ 1 2 - 5202910 + 5202903 @@ -8249,11 +8244,11 @@ locations_expr - 17958942 + 17958919 id - 17958942 + 17958919 container @@ -8261,7 +8256,7 @@ startLine - 262020 + 262019 startColumn @@ -8269,7 +8264,7 @@ endLine - 261992 + 261991 endColumn @@ -8287,7 +8282,7 @@ 1 2 - 17958942 + 17958919 @@ -8303,7 +8298,7 @@ 1 2 - 17958942 + 17958919 @@ -8319,7 +8314,7 @@ 1 2 - 17958942 + 17958919 @@ -8335,7 +8330,7 @@ 1 2 - 17958942 + 17958919 @@ -8351,7 +8346,7 @@ 1 2 - 17958942 + 17958919 @@ -8995,7 +8990,7 @@ 3 4 - 37688 + 37687 4 @@ -9634,7 +9629,7 @@ 2 3 - 68220 + 68219 3 @@ -10176,11 +10171,11 @@ numlines - 860969 + 860968 element_id - 859623 + 859622 num_lines @@ -10206,7 +10201,7 @@ 1 2 - 858278 + 858277 2 @@ -10227,7 +10222,7 @@ 1 2 - 858278 + 858277 2 @@ -10248,7 +10243,7 @@ 1 2 - 859354 + 859353 2 @@ -11260,7 +11255,7 @@ containerparent - 99502 + 99503 parent @@ -11268,7 +11263,7 @@ child - 99502 + 99503 @@ -11333,7 +11328,7 @@ 1 2 - 99502 + 99503 @@ -11343,7 +11338,7 @@ fileannotations - 5387460 + 5387479 id @@ -11355,7 +11350,7 @@ name - 75307 + 75308 value @@ -11675,7 +11670,7 @@ 1 2 - 75307 + 75308 @@ -11797,7 +11792,7 @@ 51 58 - 3887 + 3888 58 @@ -11838,7 +11833,7 @@ 1 2 - 50665 + 50666 2 @@ -11919,7 +11914,7 @@ 113 145 - 3887 + 3888 145 @@ -11934,15 +11929,15 @@ inmacroexpansion - 149742415 + 149742219 id - 24596921 + 24596888 inv - 3698101 + 3698096 @@ -11956,32 +11951,32 @@ 1 3 - 2167550 + 2167547 3 5 - 1469288 + 1469286 5 6 - 1617557 + 1617555 6 7 - 6574000 + 6573991 7 8 - 8708728 + 8708717 8 9 - 3552858 + 3552853 9 @@ -12007,12 +12002,12 @@ 2 3 - 743635 + 743634 3 4 - 479645 + 479644 4 @@ -12022,7 +12017,7 @@ 7 8 - 282496 + 282495 8 @@ -12042,12 +12037,12 @@ 11 337 - 306935 + 306934 339 423 - 281412 + 281411 423 @@ -12062,15 +12057,15 @@ affectedbymacroexpansion - 48676789 + 48676725 id - 7035609 + 7035600 inv - 3798618 + 3798613 @@ -12084,12 +12079,12 @@ 1 2 - 3842147 + 3842142 2 3 - 764600 + 764599 3 @@ -12099,7 +12094,7 @@ 4 5 - 771826 + 771825 5 @@ -12109,12 +12104,12 @@ 12 50 - 555612 + 555611 50 9900 - 205477 + 205476 @@ -12145,22 +12140,22 @@ 9 12 - 342529 + 342528 12 13 - 455467 + 455466 13 14 - 225833 + 225832 14 15 - 407558 + 407557 15 @@ -12180,12 +12175,12 @@ 18 20 - 343850 + 343849 20 25 - 285057 + 285056 25 @@ -12200,19 +12195,19 @@ macroinvocations - 40601028 + 40601294 id - 40601028 + 40601294 macro_id - 109906 + 109907 location - 1070092 + 1070096 kind @@ -12230,7 +12225,7 @@ 1 2 - 40601028 + 40601294 @@ -12246,7 +12241,7 @@ 1 2 - 40601028 + 40601294 @@ -12262,7 +12257,7 @@ 1 2 - 40601028 + 40601294 @@ -12406,32 +12401,32 @@ 1 2 - 426609 + 426610 2 3 - 252746 + 252707 3 4 - 113185 + 113199 4 6 - 77475 + 77502 6 11 - 82758 + 82759 11 42 - 80455 + 80456 42 @@ -12452,12 +12447,12 @@ 1 2 - 1009645 + 1009649 2 367 - 60446 + 60447 @@ -12473,7 +12468,7 @@ 1 2 - 1070092 + 1070096 @@ -12492,8 +12487,8 @@ 13 - 2974746 - 2974747 + 2974755 + 2974756 13 @@ -12546,15 +12541,15 @@ macroparent - 35810829 + 35811023 id - 35810829 + 35811023 parent_id - 28059915 + 28060082 @@ -12568,7 +12563,7 @@ 1 2 - 35810829 + 35811023 @@ -12584,17 +12579,17 @@ 1 2 - 21857859 + 21858004 2 3 - 5174257 + 5174275 3 91 - 1027798 + 1027802 @@ -12604,15 +12599,15 @@ macrolocationbind - 5543856 + 5543848 id - 3882187 + 3882182 location - 2758860 + 2758856 @@ -12626,17 +12621,17 @@ 1 2 - 3056762 + 3056758 2 3 - 469909 + 469908 3 7 - 314962 + 314961 7 @@ -12657,12 +12652,12 @@ 1 2 - 2198775 + 2198772 2 3 - 239730 + 239729 3 @@ -12682,11 +12677,11 @@ macro_argument_unexpanded - 103251986 + 103252337 invocation - 31225989 + 31226086 argument_index @@ -12694,7 +12689,7 @@ text - 440264 + 440266 @@ -12708,22 +12703,22 @@ 1 2 - 9979439 + 9979461 2 3 - 12505023 + 12505068 3 4 - 6395493 + 6395516 4 67 - 2346032 + 2346040 @@ -12739,22 +12734,22 @@ 1 2 - 10213680 + 10213703 2 3 - 12526522 + 12526567 3 4 - 6195580 + 6195602 4 67 - 2290205 + 2290213 @@ -12779,7 +12774,7 @@ 645273 - 2305009 + 2305008 40 @@ -12852,7 +12847,7 @@ 9 15 - 36847 + 36848 15 @@ -12862,7 +12857,7 @@ 27 57 - 34124 + 34125 57 @@ -12888,17 +12883,17 @@ 1 2 - 311893 + 311894 2 3 - 115271 + 115272 3 9 - 13099 + 13100 @@ -12908,11 +12903,11 @@ macro_argument_expanded - 103251986 + 103252337 invocation - 31225989 + 31226086 argument_index @@ -12920,7 +12915,7 @@ text - 266686 + 266687 @@ -12934,22 +12929,22 @@ 1 2 - 9979439 + 9979461 2 3 - 12505023 + 12505068 3 4 - 6395493 + 6395516 4 67 - 2346032 + 2346040 @@ -12965,22 +12960,22 @@ 1 2 - 13763081 + 13763116 2 3 - 10789713 + 10789751 3 4 - 5403974 + 5403993 4 9 - 1269220 + 1269224 @@ -13005,7 +13000,7 @@ 645273 - 2305009 + 2305008 40 @@ -13119,7 +13114,7 @@ 2 3 - 114038 + 114039 3 @@ -13134,15 +13129,15 @@ functions - 3356850 + 3356874 id - 3356850 + 3356874 name - 466655 + 466658 kind @@ -13160,7 +13155,7 @@ 1 2 - 3356850 + 3356874 @@ -13176,7 +13171,7 @@ 1 2 - 3356850 + 3356874 @@ -13192,12 +13187,12 @@ 1 2 - 372696 + 372699 2 3 - 31834 + 31835 3 @@ -13223,7 +13218,7 @@ 1 2 - 465409 + 465412 2 @@ -13340,15 +13335,15 @@ function_entry_point - 1438631 + 1438642 id - 1433905 + 1433916 entry_point - 1438631 + 1438642 @@ -13362,7 +13357,7 @@ 1 2 - 1429867 + 1429877 2 @@ -13383,7 +13378,7 @@ 1 2 - 1438631 + 1438642 @@ -13393,15 +13388,15 @@ function_return_type - 3363165 + 3363190 id - 3356850 + 3356874 return_type - 631801 + 631806 @@ -13415,7 +13410,7 @@ 1 2 - 3351050 + 3351074 2 @@ -13436,7 +13431,7 @@ 1 2 - 436968 + 436971 2 @@ -13742,33 +13737,33 @@ function_deleted - 94415 + 94416 id - 94415 + 94416 function_defaulted - 55394 + 55395 id - 55394 + 55395 function_prototyped - 3352726 + 3352750 id - 3352726 + 3352750 @@ -13848,15 +13843,15 @@ member_function_this_type - 674420 + 674425 id - 674420 + 674425 this_type - 233542 + 233544 @@ -13870,7 +13865,7 @@ 1 2 - 674420 + 674425 @@ -13896,7 +13891,7 @@ 3 4 - 36517 + 36518 4 @@ -13921,27 +13916,27 @@ fun_decls - 3392723 + 3392748 id - 3388814 + 3388838 function - 3232260 + 3232283 type_id - 600783 + 600787 name - 462015 + 462018 location - 932365 + 932372 @@ -13955,7 +13950,7 @@ 1 2 - 3388814 + 3388838 @@ -13971,7 +13966,7 @@ 1 2 - 3385420 + 3385444 2 @@ -13992,7 +13987,7 @@ 1 2 - 3388814 + 3388838 @@ -14008,7 +14003,7 @@ 1 2 - 3388814 + 3388838 @@ -14024,12 +14019,12 @@ 1 2 - 3101869 + 3101892 2 7 - 130390 + 130391 @@ -14045,7 +14040,7 @@ 1 2 - 3221906 + 3221929 2 @@ -14066,7 +14061,7 @@ 1 2 - 3232260 + 3232283 @@ -14082,12 +14077,12 @@ 1 2 - 3146937 + 3146959 2 6 - 85322 + 85323 @@ -14103,12 +14098,12 @@ 1 2 - 397056 + 397059 2 3 - 127253 + 127254 3 @@ -14134,17 +14129,17 @@ 1 2 - 415401 + 415404 2 3 - 112732 + 112733 3 6 - 52284 + 52285 6 @@ -14165,7 +14160,7 @@ 1 2 - 472627 + 472630 2 @@ -14196,17 +14191,17 @@ 1 2 - 441307 + 441310 2 3 - 90220 + 90221 3 6 - 51382 + 51383 6 @@ -14227,7 +14222,7 @@ 1 2 - 347650 + 347652 2 @@ -14237,7 +14232,7 @@ 3 6 - 37591 + 37592 6 @@ -14263,12 +14258,12 @@ 1 2 - 369345 + 369348 2 3 - 32049 + 32050 3 @@ -14278,7 +14273,7 @@ 9 4900 - 25003 + 25004 @@ -14294,7 +14289,7 @@ 1 2 - 427516 + 427519 2 @@ -14315,7 +14310,7 @@ 1 2 - 355512 + 355514 2 @@ -14346,17 +14341,17 @@ 1 2 - 736887 + 736892 2 3 - 90263 + 90264 3 13 - 70629 + 70630 13 @@ -14377,17 +14372,17 @@ 1 2 - 777787 + 777793 2 4 - 73250 + 73251 4 66 - 71016 + 71017 66 @@ -14408,7 +14403,7 @@ 1 2 - 854388 + 854395 2 @@ -14434,7 +14429,7 @@ 1 2 - 884763 + 884769 2 @@ -14449,11 +14444,11 @@ fun_def - 1592178 + 1592190 id - 1592178 + 1592190 @@ -14482,15 +14477,15 @@ fun_decl_specifiers - 1763135 + 2464552 id - 1197760 + 1197759 name - 218 + 327 @@ -14504,17 +14499,22 @@ 1 2 - 640797 + 267558 2 3 - 548552 + 596777 3 4 - 8410 + 330256 + + + 4 + 5 + 3167 @@ -14537,6 +14537,16 @@ 2862 54 + + 6284 + 6285 + 54 + + + 6559 + 6560 + 54 + 6738 6739 @@ -14676,26 +14686,26 @@ fun_decl_empty_throws - 435235 + 435234 fun_decl - 435235 + 435234 fun_decl_noexcept - 178851 + 178852 fun_decl - 178851 + 178852 constant - 178336 + 178251 @@ -14709,7 +14719,7 @@ 1 2 - 178851 + 178852 @@ -14725,12 +14735,12 @@ 1 2 - 177863 + 177692 2 4 - 472 + 558 @@ -14740,11 +14750,11 @@ fun_decl_empty_noexcept - 1063866 + 1063865 fun_decl - 1063866 + 1063865 @@ -14861,7 +14871,7 @@ constraint - 30949 + 30948 @@ -15000,7 +15010,7 @@ 1 2 - 30949 + 30948 @@ -15010,11 +15020,11 @@ param_decl_bind - 4870837 + 4870873 id - 4870837 + 4870873 index @@ -15022,7 +15032,7 @@ fun_decl - 2664643 + 2664662 @@ -15036,7 +15046,7 @@ 1 2 - 4870837 + 4870873 @@ -15052,7 +15062,7 @@ 1 2 - 4870837 + 4870873 @@ -15230,22 +15240,22 @@ 1 2 - 1370794 + 1370804 2 3 - 667761 + 667766 3 4 - 448997 + 449001 4 21 - 177090 + 177091 @@ -15261,22 +15271,22 @@ 1 2 - 1370794 + 1370804 2 3 - 667761 + 667766 3 4 - 448997 + 449001 4 21 - 177090 + 177091 @@ -15286,27 +15296,27 @@ var_decls - 6739212 + 6739203 id - 6734234 + 6734225 variable - 6565781 + 6565772 type_id - 1513120 + 1513118 name - 829081 + 829080 location - 3605468 + 3605463 @@ -15320,7 +15330,7 @@ 1 2 - 6734234 + 6734225 @@ -15336,7 +15346,7 @@ 1 2 - 6729256 + 6729247 2 @@ -15357,7 +15367,7 @@ 1 2 - 6734234 + 6734225 @@ -15373,7 +15383,7 @@ 1 2 - 6734234 + 6734225 @@ -15389,7 +15399,7 @@ 1 2 - 6408495 + 6408486 2 @@ -15410,7 +15420,7 @@ 1 2 - 6551250 + 6551241 2 @@ -15431,7 +15441,7 @@ 1 2 - 6548559 + 6548550 2 @@ -15452,7 +15462,7 @@ 1 2 - 6434731 + 6434723 2 @@ -15473,7 +15483,7 @@ 1 2 - 890165 + 890164 2 @@ -15488,7 +15498,7 @@ 5 12 - 116518 + 116517 12 @@ -15509,7 +15519,7 @@ 1 2 - 909406 + 909405 2 @@ -15545,12 +15555,12 @@ 1 2 - 1159933 + 1159932 2 3 - 207741 + 207740 3 @@ -15576,12 +15586,12 @@ 1 2 - 1026327 + 1026326 2 3 - 228596 + 228595 3 @@ -15612,7 +15622,7 @@ 1 2 - 457999 + 457998 2 @@ -15627,7 +15637,7 @@ 4 7 - 65390 + 65389 7 @@ -15658,7 +15668,7 @@ 2 3 - 156344 + 156343 3 @@ -15694,7 +15704,7 @@ 1 2 - 640176 + 640175 2 @@ -15725,7 +15735,7 @@ 1 2 - 487734 + 487733 2 @@ -15761,7 +15771,7 @@ 1 2 - 3120828 + 3120824 2 @@ -15787,7 +15797,7 @@ 1 2 - 3145719 + 3145715 2 @@ -15813,7 +15823,7 @@ 1 2 - 3312961 + 3312957 2 @@ -15839,7 +15849,7 @@ 1 2 - 3594435 + 3594430 2 @@ -15854,11 +15864,11 @@ var_def - 3747415 + 3747410 id - 3747415 + 3747410 @@ -16008,19 +16018,19 @@ type_decls - 1890757 + 1890777 id - 1890757 + 1890777 type_id - 1849357 + 1849364 location - 1485512 + 1485517 @@ -16034,7 +16044,7 @@ 1 2 - 1890757 + 1890777 @@ -16050,7 +16060,7 @@ 1 2 - 1890757 + 1890777 @@ -16066,12 +16076,12 @@ 1 2 - 1819567 + 1819574 2 24 - 29789 + 29790 @@ -16087,7 +16097,7 @@ 1 2 - 1820895 + 1820902 2 @@ -16108,7 +16118,7 @@ 1 2 - 1408984 + 1408989 2 @@ -16129,12 +16139,12 @@ 1 2 - 1410326 + 1410331 2 651 - 75185 + 75186 @@ -16144,22 +16154,22 @@ type_def - 1297357 + 1297362 id - 1297357 + 1297362 type_decl_top - 652212 + 652211 type_decl - 652212 + 652211 @@ -16239,11 +16249,11 @@ namespace_decls - 425651 + 425650 id - 425651 + 425650 namespace_id @@ -16251,11 +16261,11 @@ location - 425651 + 425650 bodylocation - 425651 + 425650 @@ -16269,7 +16279,7 @@ 1 2 - 425651 + 425650 @@ -16285,7 +16295,7 @@ 1 2 - 425651 + 425650 @@ -16301,7 +16311,7 @@ 1 2 - 425651 + 425650 @@ -16515,7 +16525,7 @@ 1 2 - 425651 + 425650 @@ -16531,7 +16541,7 @@ 1 2 - 425651 + 425650 @@ -16547,7 +16557,7 @@ 1 2 - 425651 + 425650 @@ -16563,7 +16573,7 @@ 1 2 - 425651 + 425650 @@ -16579,7 +16589,7 @@ 1 2 - 425651 + 425650 @@ -16595,7 +16605,7 @@ 1 2 - 425651 + 425650 @@ -16605,11 +16615,11 @@ usings - 338567 + 338568 id - 338567 + 338568 element_id @@ -16635,7 +16645,7 @@ 1 2 - 338567 + 338568 @@ -16651,7 +16661,7 @@ 1 2 - 338567 + 338568 @@ -16667,7 +16677,7 @@ 1 2 - 338567 + 338568 @@ -16683,7 +16693,7 @@ 1 2 - 55420 + 55421 2 @@ -16709,7 +16719,7 @@ 1 2 - 55420 + 55421 2 @@ -16886,7 +16896,7 @@ using_container - 732094 + 732097 parent @@ -16894,7 +16904,7 @@ child - 338567 + 338568 @@ -16964,7 +16974,7 @@ 2 3 - 154259 + 154260 3 @@ -17597,15 +17607,15 @@ params - 4808499 + 4808534 id - 4798833 + 4798867 function - 2659144 + 2659163 index @@ -17613,7 +17623,7 @@ type_id - 862079 + 862085 @@ -17627,7 +17637,7 @@ 1 2 - 4798833 + 4798867 @@ -17643,7 +17653,7 @@ 1 2 - 4798833 + 4798867 @@ -17659,7 +17669,7 @@ 1 2 - 4789510 + 4789545 2 @@ -17680,22 +17690,22 @@ 1 2 - 1392103 + 1392113 2 3 - 661145 + 661149 3 4 - 439589 + 439592 4 21 - 166306 + 166307 @@ -17711,22 +17721,22 @@ 1 2 - 1392103 + 1392113 2 3 - 661145 + 661149 3 4 - 439589 + 439592 4 21 - 166306 + 166307 @@ -17742,17 +17752,17 @@ 1 2 - 1481035 + 1481046 2 3 - 669909 + 669914 3 4 - 403844 + 403847 4 @@ -18016,12 +18026,12 @@ 1 2 - 449169 + 449172 2 3 - 180011 + 180012 3 @@ -18031,7 +18041,7 @@ 4 6 - 77761 + 77762 6 @@ -18041,7 +18051,7 @@ 15 3702 - 36388 + 36389 @@ -18057,12 +18067,12 @@ 1 2 - 492088 + 492092 2 3 - 152343 + 152345 3 @@ -18072,12 +18082,12 @@ 4 6 - 69383 + 69384 6 18 - 66247 + 66248 18 @@ -18098,17 +18108,17 @@ 1 2 - 634465 + 634470 2 3 - 187744 + 187746 3 17 - 39868 + 39869 @@ -18196,11 +18206,11 @@ membervariables - 1444238 + 1444236 id - 1441780 + 1441778 type_id @@ -18208,7 +18218,7 @@ name - 617367 + 617366 @@ -18222,7 +18232,7 @@ 1 2 - 1439432 + 1439430 2 @@ -18243,7 +18253,7 @@ 1 2 - 1441780 + 1441778 @@ -18290,7 +18300,7 @@ 1 2 - 348935 + 348934 2 @@ -18326,12 +18336,12 @@ 2 3 - 118296 + 118295 3 5 - 56308 + 56307 5 @@ -18352,7 +18362,7 @@ 1 2 - 502840 + 502839 2 @@ -18372,15 +18382,15 @@ globalvariables - 425557 + 425556 id - 425546 + 425545 type_id - 1634 + 1633 name @@ -18398,7 +18408,7 @@ 1 2 - 425535 + 425534 2 @@ -18419,7 +18429,7 @@ 1 2 - 425546 + 425545 @@ -18435,7 +18445,7 @@ 1 2 - 1147 + 1146 2 @@ -18471,7 +18481,7 @@ 1 2 - 1179 + 1178 2 @@ -18507,12 +18517,12 @@ 1 2 - 399362 + 399363 2 1044 - 5652 + 5651 @@ -18528,12 +18538,12 @@ 1 2 - 404349 + 404350 2 15 - 665 + 664 @@ -18606,7 +18616,7 @@ 2 3 - 7925 + 7926 3 @@ -18647,7 +18657,7 @@ 1 2 - 38830 + 38831 2 @@ -18678,7 +18688,7 @@ 1 2 - 63261 + 63262 2 @@ -18812,11 +18822,11 @@ orphaned_variables - 55893 + 55894 var - 55893 + 55894 function @@ -18834,7 +18844,7 @@ 1 2 - 55893 + 55894 @@ -19578,7 +19588,7 @@ 1 2 - 329601 + 329600 2 @@ -19599,7 +19609,7 @@ 1 2 - 329601 + 329600 2 @@ -19652,7 +19662,7 @@ 1 2 - 329601 + 329600 2 @@ -20439,15 +20449,15 @@ derivedtypes - 3188505 + 3188501 id - 3188505 + 3188501 name - 1506662 + 1506660 kind @@ -20455,7 +20465,7 @@ type_id - 2055212 + 2055209 @@ -20469,7 +20479,7 @@ 1 2 - 3188505 + 3188501 @@ -20485,7 +20495,7 @@ 1 2 - 3188505 + 3188501 @@ -20501,7 +20511,7 @@ 1 2 - 3188505 + 3188501 @@ -20517,12 +20527,12 @@ 1 2 - 1369020 + 1369018 2 10 - 113827 + 113826 10 @@ -20543,7 +20553,7 @@ 1 2 - 1506662 + 1506660 @@ -20559,7 +20569,7 @@ 1 2 - 1369154 + 1369153 2 @@ -20708,7 +20718,7 @@ 1 2 - 1388260 + 1388258 2 @@ -20739,7 +20749,7 @@ 1 2 - 1389875 + 1389873 2 @@ -20770,7 +20780,7 @@ 1 2 - 1390144 + 1390142 2 @@ -20795,11 +20805,11 @@ pointerishsize - 2366958 + 2366955 id - 2366958 + 2366955 size @@ -20821,7 +20831,7 @@ 1 2 - 2366958 + 2366955 @@ -20837,7 +20847,7 @@ 1 2 - 2366958 + 2366955 @@ -21317,15 +21327,15 @@ typedefbase - 2175691 + 2175706 id - 2175691 + 2175706 type_id - 905385 + 905391 @@ -21339,7 +21349,7 @@ 1 2 - 2175691 + 2175706 @@ -21355,7 +21365,7 @@ 1 2 - 730529 + 730534 2 @@ -21380,19 +21390,19 @@ decltypes - 175625 + 175649 id - 15417 + 15374 expr - 161560 + 161629 base_type - 11309 + 11280 parentheses_would_change_meaning @@ -21410,27 +21420,27 @@ 1 2 - 2185 + 2137 2 3 - 6656 + 6659 3 4 - 2161 + 2162 4 5 - 1055 + 1056 5 9 - 1212 + 1213 9 @@ -21456,7 +21466,7 @@ 1 2 - 15417 + 15374 @@ -21472,7 +21482,7 @@ 1 2 - 15417 + 15374 @@ -21488,16 +21498,16 @@ 1 2 - 148024 + 148087 2 3 - 13057 + 13063 3 - 5 + 4 478 @@ -21514,16 +21524,16 @@ 1 2 - 148024 + 148087 2 3 - 13057 + 13063 3 - 5 + 4 478 @@ -21540,7 +21550,7 @@ 1 2 - 161560 + 161629 @@ -21556,12 +21566,12 @@ 1 2 - 9799 + 9787 2 3 - 1336 + 1320 3 @@ -21582,12 +21592,12 @@ 1 2 - 981 + 965 2 3 - 5518 + 5504 3 @@ -21597,17 +21607,17 @@ 4 5 - 1113 + 1114 5 8 - 948 + 949 8 41 - 857 + 858 42 @@ -21628,7 +21638,7 @@ 1 2 - 11309 + 11280 @@ -21647,8 +21657,8 @@ 8 - 1867 - 1868 + 1861 + 1862 8 @@ -21689,8 +21699,8 @@ 8 - 1369 - 1370 + 1365 + 1366 8 @@ -21701,15 +21711,15 @@ usertypes - 4992117 + 4987434 id - 4992117 + 4987434 name - 1074915 + 1074810 kind @@ -21727,7 +21737,7 @@ 1 2 - 4992117 + 4987434 @@ -21743,7 +21753,7 @@ 1 2 - 4992117 + 4987434 @@ -21759,22 +21769,22 @@ 1 2 - 742932 + 743259 2 3 - 197244 + 196974 3 7 - 86104 + 85996 7 - 29574 - 48633 + 30181 + 48579 @@ -21790,12 +21800,12 @@ 1 2 - 1007695 + 1008457 2 10 - 67220 + 66353 @@ -21839,8 +21849,8 @@ 13 - 4522 - 4523 + 4581 + 4582 13 @@ -21849,23 +21859,23 @@ 13 - 20080 - 20081 + 20064 + 20065 13 - 82457 - 82458 + 82095 + 82096 13 - 85575 - 85576 + 85548 + 85549 13 - 151140 - 151141 + 151139 + 151140 13 @@ -21905,8 +21915,8 @@ 13 - 832 - 833 + 771 + 772 13 @@ -21915,8 +21925,8 @@ 13 - 3087 - 3088 + 3066 + 3067 13 @@ -21925,8 +21935,8 @@ 13 - 10837 - 10838 + 10829 + 10830 13 @@ -21935,8 +21945,8 @@ 13 - 51364 - 51365 + 51345 + 51346 13 @@ -21947,11 +21957,11 @@ usertypesize - 1631914 + 1632137 id - 1631914 + 1632137 size @@ -21973,7 +21983,7 @@ 1 2 - 1631914 + 1632137 @@ -21989,7 +21999,7 @@ 1 2 - 1631914 + 1632137 @@ -22049,7 +22059,7 @@ 1733 - 92713 + 92729 67 @@ -22125,8 +22135,8 @@ 13 - 107899 - 107900 + 107915 + 107916 13 @@ -22247,11 +22257,11 @@ usertype_alias_kind - 2175733 + 2175749 id - 2175691 + 2175706 alias_kind @@ -22269,7 +22279,7 @@ 1 2 - 2175648 + 2175663 2 @@ -22305,11 +22315,11 @@ nontype_template_parameters - 966305 + 966312 id - 966305 + 966312 @@ -22389,15 +22399,15 @@ mangled_name - 7780866 + 7776179 id - 7780866 + 7776179 mangled_name - 5325726 + 5325040 is_complete @@ -22415,7 +22425,7 @@ 1 2 - 7780866 + 7776179 @@ -22431,7 +22441,7 @@ 1 2 - 7780866 + 7776179 @@ -22447,17 +22457,17 @@ 1 2 - 4731594 + 4731503 2 3 - 459569 + 459353 3 - 8985 - 134562 + 9032 + 134183 @@ -22473,7 +22483,7 @@ 1 2 - 5325726 + 5325040 @@ -22492,8 +22502,8 @@ 13 - 570981 - 570982 + 570633 + 570634 13 @@ -22513,8 +22523,8 @@ 13 - 391611 - 391612 + 391559 + 391560 13 @@ -22525,59 +22535,59 @@ is_pod_class - 747542 + 747547 id - 747542 + 747547 is_standard_layout_class - 1344636 + 1344858 id - 1344636 + 1344858 is_complete - 1611052 + 1611274 id - 1611052 + 1611274 is_class_template - 292182 + 292183 id - 292182 + 292183 class_instantiation - 1327526 + 1327030 to - 1323611 + 1323128 from - 91713 + 91605 @@ -22591,12 +22601,12 @@ 1 2 - 1320861 + 1320392 2 8 - 2750 + 2736 @@ -22612,42 +22622,42 @@ 1 2 - 26741 + 26728 2 3 - 16676 + 16622 3 4 - 9130 + 9103 4 5 - 5987 + 5974 5 7 - 7667 + 7694 7 10 - 6922 + 6949 10 17 - 7423 + 7356 17 53 - 6922 + 6936 53 @@ -22662,11 +22672,11 @@ class_template_argument - 3502880 + 3501700 type_id - 1631792 + 1631215 index @@ -22674,7 +22684,7 @@ arg_type - 1034653 + 1034467 @@ -22688,27 +22698,27 @@ 1 2 - 679139 + 678884 2 3 - 490293 + 490105 3 4 - 308844 + 308751 4 7 - 124144 + 124118 7 113 - 29369 + 29356 @@ -22724,22 +22734,22 @@ 1 2 - 713697 + 713442 2 3 - 505642 + 505454 3 4 - 306907 + 306813 4 113 - 105544 + 105504 @@ -22779,12 +22789,12 @@ 643 - 6821 + 6819 121 - 11332 - 120452 + 11329 + 120409 54 @@ -22829,8 +22839,8 @@ 121 - 10038 - 43717 + 10035 + 43710 40 @@ -22847,26 +22857,26 @@ 1 2 - 648834 + 649080 2 3 - 212417 + 212187 3 4 - 62194 + 62153 4 11 - 78830 + 78667 11 - 11558 + 11553 32377 @@ -22883,12 +22893,12 @@ 1 2 - 912540 + 912381 2 3 - 98879 + 98852 3 @@ -22903,11 +22913,11 @@ class_template_argument_value - 643229 + 643234 type_id - 259534 + 259536 index @@ -22915,7 +22925,7 @@ arg_value - 643057 + 643062 @@ -22929,12 +22939,12 @@ 1 2 - 196466 + 196467 2 3 - 54690 + 54691 3 @@ -22955,7 +22965,7 @@ 1 2 - 186541 + 186543 2 @@ -23098,7 +23108,7 @@ 1 2 - 642886 + 642890 2 @@ -23119,7 +23129,7 @@ 1 2 - 643057 + 643062 @@ -23129,15 +23139,15 @@ is_proxy_class_for - 61259 + 62059 id - 61259 + 62059 templ_param_id - 60135 + 58631 @@ -23151,7 +23161,7 @@ 1 2 - 61259 + 62059 @@ -23167,12 +23177,12 @@ 1 2 - 59620 + 57710 2 - 21 - 514 + 79 + 921 @@ -23182,11 +23192,11 @@ type_mentions - 5507865 + 5507858 id - 5507865 + 5507858 type_id @@ -23194,7 +23204,7 @@ location - 5462043 + 5462036 kind @@ -23212,7 +23222,7 @@ 1 2 - 5507865 + 5507858 @@ -23228,7 +23238,7 @@ 1 2 - 5507865 + 5507858 @@ -23244,7 +23254,7 @@ 1 2 - 5507865 + 5507858 @@ -23295,7 +23305,7 @@ 27 8555 - 19716 + 19715 @@ -23346,7 +23356,7 @@ 27 8555 - 19716 + 19715 @@ -23378,7 +23388,7 @@ 1 2 - 5416221 + 5416214 2 @@ -23399,7 +23409,7 @@ 1 2 - 5416221 + 5416214 2 @@ -23420,7 +23430,7 @@ 1 2 - 5462043 + 5462036 @@ -23478,26 +23488,26 @@ is_function_template - 1418399 + 1418397 id - 1418399 + 1418397 function_instantiation - 1226957 + 1226965 to - 1226957 + 1226965 from - 230191 + 230193 @@ -23511,7 +23521,7 @@ 1 2 - 1226957 + 1226965 @@ -23527,7 +23537,7 @@ 1 2 - 140013 + 140014 2 @@ -23557,11 +23567,11 @@ function_template_argument - 3133404 + 3133426 function_id - 1832637 + 1832651 index @@ -23569,7 +23579,7 @@ arg_type - 375790 + 375792 @@ -23583,22 +23593,22 @@ 1 2 - 987399 + 987407 2 3 - 521002 + 521006 3 4 - 216658 + 216659 4 15 - 107577 + 107578 @@ -23614,17 +23624,17 @@ 1 2 - 1011544 + 1011551 2 3 - 518596 + 518600 3 4 - 213908 + 213910 4 @@ -23767,12 +23777,12 @@ 1 2 - 220396 + 220397 2 3 - 33209 + 33210 3 @@ -23782,7 +23792,7 @@ 4 6 - 28569 + 28570 6 @@ -23813,7 +23823,7 @@ 1 2 - 323848 + 323851 2 @@ -23823,7 +23833,7 @@ 3 15 - 11427 + 11428 @@ -23833,11 +23843,11 @@ function_template_argument_value - 570967 + 570971 function_id - 248149 + 248151 index @@ -23845,7 +23855,7 @@ arg_value - 567573 + 567577 @@ -23859,7 +23869,7 @@ 1 2 - 190923 + 190925 2 @@ -23885,7 +23895,7 @@ 1 2 - 182202 + 182203 2 @@ -24038,7 +24048,7 @@ 1 2 - 564179 + 564183 2 @@ -24059,7 +24069,7 @@ 1 2 - 567573 + 567577 @@ -24163,11 +24173,11 @@ variable_template_argument - 525811 + 525810 variable_id - 267211 + 267210 index @@ -24175,7 +24185,7 @@ arg_type - 257120 + 257119 @@ -24220,12 +24230,12 @@ 1 2 - 122169 + 122168 2 3 - 99296 + 99295 3 @@ -25274,7 +25284,7 @@ concept_id - 81869 + 81870 index @@ -25296,12 +25306,12 @@ 1 2 - 49813 + 49814 2 3 - 26451 + 26452 3 @@ -25543,7 +25553,7 @@ 1 2 - 65 + 66 2 @@ -25632,15 +25642,15 @@ routinetypes - 762063 + 762068 id - 762063 + 762068 return_type - 357960 + 357963 @@ -25654,7 +25664,7 @@ 1 2 - 762063 + 762068 @@ -25670,7 +25680,7 @@ 1 2 - 295365 + 295367 2 @@ -25690,7 +25700,7 @@ routinetypeargs - 1165647 + 1165645 routine @@ -25731,7 +25741,7 @@ 4 5 - 48935 + 48934 5 @@ -25772,7 +25782,7 @@ 4 5 - 40142 + 40141 5 @@ -26000,12 +26010,12 @@ 6 8 - 9503 + 9502 8 13 - 9503 + 9502 13 @@ -26031,7 +26041,7 @@ 1 2 - 78154 + 78153 2 @@ -26041,7 +26051,7 @@ 3 5 - 9503 + 9502 5 @@ -26212,15 +26222,15 @@ specifiers - 7131 + 8341 id - 7131 + 8341 str - 7131 + 8341 @@ -26234,7 +26244,7 @@ 1 2 - 7131 + 8341 @@ -26250,7 +26260,7 @@ 1 2 - 7131 + 8341 @@ -26260,11 +26270,11 @@ typespecifiers - 988078 + 991496 type_id - 981495 + 984912 spec_id @@ -26282,7 +26292,7 @@ 1 2 - 974911 + 978328 2 @@ -26331,8 +26341,8 @@ 13 - 17156 - 17157 + 17408 + 17409 13 @@ -26348,15 +26358,15 @@ funspecifiers - 9758473 + 9728427 func_id - 3343789 + 3340505 spec_id - 859 + 816 @@ -26370,32 +26380,32 @@ 1 2 - 431941 + 437873 2 3 - 686449 + 677260 3 4 - 1416678 + 1424206 4 5 - 458148 + 459483 5 6 - 233886 + 225080 6 8 - 116685 + 116600 @@ -26438,11 +26448,6 @@ 563 42 - - 704 - 705 - 42 - 1589 1590 @@ -26489,8 +26494,8 @@ 42 - 42404 - 42405 + 42407 + 42408 42 @@ -26511,11 +26516,11 @@ varspecifiers - 2898034 + 2898030 var_id - 2545003 + 2544999 spec_id @@ -26533,12 +26538,12 @@ 1 2 - 2191971 + 2191969 2 3 - 353031 + 353030 @@ -26642,11 +26647,11 @@ attributes - 629816 + 629815 id - 629816 + 629815 kind @@ -26662,7 +26667,7 @@ location - 623358 + 623357 @@ -26676,7 +26681,7 @@ 1 2 - 629816 + 629815 @@ -26692,7 +26697,7 @@ 1 2 - 629816 + 629815 @@ -26708,7 +26713,7 @@ 1 2 - 629816 + 629815 @@ -26724,7 +26729,7 @@ 1 2 - 629816 + 629815 @@ -27112,7 +27117,7 @@ 1 2 - 617034 + 617033 2 @@ -27133,7 +27138,7 @@ 1 2 - 623358 + 623357 @@ -27170,7 +27175,7 @@ 1 2 - 623358 + 623357 @@ -27428,7 +27433,7 @@ 2 3 - 2302 + 2303 @@ -27444,7 +27449,7 @@ 1 2 - 79046 + 79047 2 @@ -27465,7 +27470,7 @@ 1 2 - 80658 + 80659 2 @@ -27641,7 +27646,7 @@ 1 2 - 91726 + 91727 2 @@ -27854,15 +27859,15 @@ attribute_arg_constant - 89599 + 89600 arg - 89599 + 89600 constant - 89599 + 89600 @@ -27876,7 +27881,7 @@ 1 2 - 89599 + 89600 @@ -27892,7 +27897,7 @@ 1 2 - 89599 + 89600 @@ -28071,15 +28076,15 @@ funcattributes - 824910 + 824909 func_id - 776473 + 776472 spec_id - 598601 + 598600 @@ -28114,7 +28119,7 @@ 1 2 - 555008 + 555007 2 @@ -28260,15 +28265,15 @@ unspecifiedtype - 8350274 + 8345603 type_id - 8350274 + 8345603 unspecified_type_id - 4803705 + 4799035 @@ -28282,7 +28287,7 @@ 1 2 - 8350274 + 8345603 @@ -28298,17 +28303,17 @@ 1 2 - 3203138 + 3198462 2 3 - 1309007 + 1309012 3 6271 - 291558 + 291559 @@ -28318,11 +28323,11 @@ member - 4687174 + 4687208 parent - 562417 + 562422 index @@ -28330,7 +28335,7 @@ child - 4569973 + 4570006 @@ -28344,7 +28349,7 @@ 1 2 - 233198 + 233200 2 @@ -28359,17 +28364,17 @@ 4 5 - 37763 + 37764 5 7 - 47859 + 47860 7 11 - 43348 + 43349 11 @@ -28384,7 +28389,7 @@ 19 53 - 42317 + 42318 53 @@ -28405,7 +28410,7 @@ 1 2 - 233069 + 233071 2 @@ -28445,7 +28450,7 @@ 19 53 - 42317 + 42318 53 @@ -28603,7 +28608,7 @@ 1 2 - 4569973 + 4570006 @@ -28619,12 +28624,12 @@ 1 2 - 4482115 + 4482148 2 13 - 87857 + 87858 @@ -28634,15 +28639,15 @@ enclosingfunction - 144782 + 144783 child - 144782 + 144783 parent - 89962 + 89963 @@ -28656,7 +28661,7 @@ 1 2 - 144782 + 144783 @@ -28682,7 +28687,7 @@ 3 4 - 19375 + 19376 4 @@ -28697,15 +28702,15 @@ derivations - 599880 + 599885 derivation - 599880 + 599885 sub - 572471 + 572475 index @@ -28713,11 +28718,11 @@ super - 296052 + 296054 location - 44637 + 44638 @@ -28731,7 +28736,7 @@ 1 2 - 599880 + 599885 @@ -28747,7 +28752,7 @@ 1 2 - 599880 + 599885 @@ -28763,7 +28768,7 @@ 1 2 - 599880 + 599885 @@ -28779,7 +28784,7 @@ 1 2 - 599880 + 599885 @@ -28795,7 +28800,7 @@ 1 2 - 551634 + 551638 2 @@ -28816,7 +28821,7 @@ 1 2 - 551634 + 551638 2 @@ -28837,7 +28842,7 @@ 1 2 - 551634 + 551638 2 @@ -28858,7 +28863,7 @@ 1 2 - 551634 + 551638 2 @@ -29018,7 +29023,7 @@ 1 2 - 283937 + 283939 2 @@ -29039,7 +29044,7 @@ 1 2 - 283937 + 283939 2 @@ -29060,7 +29065,7 @@ 1 2 - 295493 + 295496 2 @@ -29081,7 +29086,7 @@ 1 2 - 289522 + 289524 2 @@ -29174,7 +29179,7 @@ 1 2 - 44637 + 44638 @@ -29215,11 +29220,11 @@ derspecifiers - 602115 + 602119 der_id - 599322 + 599326 spec_id @@ -29237,7 +29242,7 @@ 1 2 - 596529 + 596534 2 @@ -29283,11 +29288,11 @@ direct_base_offsets - 565940 + 565944 der_id - 565940 + 565944 offset @@ -29305,7 +29310,7 @@ 1 2 - 565940 + 565944 @@ -29502,19 +29507,19 @@ frienddecls - 883302 + 883308 id - 883302 + 883308 type_id - 53487 + 53488 decl_id - 98039 + 98169 location @@ -29532,7 +29537,7 @@ 1 2 - 883302 + 883308 @@ -29548,7 +29553,7 @@ 1 2 - 883302 + 883308 @@ -29564,7 +29569,7 @@ 1 2 - 883302 + 883308 @@ -29713,12 +29718,12 @@ 1 2 - 60361 + 60620 2 3 - 7647 + 7518 3 @@ -29754,12 +29759,12 @@ 1 2 - 60361 + 60620 2 3 - 7647 + 7518 3 @@ -29795,7 +29800,7 @@ 1 2 - 97180 + 97310 2 @@ -29862,7 +29867,7 @@ 2 - 2129 + 2132 429 @@ -29873,19 +29878,19 @@ comments - 11290145 + 11290131 id - 11290145 + 11290131 contents - 4299060 + 4299054 location - 11290145 + 11290131 @@ -29899,7 +29904,7 @@ 1 2 - 11290145 + 11290131 @@ -29915,7 +29920,7 @@ 1 2 - 11290145 + 11290131 @@ -29931,7 +29936,7 @@ 1 2 - 3932687 + 3932682 2 @@ -29957,7 +29962,7 @@ 1 2 - 3932687 + 3932682 2 @@ -29983,7 +29988,7 @@ 1 2 - 11290145 + 11290131 @@ -29999,7 +30004,7 @@ 1 2 - 11290145 + 11290131 @@ -30009,15 +30014,15 @@ commentbinding - 3316594 + 3316590 id - 3263044 + 3263040 element - 3173570 + 3173566 @@ -30031,7 +30036,7 @@ 1 2 - 3231291 + 3231287 2 @@ -30052,7 +30057,7 @@ 1 2 - 3030546 + 3030542 2 @@ -30067,15 +30072,15 @@ exprconv - 9603748 + 9603735 converted - 9603643 + 9603630 conversion - 9603748 + 9603735 @@ -30089,7 +30094,7 @@ 1 2 - 9603537 + 9603525 2 @@ -30110,7 +30115,7 @@ 1 2 - 9603748 + 9603735 @@ -30120,22 +30125,22 @@ compgenerated - 10714603 + 10714334 id - 10714603 + 10714334 synthetic_destructor_call - 1791768 + 1791782 element - 1334382 + 1334392 i @@ -30143,7 +30148,7 @@ destructor_call - 1791768 + 1791782 @@ -30157,12 +30162,12 @@ 1 2 - 888204 + 888211 2 3 - 438890 + 438893 3 @@ -30183,12 +30188,12 @@ 1 2 - 888204 + 888211 2 3 - 438890 + 438893 3 @@ -30341,7 +30346,7 @@ 1 2 - 1791768 + 1791782 @@ -30357,7 +30362,7 @@ 1 2 - 1791768 + 1791782 @@ -30436,7 +30441,7 @@ namespacembrs - 2026146 + 2025652 parentid @@ -30444,7 +30449,7 @@ memberid - 2026146 + 2025652 @@ -30488,37 +30493,37 @@ 14 22 - 785 + 812 22 - 36 - 785 + 37 + 799 - 36 - 55 - 812 + 37 + 57 + 799 - 56 - 115 + 57 + 118 785 - 115 - 244 - 785 + 118 + 255 + 812 - 252 - 673 + 256 + 828 785 - 674 - 42760 - 392 + 829 + 42759 + 338 @@ -30534,7 +30539,7 @@ 1 2 - 2026146 + 2025652 @@ -30544,11 +30549,11 @@ exprparents - 19401302 + 19401276 expr_id - 19401302 + 19401276 child_index @@ -30556,7 +30561,7 @@ parent_id - 12904791 + 12904774 @@ -30570,7 +30575,7 @@ 1 2 - 19401302 + 19401276 @@ -30586,7 +30591,7 @@ 1 2 - 19401302 + 19401276 @@ -30704,17 +30709,17 @@ 1 2 - 7374643 + 7374634 2 3 - 5068855 + 5068849 3 712 - 461292 + 461291 @@ -30730,17 +30735,17 @@ 1 2 - 7374643 + 7374634 2 3 - 5068855 + 5068849 3 712 - 461292 + 461291 @@ -30750,22 +30755,22 @@ expr_isload - 6961485 + 6961476 expr_id - 6961485 + 6961476 conversionkinds - 6048224 + 6048225 expr_id - 6048224 + 6048225 kind @@ -30783,7 +30788,7 @@ 1 2 - 6048224 + 6048225 @@ -30827,8 +30832,8 @@ 1 - 5829769 - 5829770 + 5829770 + 5829771 1 @@ -30839,11 +30844,11 @@ iscall - 6219922 + 6219948 caller - 6219922 + 6219948 kind @@ -30861,7 +30866,7 @@ 1 2 - 6219922 + 6219948 @@ -30885,8 +30890,8 @@ 23 - 268068 - 268069 + 268067 + 268068 23 @@ -30897,11 +30902,11 @@ numtemplatearguments - 723397 + 723402 expr_id - 723397 + 723402 num @@ -30919,7 +30924,7 @@ 1 2 - 723397 + 723402 @@ -31028,15 +31033,15 @@ namequalifiers - 3258064 + 3258067 id - 3258064 + 3258067 qualifiableelement - 3258064 + 3258067 qualifyingelement @@ -31044,7 +31049,7 @@ location - 591859 + 591864 @@ -31058,7 +31063,7 @@ 1 2 - 3258064 + 3258067 @@ -31074,7 +31079,7 @@ 1 2 - 3258064 + 3258067 @@ -31090,7 +31095,7 @@ 1 2 - 3258064 + 3258067 @@ -31106,7 +31111,7 @@ 1 2 - 3258064 + 3258067 @@ -31122,7 +31127,7 @@ 1 2 - 3258064 + 3258067 @@ -31138,7 +31143,7 @@ 1 2 - 3258064 + 3258067 @@ -31154,7 +31159,7 @@ 1 2 - 33831 + 33832 2 @@ -31172,7 +31177,7 @@ 3782 - 6807 + 6806 41956 115 @@ -31190,7 +31195,7 @@ 1 2 - 33831 + 33832 2 @@ -31208,7 +31213,7 @@ 3782 - 6807 + 6806 41956 115 @@ -31257,17 +31262,17 @@ 1 2 - 84982 + 85006 2 6 - 40565 + 40543 6 7 - 427774 + 427777 7 @@ -31288,17 +31293,17 @@ 1 2 - 84982 + 85006 2 6 - 40565 + 40543 6 7 - 427774 + 427777 7 @@ -31319,7 +31324,7 @@ 1 2 - 119345 + 119346 2 @@ -31329,7 +31334,7 @@ 4 5 - 445209 + 445212 5 @@ -31344,15 +31349,15 @@ varbind - 8226118 + 8226107 expr - 8226118 + 8226107 var - 1047519 + 1047517 @@ -31366,7 +31371,7 @@ 1 2 - 8226118 + 8226107 @@ -31437,15 +31442,15 @@ funbind - 6230323 + 6230372 expr - 6227671 + 6227720 fun - 295537 + 295540 @@ -31459,7 +31464,7 @@ 1 2 - 6225019 + 6225068 2 @@ -31480,7 +31485,7 @@ 1 2 - 194319 + 194320 2 @@ -31510,11 +31515,11 @@ expr_allocator - 57053 + 57054 expr - 57053 + 57054 func @@ -31536,7 +31541,7 @@ 1 2 - 57053 + 57054 @@ -31552,7 +31557,7 @@ 1 2 - 57053 + 57054 @@ -31783,15 +31788,15 @@ expr_cond_guard - 896445 + 896444 cond - 896445 + 896444 guard - 896445 + 896444 @@ -31805,7 +31810,7 @@ 1 2 - 896445 + 896444 @@ -31821,7 +31826,7 @@ 1 2 - 896445 + 896444 @@ -31831,15 +31836,15 @@ expr_cond_true - 896442 + 896441 cond - 896442 + 896441 true - 896442 + 896441 @@ -31853,7 +31858,7 @@ 1 2 - 896442 + 896441 @@ -31869,7 +31874,7 @@ 1 2 - 896442 + 896441 @@ -31879,15 +31884,15 @@ expr_cond_false - 896445 + 896444 cond - 896445 + 896444 false - 896445 + 896444 @@ -31901,7 +31906,7 @@ 1 2 - 896445 + 896444 @@ -31917,7 +31922,7 @@ 1 2 - 896445 + 896444 @@ -31927,11 +31932,11 @@ values - 14099266 + 14099248 id - 14099266 + 14099248 str @@ -31949,7 +31954,7 @@ 1 2 - 14099266 + 14099248 @@ -31995,11 +32000,11 @@ valuetext - 6605852 + 6605626 id - 6605852 + 6605626 text @@ -32017,7 +32022,7 @@ 1 2 - 6605852 + 6605626 @@ -32047,7 +32052,7 @@ 7 - 593266 + 593260 27560 @@ -32058,15 +32063,15 @@ valuebind - 14484502 + 14484483 val - 14099266 + 14099248 expr - 14484502 + 14484483 @@ -32080,7 +32085,7 @@ 1 2 - 13735597 + 13735579 2 @@ -32101,7 +32106,7 @@ 1 2 - 14484502 + 14484483 @@ -32111,11 +32116,11 @@ fieldoffsets - 1441780 + 1441778 id - 1441780 + 1441778 byteoffset @@ -32137,7 +32142,7 @@ 1 2 - 1441780 + 1441778 @@ -32153,7 +32158,7 @@ 1 2 - 1441780 + 1441778 @@ -32538,23 +32543,23 @@ initialisers - 2336673 + 2336670 init - 2336673 + 2336670 var - 983091 + 983090 expr - 2336673 + 2336670 location - 539035 + 539034 @@ -32568,7 +32573,7 @@ 1 2 - 2336673 + 2336670 @@ -32584,7 +32589,7 @@ 1 2 - 2336673 + 2336670 @@ -32600,7 +32605,7 @@ 1 2 - 2336673 + 2336670 @@ -32616,7 +32621,7 @@ 1 2 - 865934 + 865933 2 @@ -32642,7 +32647,7 @@ 1 2 - 865934 + 865933 2 @@ -32668,7 +32673,7 @@ 1 2 - 983082 + 983081 2 @@ -32689,7 +32694,7 @@ 1 2 - 2336673 + 2336670 @@ -32705,7 +32710,7 @@ 1 2 - 2336673 + 2336670 @@ -32721,7 +32726,7 @@ 1 2 - 2336673 + 2336670 @@ -32768,7 +32773,7 @@ 1 2 - 470682 + 470681 2 @@ -32819,26 +32824,26 @@ braced_initialisers - 74272 + 74303 init - 74272 + 74303 expr_ancestor - 1798179 + 1798193 exp - 1798179 + 1798193 ancestor - 899966 + 899973 @@ -32852,7 +32857,7 @@ 1 2 - 1798179 + 1798193 @@ -32873,12 +32878,12 @@ 2 3 - 870862 + 870868 3 19 - 10792 + 10793 @@ -32888,11 +32893,11 @@ exprs - 25135886 + 25135853 id - 25135886 + 25135853 kind @@ -32900,7 +32905,7 @@ location - 11535483 + 11535468 @@ -32914,7 +32919,7 @@ 1 2 - 25135886 + 25135853 @@ -32930,7 +32935,7 @@ 1 2 - 25135886 + 25135853 @@ -33108,17 +33113,17 @@ 1 2 - 9705673 + 9705660 2 3 - 898510 + 898509 3 16 - 866991 + 866990 16 @@ -33139,17 +33144,17 @@ 1 2 - 9853416 + 9853403 2 3 - 844293 + 844292 3 32 - 837774 + 837773 @@ -33159,15 +33164,15 @@ expr_reuse - 907876 + 907883 reuse - 907876 + 907883 original - 907876 + 907883 value_category @@ -33185,7 +33190,7 @@ 1 2 - 907876 + 907883 @@ -33201,7 +33206,7 @@ 1 2 - 907876 + 907883 @@ -33217,7 +33222,7 @@ 1 2 - 907876 + 907883 @@ -33233,7 +33238,7 @@ 1 2 - 907876 + 907883 @@ -33285,11 +33290,11 @@ expr_types - 25135886 + 25135853 id - 25135886 + 25135853 typeid @@ -33311,7 +33316,7 @@ 1 2 - 25135886 + 25135853 @@ -33327,7 +33332,7 @@ 1 2 - 25135886 + 25135853 @@ -33472,11 +33477,11 @@ new_allocated_type - 58256 + 58257 expr - 58256 + 58257 type_id @@ -33494,7 +33499,7 @@ 1 2 - 58256 + 58257 @@ -33515,7 +33520,7 @@ 2 3 - 18258 + 18259 3 @@ -34600,15 +34605,15 @@ condition_decl_bind - 438290 + 438294 expr - 438290 + 438294 decl - 438290 + 438294 @@ -34622,7 +34627,7 @@ 1 2 - 438290 + 438294 @@ -34638,7 +34643,7 @@ 1 2 - 438290 + 438294 @@ -34648,11 +34653,11 @@ typeid_bind - 60404 + 60405 expr - 60404 + 60405 type_id @@ -34670,7 +34675,7 @@ 1 2 - 60404 + 60405 @@ -34706,11 +34711,11 @@ uuidof_bind - 27728 + 27727 expr - 27728 + 27727 type_id @@ -34728,7 +34733,7 @@ 1 2 - 27728 + 27727 @@ -34759,11 +34764,11 @@ sizeof_bind - 245235 + 245234 expr - 245235 + 245234 type_id @@ -34781,7 +34786,7 @@ 1 2 - 245235 + 245234 @@ -36365,11 +36370,11 @@ stmts - 6324268 + 6324260 id - 6324268 + 6324260 kind @@ -36377,7 +36382,7 @@ location - 2966233 + 2966229 @@ -36391,7 +36396,7 @@ 1 2 - 6324268 + 6324260 @@ -36407,7 +36412,7 @@ 1 2 - 6324268 + 6324260 @@ -36635,7 +36640,7 @@ 1 2 - 2357136 + 2357133 2 @@ -36645,7 +36650,7 @@ 3 8 - 228596 + 228595 8 @@ -36666,7 +36671,7 @@ 1 2 - 2892635 + 2892631 2 @@ -36775,6 +36780,17 @@ + + type_is_vla + 47 + + + type_id + 47 + + + + if_initialization 403 @@ -36825,15 +36841,15 @@ if_then - 987521 + 987520 if_stmt - 987521 + 987520 then_id - 987521 + 987520 @@ -36847,7 +36863,7 @@ 1 2 - 987521 + 987520 @@ -36863,7 +36879,7 @@ 1 2 - 987521 + 987520 @@ -36873,15 +36889,15 @@ if_else - 468501 + 468505 if_stmt - 468501 + 468505 else_id - 468501 + 468505 @@ -36895,7 +36911,7 @@ 1 2 - 468501 + 468505 @@ -36911,7 +36927,7 @@ 1 2 - 468501 + 468505 @@ -37305,11 +37321,11 @@ switch_case - 896207 + 896214 switch_stmt - 441450 + 441453 index @@ -37317,7 +37333,7 @@ case_id - 896207 + 896214 @@ -37336,7 +37352,7 @@ 2 3 - 438359 + 438363 3 @@ -37362,7 +37378,7 @@ 2 3 - 438359 + 438363 3 @@ -37525,7 +37541,7 @@ 1 2 - 896207 + 896214 @@ -37541,7 +37557,7 @@ 1 2 - 896207 + 896214 @@ -37551,15 +37567,15 @@ switch_body - 441450 + 441453 switch_stmt - 441450 + 441453 body_id - 441450 + 441453 @@ -37573,7 +37589,7 @@ 1 2 - 441450 + 441453 @@ -37589,7 +37605,7 @@ 1 2 - 441450 + 441453 @@ -37791,11 +37807,11 @@ stmtparents - 5536444 + 5536437 id - 5536444 + 5536437 index @@ -37803,7 +37819,7 @@ parent - 2349075 + 2349072 @@ -37817,7 +37833,7 @@ 1 2 - 5536444 + 5536437 @@ -37833,7 +37849,7 @@ 1 2 - 5536444 + 5536437 @@ -37971,12 +37987,12 @@ 1 2 - 1349054 + 1349052 2 3 - 508948 + 508947 3 @@ -37991,7 +38007,7 @@ 6 17 - 178120 + 178119 17 @@ -38012,12 +38028,12 @@ 1 2 - 1349054 + 1349052 2 3 - 508948 + 508947 3 @@ -38032,7 +38048,7 @@ 6 17 - 178120 + 178119 17 @@ -38047,11 +38063,11 @@ ishandler - 47521 + 47475 block - 47521 + 47475 @@ -38084,7 +38100,7 @@ 1 2 - 668063 + 668062 2 @@ -38105,7 +38121,7 @@ 1 2 - 668063 + 668062 2 @@ -38170,7 +38186,7 @@ 5480 - 170179 + 170178 8 @@ -38231,7 +38247,7 @@ 5480 - 170162 + 170161 8 @@ -38248,7 +38264,7 @@ 1 2 - 730668 + 730667 2 @@ -38305,7 +38321,7 @@ 1 2 - 668063 + 668062 2 @@ -38326,7 +38342,7 @@ 1 2 - 668063 + 668062 2 @@ -38391,7 +38407,7 @@ 5480 - 170179 + 170178 8 @@ -38452,7 +38468,7 @@ 5480 - 170179 + 170178 8 @@ -38495,15 +38511,15 @@ blockscope - 1838725 + 1838723 block - 1838725 + 1838723 enclosing - 1575685 + 1575683 @@ -38517,7 +38533,7 @@ 1 2 - 1838725 + 1838723 @@ -38533,7 +38549,7 @@ 1 2 - 1400369 + 1400368 2 @@ -38543,7 +38559,7 @@ 3 28 - 45477 + 45476 @@ -38553,11 +38569,11 @@ jumpinfo - 347365 + 347364 id - 347365 + 347364 str @@ -38579,7 +38595,7 @@ 1 2 - 347365 + 347364 @@ -38595,7 +38611,7 @@ 1 2 - 347365 + 347364 @@ -38698,7 +38714,7 @@ 4 5 - 7359 + 7358 5 @@ -38734,11 +38750,11 @@ preprocdirects - 5704677 + 5704669 id - 5704677 + 5704669 kind @@ -38746,7 +38762,7 @@ location - 5701313 + 5701306 @@ -38760,7 +38776,7 @@ 1 2 - 5704677 + 5704669 @@ -38776,7 +38792,7 @@ 1 2 - 5704677 + 5704669 @@ -38924,7 +38940,7 @@ 1 2 - 5701179 + 5701171 26 @@ -38945,7 +38961,7 @@ 1 2 - 5701313 + 5701306 @@ -38955,15 +38971,15 @@ preprocpair - 1103827 + 1103825 begin - 846303 + 846302 elseelifend - 1103827 + 1103825 @@ -38977,7 +38993,7 @@ 1 2 - 601561 + 601560 2 @@ -39003,7 +39019,7 @@ 1 2 - 1103827 + 1103825 @@ -39013,11 +39029,11 @@ preproctrue - 388573 + 388572 branch - 388573 + 388572 @@ -39035,19 +39051,19 @@ preproctext - 4599773 + 4690318 id - 4599773 + 4690318 head - 3333547 + 3333139 body - 1948247 + 1948244 @@ -39061,7 +39077,7 @@ 1 2 - 4599773 + 4690318 @@ -39077,7 +39093,7 @@ 1 2 - 4599773 + 4690318 @@ -39093,12 +39109,12 @@ 1 2 - 3143970 + 3143697 2 740 - 189577 + 189442 @@ -39114,7 +39130,7 @@ 1 2 - 3253357 + 3252949 2 @@ -39135,7 +39151,7 @@ 1 2 - 1763648 + 1763645 2 @@ -39144,7 +39160,7 @@ 6 - 11630 + 12303 38480 @@ -39161,16 +39177,16 @@ 1 2 - 1767549 + 1767547 2 7 - 146522 + 146521 7 - 2980 + 2977 34175 @@ -39181,15 +39197,15 @@ includes - 408672 + 408674 id - 408672 + 408674 included - 75280 + 75281 @@ -39203,7 +39219,7 @@ 1 2 - 408672 + 408674 @@ -39307,11 +39323,11 @@ link_parent - 38279006 + 38313696 element - 4869162 + 4873064 link_target @@ -39329,17 +39345,17 @@ 1 2 - 668749 + 668840 2 9 - 34026 + 33983 9 10 - 4166386 + 4170240 @@ -39358,48 +39374,48 @@ 42 - 97236 - 97237 + 97325 + 97326 42 - 97355 - 97356 + 97444 + 97445 42 - 97408 - 97409 + 97497 + 97498 42 - 97435 - 97436 + 97524 + 97525 42 - 97457 - 97458 + 97546 + 97547 42 - 97490 - 97491 + 97578 + 97579 42 - 99496 - 99497 + 99585 + 99586 42 - 102875 - 102876 + 102965 + 102966 42 - 104238 - 104239 + 104327 + 104328 42 From 39a875e7517d98e9de17c9800d1f19c8705f4016 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 15 Apr 2025 14:31:29 +0100 Subject: [PATCH 102/240] Rust: Make some summaries value type. --- .../frameworks/stdlib/lang-alloc.model.yml | 4 +- .../frameworks/stdlib/lang-core.model.yml | 4 +- .../dataflow/local/DataFlowStep.expected | 1960 +++++++++-------- 3 files changed, 985 insertions(+), 983 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml index 24cfd3aa2490..effb389aeccf 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml @@ -32,8 +32,8 @@ extensions: # Fmt - ["lang:alloc", "crate::fmt::format", "Argument[0]", "ReturnValue", "taint", "manual"] # String - - ["lang:alloc", "::as_str", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:alloc", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:alloc", "::as_str", "Argument[self]", "ReturnValue", "value", "manual"] + - ["lang:alloc", "::as_bytes", "Argument[self]", "ReturnValue", "value", "manual"] - ["lang:alloc", "<_ as crate::string::ToString>::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:alloc", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] - ["lang:alloc", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml index dcef65d2a6e4..3e37ed7797bd 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml @@ -40,8 +40,8 @@ extensions: - ["lang:core", "crate::ptr::write_unaligned", "Argument[1]", "Argument[0].Reference", "value", "manual"] - ["lang:core", "crate::ptr::write_volatile", "Argument[1]", "Argument[0].Reference", "value", "manual"] # Str - - ["lang:core", "::as_str", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:core", "::as_str", "Argument[self]", "ReturnValue", "taint", "value"] + - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "value"] - ["lang:core", "::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:core", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] - ["lang:core", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index e9c1ff8c824b..b709b2f937d0 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -943,985 +943,987 @@ models | 80 | Summary: lang:alloc; ::add; Argument[self]; ReturnValue; value | | 81 | Summary: lang:alloc; ::from_str; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | | 82 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | -| 83 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 84 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 85 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 86 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 87 | Summary: lang:alloc; ::try_unwrap; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 88 | Summary: lang:alloc; ::unwrap_or_clone; Argument[0].Reference; ReturnValue; value | -| 89 | Summary: lang:alloc; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 90 | Summary: lang:alloc; ::borrow_mut; Argument[self].Element; ReturnValue.Reference; value | -| 91 | Summary: lang:alloc; ::as_mut; Argument[self]; ReturnValue; value | -| 92 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 93 | Summary: lang:alloc; ::from; Argument[0].Field[0]; ReturnValue; value | -| 94 | Summary: lang:alloc; ::push_within_capacity; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 95 | Summary: lang:alloc; ::as_inner; Argument[self]; ReturnValue; value | -| 96 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | -| 97 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 98 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 99 | Summary: lang:alloc; ::as_into_iter; Argument[self]; ReturnValue; value | -| 100 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 101 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | -| 102 | Summary: lang:alloc; <{766}::StringError as crate::error::Error>::description; Argument[self].Field[0]; ReturnValue.Reference; value | -| 103 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[0].Reference; Argument[1].Parameter[0]; value | -| 104 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[1].ReturnValue; Argument[0].Reference; value | -| 105 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[0].Reference; Argument[1].Parameter[0]; value | -| 106 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[1].ReturnValue; Argument[0].Reference; value | -| 107 | Summary: lang:core; <&_ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 108 | Summary: lang:core; <&_ as crate::clone::Clone>::clone; Argument[self].Reference; ReturnValue; value | -| 109 | Summary: lang:core; <&_ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | -| 110 | Summary: lang:core; <&mut _ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 111 | Summary: lang:core; <&mut _ as crate::borrow::BorrowMut>::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 112 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[0]; ReturnValue; value | -| 113 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 114 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | -| 115 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[0]; ReturnValue; value | -| 116 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 117 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 118 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[0]; ReturnValue; value | -| 119 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 120 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 121 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[0]; ReturnValue; value | -| 122 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 123 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 124 | Summary: lang:core; <&mut _ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | -| 125 | Summary: lang:core; <&mut _ as crate::ops::deref::DerefMut>::deref_mut; Argument[self].Reference; ReturnValue; value | -| 126 | Summary: lang:core; <[_] as crate::convert::AsMut>::as_mut; Argument[self]; ReturnValue; value | -| 127 | Summary: lang:core; <[_] as crate::convert::AsRef>::as_ref; Argument[self]; ReturnValue; value | -| 128 | Summary: lang:core; <[_] as crate::slice::SlicePattern>::as_slice; Argument[self]; ReturnValue; value | -| 129 | Summary: lang:core; <[_]>::align_to; Argument[self]; ReturnValue.Field[0]; value | -| 130 | Summary: lang:core; <[_]>::align_to_mut; Argument[self]; ReturnValue.Field[0]; value | -| 131 | Summary: lang:core; <[_]>::as_simd; Argument[self]; ReturnValue.Field[0]; value | -| 132 | Summary: lang:core; <[_]>::as_simd_mut; Argument[self]; ReturnValue.Field[0]; value | -| 133 | Summary: lang:core; <[_]>::partition_dedup; Argument[self]; ReturnValue.Field[0]; value | -| 134 | Summary: lang:core; <[_]>::partition_dedup_by; Argument[self]; ReturnValue.Field[0]; value | -| 135 | Summary: lang:core; <[_]>::partition_dedup_by_key; Argument[self]; ReturnValue.Field[0]; value | -| 136 | Summary: lang:core; <[u8]>::trim_ascii; Argument[self]; ReturnValue; value | -| 137 | Summary: lang:core; <[u8]>::trim_ascii_end; Argument[self]; ReturnValue; value | -| 138 | Summary: lang:core; <[u8]>::trim_ascii_start; Argument[self]; ReturnValue; value | -| 139 | Summary: lang:core; <_ as crate::array::SpecArrayClone>::clone; Argument[0].Reference; ReturnValue; value | -| 140 | Summary: lang:core; <_ as crate::async_iter::async_iter::IntoAsyncIterator>::into_async_iter; Argument[self]; ReturnValue; value | -| 141 | Summary: lang:core; <_ as crate::borrow::Borrow>::borrow; Argument[self]; ReturnValue; value | -| 142 | Summary: lang:core; <_ as crate::borrow::BorrowMut>::borrow_mut; Argument[self]; ReturnValue; value | -| 143 | Summary: lang:core; <_ as crate::clone::uninit::CopySpec>::clone_one; Argument[0]; Argument[1].Reference; value | -| 144 | Summary: lang:core; <_ as crate::convert::From>::from; Argument[0]; ReturnValue; value | -| 145 | Summary: lang:core; <_ as crate::future::into_future::IntoFuture>::into_future; Argument[self]; ReturnValue; value | -| 146 | Summary: lang:core; <_ as crate::iter::adapters::step_by::SpecRangeSetup>::setup; Argument[0]; ReturnValue; value | -| 147 | Summary: lang:core; <_ as crate::iter::traits::collect::IntoIterator>::into_iter; Argument[self]; ReturnValue; value | -| 148 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[0]; Argument[self].Reference.Parameter[0]; value | -| 149 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[self].Reference.ReturnValue; ReturnValue; value | -| 150 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 151 | Summary: lang:core; ::select_unpredictable; Argument[0]; ReturnValue; value | -| 152 | Summary: lang:core; ::select_unpredictable; Argument[1]; ReturnValue; value | -| 153 | Summary: lang:core; ::then; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 154 | Summary: lang:core; ::then_some; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 155 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 156 | Summary: lang:core; ::to_ascii_lowercase; Argument[self].Reference; ReturnValue; value | -| 157 | Summary: lang:core; ::to_ascii_uppercase; Argument[self].Reference; ReturnValue; value | -| 158 | Summary: lang:core; ::borrow; Argument[self].Field[0]; ReturnValue.Reference; value | -| 159 | Summary: lang:core; ::borrow_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 160 | Summary: lang:core; ::as_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 161 | Summary: lang:core; ::as_ref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 162 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 163 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 164 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 165 | Summary: lang:core; ::index; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 166 | Summary: lang:core; ::index; Argument[self]; ReturnValue; value | -| 167 | Summary: lang:core; ::index_mut; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 168 | Summary: lang:core; ::index_mut; Argument[self]; ReturnValue; value | -| 169 | Summary: lang:core; ::as_bytes; Argument[self].Field[0]; ReturnValue.Reference; value | -| 170 | Summary: lang:core; ::update; Argument[0].ReturnValue; ReturnValue; value | -| 171 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 172 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 173 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 174 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 175 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 176 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 177 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 178 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 179 | Summary: lang:core; ::get_or_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 180 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 181 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 182 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue; ReturnValue; value | -| 183 | Summary: lang:core; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 184 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | -| 185 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 186 | Summary: lang:core; ::then; Argument[0]; ReturnValue; value | -| 187 | Summary: lang:core; ::then; Argument[self]; ReturnValue; value | -| 188 | Summary: lang:core; ::then_with; Argument[0].ReturnValue; ReturnValue; value | -| 189 | Summary: lang:core; ::then_with; Argument[self]; ReturnValue; value | -| 190 | Summary: lang:core; ::from; Argument[0]; ReturnValue; value | -| 191 | Summary: lang:core; ::provide_ref; Argument[self]; ReturnValue; value | -| 192 | Summary: lang:core; ::provide_ref_with; Argument[self]; ReturnValue; value | -| 193 | Summary: lang:core; ::provide_value; Argument[self]; ReturnValue; value | -| 194 | Summary: lang:core; ::provide_value_with; Argument[self]; ReturnValue; value | -| 195 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 196 | Summary: lang:core; ::with_copy; Argument[0].ReturnValue; ReturnValue; value | -| 197 | Summary: lang:core; ::align; Argument[self]; ReturnValue; value | -| 198 | Summary: lang:core; ::alternate; Argument[self]; ReturnValue; value | -| 199 | Summary: lang:core; ::debug_as_hex; Argument[self]; ReturnValue; value | -| 200 | Summary: lang:core; ::fill; Argument[self]; ReturnValue; value | -| 201 | Summary: lang:core; ::precision; Argument[self]; ReturnValue; value | -| 202 | Summary: lang:core; ::sign; Argument[self]; ReturnValue; value | -| 203 | Summary: lang:core; ::sign_aware_zero_pad; Argument[self]; ReturnValue; value | -| 204 | Summary: lang:core; ::width; Argument[self]; ReturnValue; value | -| 205 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 206 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 207 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | -| 208 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 209 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 210 | Summary: lang:core; ::key; Argument[self]; ReturnValue; value | -| 211 | Summary: lang:core; ::key_with; Argument[self]; ReturnValue; value | -| 212 | Summary: lang:core; ::value; Argument[self]; ReturnValue; value | -| 213 | Summary: lang:core; ::value_with; Argument[self]; ReturnValue; value | -| 214 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 215 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 216 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | -| 217 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | -| 218 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | -| 219 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | -| 220 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | -| 221 | Summary: lang:core; ::into_inner; Argument[self].Field[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 222 | Summary: lang:core; ::clear; Argument[self]; ReturnValue; value | -| 223 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | -| 224 | Summary: lang:core; ::advance; Argument[self]; ReturnValue; value | -| 225 | Summary: lang:core; ::advance_unchecked; Argument[self]; ReturnValue; value | -| 226 | Summary: lang:core; ::ensure_init; Argument[self]; ReturnValue; value | -| 227 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | -| 228 | Summary: lang:core; ::fold; Argument[0].Field[0]; ReturnValue; value | -| 229 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 230 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 231 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 232 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 233 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | -| 234 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | -| 235 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | -| 236 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 237 | Summary: lang:core; ::rfold; Argument[self].Field[0].Field[0]; ReturnValue; value | -| 238 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 239 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 240 | Summary: lang:core; ::try_rfold; Argument[self].Field[0]; ReturnValue; value | -| 241 | Summary: lang:core; ::fold; Argument[self].Field[0].Field[0]; ReturnValue; value | -| 242 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 243 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 244 | Summary: lang:core; ::try_fold; Argument[self].Field[0]; ReturnValue; value | -| 245 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 246 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 247 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 248 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 249 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 250 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 251 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 252 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 253 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 254 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 255 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 256 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 257 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 258 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 259 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 260 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 261 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 262 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 263 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 264 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 265 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 266 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 267 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 268 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 269 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 270 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 271 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 272 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 273 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 274 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 275 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 276 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 277 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 278 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 279 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 280 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 281 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 282 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 283 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 284 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 285 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 286 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 287 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 288 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 289 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 290 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 291 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 292 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 293 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 294 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 295 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 296 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 297 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 298 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 299 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 300 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 301 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 302 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 303 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 304 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 305 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 306 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 307 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 308 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 309 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 310 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 311 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 312 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 313 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 314 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 315 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 316 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 317 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 318 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 319 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 320 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 321 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 322 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 323 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 324 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 325 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 326 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 327 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 328 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 329 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 330 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 331 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 332 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 333 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 334 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 335 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 336 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 337 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 338 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 339 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 340 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 341 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 342 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 343 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 344 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 345 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 346 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 347 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 348 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 349 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 350 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 351 | Summary: lang:core; ::fold; Argument[0]; Argument[1].Parameter[0]; value | -| 352 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 353 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 354 | Summary: lang:core; ::try_fold; Argument[0]; Argument[1].Parameter[0]; value | -| 355 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 356 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 357 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 358 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 359 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 360 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 361 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 362 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 363 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 364 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 365 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 366 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 367 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 368 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 369 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 370 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 371 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 372 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 373 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 374 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 375 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 376 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 377 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 378 | Summary: lang:core; ::spec_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 379 | Summary: lang:core; ::spec_rfold; Argument[0]; ReturnValue; value | -| 380 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 381 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | -| 382 | Summary: lang:core; ::spec_try_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 383 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | -| 384 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 385 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 386 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 387 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 388 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 389 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | -| 390 | Summary: lang:core; ::rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 391 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 392 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 393 | Summary: lang:core; ::try_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 394 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 395 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 396 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 397 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 398 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 399 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 400 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 401 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 402 | Summary: lang:core; ::spec_fold; Argument[0].Field[0]; ReturnValue; value | -| 403 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 404 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 405 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 406 | Summary: lang:core; ::rfold; Argument[0].ReturnValue; ReturnValue; value | -| 407 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 408 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 409 | Summary: lang:core; ::rfold; Argument[self].Field[0]; ReturnValue; value | -| 410 | Summary: lang:core; ::rfold; Argument[self]; ReturnValue; value | -| 411 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 412 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 413 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 414 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | -| 415 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | -| 416 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | -| 417 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 418 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 419 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 420 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 421 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 422 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 423 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 424 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 425 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 426 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 427 | Summary: lang:core; ::nth_back; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 428 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 429 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 430 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 431 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 432 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 433 | Summary: lang:core; ::to_canonical; Argument[self].Reference; ReturnValue; value | -| 434 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | -| 435 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | -| 436 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | -| 437 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | -| 438 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | -| 439 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | -| 440 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | -| 441 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | -| 442 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | -| 443 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | -| 444 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | -| 445 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | -| 446 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | -| 447 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 448 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | -| 449 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | -| 450 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | -| 451 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | -| 452 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | -| 453 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | -| 454 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | -| 455 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 456 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 457 | Summary: lang:core; ::from_mut_unchecked; Argument[0]; ReturnValue; value | -| 458 | Summary: lang:core; ::new_unchecked; Argument[0]; ReturnValue; value | -| 459 | Summary: lang:core; ::get; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 460 | Summary: lang:core; ::get_mut; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 461 | Summary: lang:core; ::get_unchecked; Argument[0]; ReturnValue; value | -| 462 | Summary: lang:core; ::get_unchecked_mut; Argument[0]; ReturnValue; value | -| 463 | Summary: lang:core; ::index; Argument[0]; ReturnValue; value | -| 464 | Summary: lang:core; ::index_mut; Argument[0]; ReturnValue; value | -| 465 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | -| 466 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | -| 467 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 468 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 469 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 470 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 471 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 472 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 473 | Summary: lang:core; ::wrap_mut_1; Argument[0]; ReturnValue; value | -| 474 | Summary: lang:core; ::wrap_mut_2; Argument[0]; ReturnValue; value | -| 475 | Summary: lang:core; ::clone; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 476 | Summary: lang:core; ::from; Argument[0].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 477 | Summary: lang:core; ::from; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 478 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 479 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | -| 480 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | -| 481 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 482 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 483 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 484 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 485 | Summary: lang:core; ::cloned; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 486 | Summary: lang:core; ::copied; Argument[self].Field[crate::option::Option::Some(0)].Reference; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 487 | Summary: lang:core; ::expect; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 488 | Summary: lang:core; ::flatten; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 489 | Summary: lang:core; ::get_or_insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 490 | Summary: lang:core; ::get_or_insert; Argument[0]; ReturnValue.Reference; value | -| 491 | Summary: lang:core; ::get_or_insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 492 | Summary: lang:core; ::get_or_insert_default; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 493 | Summary: lang:core; ::get_or_insert_with; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 494 | Summary: lang:core; ::insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 495 | Summary: lang:core; ::insert; Argument[0]; ReturnValue.Reference; value | -| 496 | Summary: lang:core; ::insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 497 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | -| 498 | Summary: lang:core; ::is_none_or; Argument[0].ReturnValue; ReturnValue; value | -| 499 | Summary: lang:core; ::is_none_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 500 | Summary: lang:core; ::is_some_and; Argument[0].ReturnValue; ReturnValue; value | -| 501 | Summary: lang:core; ::is_some_and; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 502 | Summary: lang:core; ::map; Argument[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 503 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 504 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 505 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 506 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 507 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | -| 508 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | -| 509 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 510 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 511 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 512 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | -| 513 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 514 | Summary: lang:core; ::ok_or; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 515 | Summary: lang:core; ::ok_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 516 | Summary: lang:core; ::ok_or_else; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 517 | Summary: lang:core; ::ok_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 518 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | -| 519 | Summary: lang:core; ::or; Argument[self]; ReturnValue; value | -| 520 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | -| 521 | Summary: lang:core; ::or_else; Argument[self]; ReturnValue; value | -| 522 | Summary: lang:core; ::replace; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 523 | Summary: lang:core; ::replace; Argument[self].Reference; ReturnValue; value | -| 524 | Summary: lang:core; ::take; Argument[self].Reference; ReturnValue; value | -| 525 | Summary: lang:core; ::take_if; Argument[self].Reference.Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0].Reference; value | -| 526 | Summary: lang:core; ::take_if; Argument[self].Reference; ReturnValue; value | -| 527 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 528 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; value | -| 529 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 530 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | -| 531 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 532 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 533 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 534 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 535 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 536 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[0].Field[crate::option::Option::Some(0)]; value | -| 537 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[1]; ReturnValue.Field[1].Field[crate::option::Option::Some(0)]; value | -| 538 | Summary: lang:core; ::xor; Argument[0]; ReturnValue; value | -| 539 | Summary: lang:core; ::xor; Argument[self]; ReturnValue; value | -| 540 | Summary: lang:core; ::zip; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 541 | Summary: lang:core; ::zip; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 542 | Summary: lang:core; ::zip_with; Argument[0].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[1]; value | -| 543 | Summary: lang:core; ::zip_with; Argument[1].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 544 | Summary: lang:core; ::zip_with; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 545 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 546 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 547 | Summary: lang:core; ::max; Argument[0]; ReturnValue; value | -| 548 | Summary: lang:core; ::max; Argument[1]; ReturnValue; value | -| 549 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 550 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 551 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 552 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 553 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 554 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 555 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 556 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | -| 557 | Summary: lang:core; ::and; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 558 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | -| 559 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 560 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | -| 561 | Summary: lang:core; ::as_deref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 562 | Summary: lang:core; ::as_deref_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 563 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 564 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 565 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 566 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 567 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 568 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 569 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 570 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Ok(0)].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 571 | Summary: lang:core; ::err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 572 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 573 | Summary: lang:core; ::expect_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 574 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 575 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 576 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | -| 577 | Summary: lang:core; ::inspect_err; Argument[self]; ReturnValue; value | -| 578 | Summary: lang:core; ::into_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 579 | Summary: lang:core; ::into_ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 580 | Summary: lang:core; ::is_err_and; Argument[0].ReturnValue; ReturnValue; value | -| 581 | Summary: lang:core; ::is_err_and; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 582 | Summary: lang:core; ::is_ok_and; Argument[0].ReturnValue; ReturnValue; value | -| 583 | Summary: lang:core; ::is_ok_and; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | -| 584 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 585 | Summary: lang:core; ::map_err; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 586 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 587 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 588 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | -| 589 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | -| 590 | Summary: lang:core; ::map_or; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | -| 591 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 592 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | -| 593 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 594 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | -| 595 | Summary: lang:core; ::ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 596 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | -| 597 | Summary: lang:core; ::or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 598 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | -| 599 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 600 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 601 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; value | -| 602 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; value | -| 603 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 604 | Summary: lang:core; ::unwrap_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 605 | Summary: lang:core; ::unwrap_err_unchecked; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 606 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | -| 607 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 608 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 609 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 610 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)].Reference; ReturnValue; value | -| 611 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 612 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 613 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 614 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 615 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 616 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 617 | Summary: lang:core; ::collect; Argument[self].Element; ReturnValue.Element; value | -| 618 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 619 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 620 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 621 | Summary: lang:core; ::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | -| 622 | Summary: lang:core; ::map; Argument[self].Element; Argument[0].Parameter[0]; value | -| 623 | Summary: lang:core; ::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 624 | Summary: lang:core; ::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 625 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 626 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 627 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 628 | Summary: lang:core; ::call; Argument[0].Field[0]; ReturnValue; value | -| 629 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 630 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 631 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 632 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 633 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 634 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 635 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 636 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 637 | Summary: lang:core; ::matching; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 638 | Summary: lang:core; ::matching; Argument[1]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 639 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 640 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 641 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 642 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 643 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 644 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 645 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 646 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 647 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 648 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 649 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 650 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 651 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 652 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 653 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 654 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 655 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 656 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 657 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 658 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 659 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 660 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 661 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 662 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 663 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 664 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 665 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 666 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 667 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 668 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 669 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 670 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 671 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 672 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 673 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 674 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 675 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 676 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 677 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 678 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 679 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 680 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 681 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 682 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 683 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 684 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 685 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 686 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 687 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 688 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 689 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 690 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 691 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 692 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 693 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 694 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 695 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 696 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 697 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 698 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 699 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 700 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 701 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 702 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 703 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 704 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 705 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 706 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 707 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 708 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 709 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 710 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 711 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 712 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 713 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 714 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 715 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 716 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 717 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 718 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 719 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 720 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 721 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 722 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 723 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 724 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 725 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 726 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 727 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 728 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 729 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 730 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 731 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 732 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 733 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 734 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 735 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 736 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 737 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 738 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 739 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 740 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 741 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 742 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 743 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 744 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 745 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 746 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 747 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 748 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 749 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 750 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 751 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 752 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 753 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 754 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 755 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 756 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 757 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 758 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 759 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 760 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 761 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 762 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 763 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 764 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 765 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 766 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 767 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 768 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 769 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 770 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 771 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 772 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 773 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 774 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 775 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 776 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 777 | Summary: lang:core; ::as_mut; Argument[self]; ReturnValue; value | -| 778 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 779 | Summary: lang:core; ::as_str; Argument[self]; ReturnValue; value | -| 780 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 781 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 782 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 783 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 784 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 785 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 786 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 787 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 788 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 789 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 790 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 791 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 792 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 793 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 794 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 795 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 796 | Summary: lang:core; ::index; Argument[0].Reference.Element; ReturnValue.Reference; value | -| 797 | Summary: lang:core; ::index_mut; Argument[0].Reference.Element; ReturnValue.Reference; value | -| 798 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 799 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 800 | Summary: lang:core; crate::array::drain::drain_array_with; Argument[1].ReturnValue; ReturnValue; value | -| 801 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | -| 802 | Summary: lang:core; crate::cmp::max; Argument[1]; ReturnValue; value | -| 803 | Summary: lang:core; crate::cmp::max_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 804 | Summary: lang:core; crate::cmp::max_by; Argument[0]; ReturnValue; value | -| 805 | Summary: lang:core; crate::cmp::max_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 806 | Summary: lang:core; crate::cmp::max_by; Argument[1]; ReturnValue; value | -| 807 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 808 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; ReturnValue; value | -| 809 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 810 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; ReturnValue; value | -| 811 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | -| 812 | Summary: lang:core; crate::cmp::min; Argument[1]; ReturnValue; value | -| 813 | Summary: lang:core; crate::cmp::min_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 814 | Summary: lang:core; crate::cmp::min_by; Argument[0]; ReturnValue; value | -| 815 | Summary: lang:core; crate::cmp::min_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 816 | Summary: lang:core; crate::cmp::min_by; Argument[1]; ReturnValue; value | -| 817 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 818 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; ReturnValue; value | -| 819 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 820 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; ReturnValue; value | -| 821 | Summary: lang:core; crate::cmp::minmax; Argument[0]; ReturnValue.Element; value | -| 822 | Summary: lang:core; crate::cmp::minmax; Argument[1]; ReturnValue.Element; value | -| 823 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 824 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; ReturnValue.Element; value | -| 825 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 826 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; ReturnValue.Element; value | -| 827 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 828 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; ReturnValue.Element; value | -| 829 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 830 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; ReturnValue.Element; value | -| 831 | Summary: lang:core; crate::contracts::build_check_ensures; Argument[0]; ReturnValue; value | -| 832 | Summary: lang:core; crate::convert::identity; Argument[0]; ReturnValue; value | -| 833 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | -| 834 | Summary: lang:core; crate::intrinsics::contract_check_ensures; Argument[0]; Argument[1].Parameter[0]; value | -| 835 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[1]; ReturnValue; value | -| 836 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[2]; ReturnValue; value | -| 837 | Summary: lang:core; crate::iter::traits::iterator::Iterator::collect; Argument[self].Element; ReturnValue.Element; value | -| 838 | Summary: lang:core; crate::iter::traits::iterator::Iterator::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | -| 839 | Summary: lang:core; crate::iter::traits::iterator::Iterator::map; Argument[self].Element; Argument[0].Parameter[0]; value | -| 840 | Summary: lang:core; crate::iter::traits::iterator::Iterator::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 841 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 842 | Summary: lang:core; crate::mem::copy; Argument[0].Reference; ReturnValue; value | -| 843 | Summary: lang:core; crate::mem::replace; Argument[0].Reference; ReturnValue; value | -| 844 | Summary: lang:core; crate::mem::replace; Argument[1]; Argument[0].Reference; value | -| 845 | Summary: lang:core; crate::mem::take; Argument[0].Reference; ReturnValue; value | -| 846 | Summary: lang:core; crate::num::flt2dec::strategy::dragon::mul_pow10; Argument[0]; ReturnValue; value | -| 847 | Summary: lang:core; crate::num::flt2dec::to_exact_exp_str; Argument[5].Element; Argument[0].Parameter[1].Reference; value | -| 848 | Summary: lang:core; crate::num::flt2dec::to_exact_fixed_str; Argument[4].Element; Argument[0].Parameter[1].Reference; value | -| 849 | Summary: lang:core; crate::num::flt2dec::to_shortest_exp_str; Argument[5]; Argument[0].Parameter[1]; value | -| 850 | Summary: lang:core; crate::num::flt2dec::to_shortest_str; Argument[4]; Argument[0].Parameter[1]; value | -| 851 | Summary: lang:core; crate::panic::abort_unwind; Argument[0].ReturnValue; ReturnValue; value | -| 852 | Summary: lang:core; crate::ptr::from_mut; Argument[0]; ReturnValue; value | -| 853 | Summary: lang:core; crate::ptr::from_ref; Argument[0]; ReturnValue; value | -| 854 | Summary: lang:core; crate::ptr::read; Argument[0].Reference; ReturnValue; value | -| 855 | Summary: lang:core; crate::ptr::read_unaligned; Argument[0].Reference; ReturnValue; value | -| 856 | Summary: lang:core; crate::ptr::read_volatile; Argument[0].Reference; ReturnValue; value | -| 857 | Summary: lang:core; crate::ptr::replace; Argument[0].Reference; ReturnValue; value | -| 858 | Summary: lang:core; crate::ptr::write; Argument[1]; Argument[0].Reference; value | -| 859 | Summary: lang:core; crate::ptr::write_unaligned; Argument[1]; Argument[0].Reference; value | -| 860 | Summary: lang:core; crate::ptr::write_volatile; Argument[1]; Argument[0].Reference; value | -| 861 | Summary: lang:core; crate::slice::sort::shared::find_existing_run; Argument[1].ReturnValue; ReturnValue.Field[1]; value | -| 862 | Summary: lang:core; crate::slice::sort::shared::smallsort::sort4_stable; Argument[0].Reference; Argument[2].Parameter[1].Reference; value | -| 863 | Summary: lang:core; crate::str::validations::next_code_point; Argument[0].Element; ReturnValue; value | -| 864 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_lower; Argument[0]; ReturnValue.Element; value | -| 865 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_upper; Argument[0]; ReturnValue.Element; value | -| 866 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | -| 867 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | -| 868 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 869 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; ReturnValue.Reference; value | -| 870 | Summary: lang:proc_macro; <&str as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | -| 871 | Summary: lang:proc_macro; <&str as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | -| 872 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 873 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 874 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 875 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 876 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 877 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 878 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 879 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 880 | Summary: lang:proc_macro; ::into_token_stream; Argument[self]; ReturnValue; value | -| 881 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 882 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 883 | Summary: lang:proc_macro; ::take; Argument[self].Reference; ReturnValue; value | -| 884 | Summary: lang:proc_macro; ::clone; Argument[self].Reference; ReturnValue; value | -| 885 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | -| 886 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | -| 887 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | -| 888 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | -| 889 | Summary: lang:proc_macro; ::next; Argument[self].Field[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 890 | Summary: lang:proc_macro; ::error; Argument[self]; ReturnValue; value | -| 891 | Summary: lang:proc_macro; ::help; Argument[self]; ReturnValue; value | -| 892 | Summary: lang:proc_macro; ::note; Argument[self]; ReturnValue; value | -| 893 | Summary: lang:proc_macro; ::span_error; Argument[self]; ReturnValue; value | -| 894 | Summary: lang:proc_macro; ::span_help; Argument[self]; ReturnValue; value | -| 895 | Summary: lang:proc_macro; ::span_note; Argument[self]; ReturnValue; value | -| 896 | Summary: lang:proc_macro; ::span_warning; Argument[self]; ReturnValue; value | -| 897 | Summary: lang:proc_macro; ::warning; Argument[self]; ReturnValue; value | -| 898 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 899 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 900 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 901 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 902 | Summary: lang:proc_macro; ::into_spans; Argument[self]; ReturnValue; value | -| 903 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 904 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 905 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 906 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 907 | Summary: lang:proc_macro; ::decode; Argument[0].Element; ReturnValue; value | -| 908 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 909 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 910 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 911 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1].ReturnValue; ReturnValue; value | -| 912 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1]; Argument[1].Parameter[0]; value | -| 913 | Summary: lang:proc_macro; crate::bridge::client::state::with; Argument[0].ReturnValue; ReturnValue; value | -| 914 | Summary: lang:std; <&[u8] as crate::io::BufRead>::consume; Argument[self].Element; Argument[self].Reference.Reference; value | -| 915 | Summary: lang:std; <&[u8] as crate::io::BufRead>::fill_buf; Argument[self].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 916 | Summary: lang:std; <&[u8] as crate::io::Read>::read_buf_exact; Argument[self].Element; Argument[self].Reference.Reference; value | -| 917 | Summary: lang:std; <&[u8] as crate::io::Read>::read_exact; Argument[self].Element; Argument[self].Reference.Reference; value | -| 918 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_end; Argument[self].Element; Argument[self].Reference.Reference; value | -| 919 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_string; Argument[self].Element; Argument[self].Reference.Reference; value | -| 920 | Summary: lang:std; <&[u8] as crate::io::copy::BufferedReaderSpec>::copy_to; Argument[self].Element; Argument[self].Reference.Reference; value | -| 921 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | -| 922 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | -| 923 | Summary: lang:std; ::pretty; Argument[self]; ReturnValue; value | -| 924 | Summary: lang:std; ::show_backtrace; Argument[self]; ReturnValue; value | -| 925 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 926 | Summary: lang:std; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 927 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 928 | Summary: lang:std; ::deref; Argument[self].Element; ReturnValue.Reference; value | -| 929 | Summary: lang:std; ::deref_mut; Argument[self].Element; ReturnValue.Reference; value | -| 930 | Summary: lang:std; ::as_os_str; Argument[self]; ReturnValue; value | -| 931 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | -| 932 | Summary: lang:std; ::recursive; Argument[self]; ReturnValue; value | -| 933 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 934 | Summary: lang:std; ::set_created; Argument[self]; ReturnValue; value | -| 935 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 936 | Summary: lang:std; ::set_accessed; Argument[self]; ReturnValue; value | -| 937 | Summary: lang:std; ::set_modified; Argument[self]; ReturnValue; value | -| 938 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 939 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 940 | Summary: lang:std; ::custom_flags; Argument[self]; ReturnValue; value | -| 941 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | -| 942 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 943 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 944 | Summary: lang:std; ::append; Argument[self]; ReturnValue; value | -| 945 | Summary: lang:std; ::create; Argument[self]; ReturnValue; value | -| 946 | Summary: lang:std; ::create_new; Argument[self]; ReturnValue; value | -| 947 | Summary: lang:std; ::read; Argument[self]; ReturnValue; value | -| 948 | Summary: lang:std; ::truncate; Argument[self]; ReturnValue; value | -| 949 | Summary: lang:std; ::write; Argument[self]; ReturnValue; value | -| 950 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 951 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | -| 952 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | -| 953 | Summary: lang:std; ::error; Argument[self].Field[1]; ReturnValue.Reference; value | -| 954 | Summary: lang:std; ::into_error; Argument[self].Field[1]; ReturnValue; value | -| 955 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 956 | Summary: lang:std; ::into_parts; Argument[self].Field[0]; ReturnValue.Field[1]; value | -| 957 | Summary: lang:std; ::into_parts; Argument[self].Field[1]; ReturnValue.Field[0]; value | -| 958 | Summary: lang:std; ::from; Argument[0].Field[1]; ReturnValue; value | -| 959 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 960 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 961 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 962 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 963 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 964 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 965 | Summary: lang:std; ::as_fd; Argument[self].Reference; ReturnValue; value | -| 966 | Summary: lang:std; ::new; Argument[0].ReturnValue; ReturnValue; value | -| 967 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 968 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 969 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 970 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 971 | Summary: lang:std; ::as_path; Argument[self]; ReturnValue; value | -| 972 | Summary: lang:std; ::arg0; Argument[self]; ReturnValue; value | -| 973 | Summary: lang:std; ::gid; Argument[self]; ReturnValue; value | -| 974 | Summary: lang:std; ::groups; Argument[self]; ReturnValue; value | -| 975 | Summary: lang:std; ::pre_exec; Argument[self]; ReturnValue; value | -| 976 | Summary: lang:std; ::process_group; Argument[self]; ReturnValue; value | -| 977 | Summary: lang:std; ::uid; Argument[self]; ReturnValue; value | -| 978 | Summary: lang:std; ::arg; Argument[self]; ReturnValue; value | -| 979 | Summary: lang:std; ::args; Argument[self]; ReturnValue; value | -| 980 | Summary: lang:std; ::current_dir; Argument[self]; ReturnValue; value | -| 981 | Summary: lang:std; ::env; Argument[self]; ReturnValue; value | -| 982 | Summary: lang:std; ::env_clear; Argument[self]; ReturnValue; value | -| 983 | Summary: lang:std; ::env_remove; Argument[self]; ReturnValue; value | -| 984 | Summary: lang:std; ::envs; Argument[self]; ReturnValue; value | -| 985 | Summary: lang:std; ::stderr; Argument[self]; ReturnValue; value | -| 986 | Summary: lang:std; ::stdin; Argument[self]; ReturnValue; value | -| 987 | Summary: lang:std; ::stdout; Argument[self]; ReturnValue; value | -| 988 | Summary: lang:std; ::report; Argument[self]; ReturnValue; value | -| 989 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 990 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 991 | Summary: lang:std; ::is_leader; Argument[self].Field[0]; ReturnValue; value | -| 992 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 993 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 994 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 995 | Summary: lang:std; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 996 | Summary: lang:std; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | -| 997 | Summary: lang:std; ::wait; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 998 | Summary: lang:std; ::wait_timeout; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 999 | Summary: lang:std; ::wait_timeout_ms; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 1000 | Summary: lang:std; ::wait_timeout_while; Argument[0].Reference; Argument[2].Parameter[0].Reference; value | -| 1001 | Summary: lang:std; ::wait_timeout_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 1002 | Summary: lang:std; ::wait_while; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 1003 | Summary: lang:std; ::wait_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1004 | Summary: lang:std; ::timed_out; Argument[self].Field[0]; ReturnValue; value | -| 1005 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1006 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1007 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1008 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1009 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1010 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1011 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1012 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1013 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1014 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1015 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1016 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1017 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1018 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1019 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1020 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1021 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1022 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1023 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1024 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1025 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1026 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1027 | Summary: lang:std; ::as_file_desc; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1028 | Summary: lang:std; ::into_raw; Argument[self].Field[0]; ReturnValue; value | -| 1029 | Summary: lang:std; ::index; Argument[self]; ReturnValue; value | -| 1030 | Summary: lang:std; ::into_string; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1031 | Summary: lang:std; ::name; Argument[self]; ReturnValue; value | -| 1032 | Summary: lang:std; ::no_hooks; Argument[self]; ReturnValue; value | -| 1033 | Summary: lang:std; ::stack_size; Argument[self]; ReturnValue; value | -| 1034 | Summary: lang:std; ::as_u64; Argument[self].Field[0]; ReturnValue; value | -| 1035 | Summary: lang:std; ::try_with; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1036 | Summary: lang:std; ::with; Argument[0].ReturnValue; ReturnValue; value | -| 1037 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1038 | Summary: lang:std; ::duration; Argument[self].Field[0]; ReturnValue; value | -| 1039 | Summary: lang:std; ::as_raw_fd; Argument[self].Reference; ReturnValue; value | -| 1040 | Summary: lang:std; ::from_raw_fd; Argument[0]; ReturnValue; value | -| 1041 | Summary: lang:std; ::into_raw_fd; Argument[self]; ReturnValue; value | -| 1042 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::as_str; Argument[self].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 1043 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::get; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1044 | Summary: lang:std; <{491}::RewrapBox as crate::panic::PanicPayload>::get; Argument[self].Field[0].Reference; ReturnValue.Reference; value | -| 1045 | Summary: lang:std; crate::backtrace::helper::lazy_resolve; Argument[0]; ReturnValue; value | -| 1046 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1047 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue; ReturnValue; value | -| 1048 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1049 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1050 | Summary: lang:std; crate::io::default_read_vectored; Argument[0].ReturnValue; ReturnValue; value | -| 1051 | Summary: lang:std; crate::io::default_write_vectored; Argument[0].ReturnValue; ReturnValue; value | -| 1052 | Summary: lang:std; crate::sys::backtrace::__rust_begin_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | -| 1053 | Summary: lang:std; crate::sys::backtrace::__rust_end_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | -| 1054 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_path_with_cstr; Argument[1].ReturnValue; ReturnValue; value | -| 1055 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_with_cstr; Argument[1].ReturnValue; ReturnValue; value | -| 1056 | Summary: lang:std; crate::sys::pal::unix::cvt; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1057 | Summary: lang:std; crate::sys_common::ignore_notfound; Argument[0].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1058 | Summary: lang:std; crate::thread::current::set_current; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1059 | Summary: lang:std; crate::thread::current::try_with_current; Argument[0].ReturnValue; ReturnValue; value | -| 1060 | Summary: lang:std; crate::thread::with_current_name; Argument[0].ReturnValue; ReturnValue; value | -| 1061 | Summary: repo:https://github.com/rust-lang/futures-rs:futures-executor; crate::local_pool::block_on; Argument[0]; ReturnValue; value | +| 83 | Summary: lang:alloc; ::as_bytes; Argument[self]; ReturnValue; value | +| 84 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | +| 85 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 86 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 87 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 88 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 89 | Summary: lang:alloc; ::try_unwrap; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 90 | Summary: lang:alloc; ::unwrap_or_clone; Argument[0].Reference; ReturnValue; value | +| 91 | Summary: lang:alloc; ::borrow; Argument[self].Element; ReturnValue.Reference; value | +| 92 | Summary: lang:alloc; ::borrow_mut; Argument[self].Element; ReturnValue.Reference; value | +| 93 | Summary: lang:alloc; ::as_mut; Argument[self]; ReturnValue; value | +| 94 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | +| 95 | Summary: lang:alloc; ::from; Argument[0].Field[0]; ReturnValue; value | +| 96 | Summary: lang:alloc; ::push_within_capacity; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 97 | Summary: lang:alloc; ::as_inner; Argument[self]; ReturnValue; value | +| 98 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | +| 99 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 100 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 101 | Summary: lang:alloc; ::as_into_iter; Argument[self]; ReturnValue; value | +| 102 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 103 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | +| 104 | Summary: lang:alloc; <{766}::StringError as crate::error::Error>::description; Argument[self].Field[0]; ReturnValue.Reference; value | +| 105 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[0].Reference; Argument[1].Parameter[0]; value | +| 106 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[1].ReturnValue; Argument[0].Reference; value | +| 107 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[0].Reference; Argument[1].Parameter[0]; value | +| 108 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[1].ReturnValue; Argument[0].Reference; value | +| 109 | Summary: lang:core; <&_ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 110 | Summary: lang:core; <&_ as crate::clone::Clone>::clone; Argument[self].Reference; ReturnValue; value | +| 111 | Summary: lang:core; <&_ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | +| 112 | Summary: lang:core; <&mut _ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 113 | Summary: lang:core; <&mut _ as crate::borrow::BorrowMut>::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 114 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[0]; ReturnValue; value | +| 115 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 116 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | +| 117 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[0]; ReturnValue; value | +| 118 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 119 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 120 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[0]; ReturnValue; value | +| 121 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 122 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; ReturnValue; value | +| 123 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[0]; ReturnValue; value | +| 124 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 125 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 126 | Summary: lang:core; <&mut _ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | +| 127 | Summary: lang:core; <&mut _ as crate::ops::deref::DerefMut>::deref_mut; Argument[self].Reference; ReturnValue; value | +| 128 | Summary: lang:core; <[_] as crate::convert::AsMut>::as_mut; Argument[self]; ReturnValue; value | +| 129 | Summary: lang:core; <[_] as crate::convert::AsRef>::as_ref; Argument[self]; ReturnValue; value | +| 130 | Summary: lang:core; <[_] as crate::slice::SlicePattern>::as_slice; Argument[self]; ReturnValue; value | +| 131 | Summary: lang:core; <[_]>::align_to; Argument[self]; ReturnValue.Field[0]; value | +| 132 | Summary: lang:core; <[_]>::align_to_mut; Argument[self]; ReturnValue.Field[0]; value | +| 133 | Summary: lang:core; <[_]>::as_simd; Argument[self]; ReturnValue.Field[0]; value | +| 134 | Summary: lang:core; <[_]>::as_simd_mut; Argument[self]; ReturnValue.Field[0]; value | +| 135 | Summary: lang:core; <[_]>::partition_dedup; Argument[self]; ReturnValue.Field[0]; value | +| 136 | Summary: lang:core; <[_]>::partition_dedup_by; Argument[self]; ReturnValue.Field[0]; value | +| 137 | Summary: lang:core; <[_]>::partition_dedup_by_key; Argument[self]; ReturnValue.Field[0]; value | +| 138 | Summary: lang:core; <[u8]>::trim_ascii; Argument[self]; ReturnValue; value | +| 139 | Summary: lang:core; <[u8]>::trim_ascii_end; Argument[self]; ReturnValue; value | +| 140 | Summary: lang:core; <[u8]>::trim_ascii_start; Argument[self]; ReturnValue; value | +| 141 | Summary: lang:core; <_ as crate::array::SpecArrayClone>::clone; Argument[0].Reference; ReturnValue; value | +| 142 | Summary: lang:core; <_ as crate::async_iter::async_iter::IntoAsyncIterator>::into_async_iter; Argument[self]; ReturnValue; value | +| 143 | Summary: lang:core; <_ as crate::borrow::Borrow>::borrow; Argument[self]; ReturnValue; value | +| 144 | Summary: lang:core; <_ as crate::borrow::BorrowMut>::borrow_mut; Argument[self]; ReturnValue; value | +| 145 | Summary: lang:core; <_ as crate::clone::uninit::CopySpec>::clone_one; Argument[0]; Argument[1].Reference; value | +| 146 | Summary: lang:core; <_ as crate::convert::From>::from; Argument[0]; ReturnValue; value | +| 147 | Summary: lang:core; <_ as crate::future::into_future::IntoFuture>::into_future; Argument[self]; ReturnValue; value | +| 148 | Summary: lang:core; <_ as crate::iter::adapters::step_by::SpecRangeSetup>::setup; Argument[0]; ReturnValue; value | +| 149 | Summary: lang:core; <_ as crate::iter::traits::collect::IntoIterator>::into_iter; Argument[self]; ReturnValue; value | +| 150 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[0]; Argument[self].Reference.Parameter[0]; value | +| 151 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[self].Reference.ReturnValue; ReturnValue; value | +| 152 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 153 | Summary: lang:core; ::select_unpredictable; Argument[0]; ReturnValue; value | +| 154 | Summary: lang:core; ::select_unpredictable; Argument[1]; ReturnValue; value | +| 155 | Summary: lang:core; ::then; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 156 | Summary: lang:core; ::then_some; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 157 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 158 | Summary: lang:core; ::to_ascii_lowercase; Argument[self].Reference; ReturnValue; value | +| 159 | Summary: lang:core; ::to_ascii_uppercase; Argument[self].Reference; ReturnValue; value | +| 160 | Summary: lang:core; ::borrow; Argument[self].Field[0]; ReturnValue.Reference; value | +| 161 | Summary: lang:core; ::borrow_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 162 | Summary: lang:core; ::as_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 163 | Summary: lang:core; ::as_ref; Argument[self].Field[0]; ReturnValue.Reference; value | +| 164 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | +| 165 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | +| 166 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 167 | Summary: lang:core; ::index; Argument[self].Field[0].Element; ReturnValue.Reference; value | +| 168 | Summary: lang:core; ::index; Argument[self]; ReturnValue; value | +| 169 | Summary: lang:core; ::index_mut; Argument[self].Field[0].Element; ReturnValue.Reference; value | +| 170 | Summary: lang:core; ::index_mut; Argument[self]; ReturnValue; value | +| 171 | Summary: lang:core; ::as_bytes; Argument[self].Field[0]; ReturnValue.Reference; value | +| 172 | Summary: lang:core; ::update; Argument[0].ReturnValue; ReturnValue; value | +| 173 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 174 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 175 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 176 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 177 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 178 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 179 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 180 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 181 | Summary: lang:core; ::get_or_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 182 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 183 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 184 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue; ReturnValue; value | +| 185 | Summary: lang:core; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 186 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | +| 187 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | +| 188 | Summary: lang:core; ::then; Argument[0]; ReturnValue; value | +| 189 | Summary: lang:core; ::then; Argument[self]; ReturnValue; value | +| 190 | Summary: lang:core; ::then_with; Argument[0].ReturnValue; ReturnValue; value | +| 191 | Summary: lang:core; ::then_with; Argument[self]; ReturnValue; value | +| 192 | Summary: lang:core; ::from; Argument[0]; ReturnValue; value | +| 193 | Summary: lang:core; ::provide_ref; Argument[self]; ReturnValue; value | +| 194 | Summary: lang:core; ::provide_ref_with; Argument[self]; ReturnValue; value | +| 195 | Summary: lang:core; ::provide_value; Argument[self]; ReturnValue; value | +| 196 | Summary: lang:core; ::provide_value_with; Argument[self]; ReturnValue; value | +| 197 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | +| 198 | Summary: lang:core; ::with_copy; Argument[0].ReturnValue; ReturnValue; value | +| 199 | Summary: lang:core; ::align; Argument[self]; ReturnValue; value | +| 200 | Summary: lang:core; ::alternate; Argument[self]; ReturnValue; value | +| 201 | Summary: lang:core; ::debug_as_hex; Argument[self]; ReturnValue; value | +| 202 | Summary: lang:core; ::fill; Argument[self]; ReturnValue; value | +| 203 | Summary: lang:core; ::precision; Argument[self]; ReturnValue; value | +| 204 | Summary: lang:core; ::sign; Argument[self]; ReturnValue; value | +| 205 | Summary: lang:core; ::sign_aware_zero_pad; Argument[self]; ReturnValue; value | +| 206 | Summary: lang:core; ::width; Argument[self]; ReturnValue; value | +| 207 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | +| 208 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | +| 209 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | +| 210 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | +| 211 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | +| 212 | Summary: lang:core; ::key; Argument[self]; ReturnValue; value | +| 213 | Summary: lang:core; ::key_with; Argument[self]; ReturnValue; value | +| 214 | Summary: lang:core; ::value; Argument[self]; ReturnValue; value | +| 215 | Summary: lang:core; ::value_with; Argument[self]; ReturnValue; value | +| 216 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | +| 217 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | +| 218 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | +| 219 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | +| 220 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | +| 221 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | +| 222 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | +| 223 | Summary: lang:core; ::into_inner; Argument[self].Field[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 224 | Summary: lang:core; ::clear; Argument[self]; ReturnValue; value | +| 225 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | +| 226 | Summary: lang:core; ::advance; Argument[self]; ReturnValue; value | +| 227 | Summary: lang:core; ::advance_unchecked; Argument[self]; ReturnValue; value | +| 228 | Summary: lang:core; ::ensure_init; Argument[self]; ReturnValue; value | +| 229 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | +| 230 | Summary: lang:core; ::fold; Argument[0].Field[0]; ReturnValue; value | +| 231 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 232 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 233 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 234 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 235 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | +| 236 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | +| 237 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | +| 238 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 239 | Summary: lang:core; ::rfold; Argument[self].Field[0].Field[0]; ReturnValue; value | +| 240 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 241 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 242 | Summary: lang:core; ::try_rfold; Argument[self].Field[0]; ReturnValue; value | +| 243 | Summary: lang:core; ::fold; Argument[self].Field[0].Field[0]; ReturnValue; value | +| 244 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 245 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 246 | Summary: lang:core; ::try_fold; Argument[self].Field[0]; ReturnValue; value | +| 247 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 248 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 249 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 250 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 251 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 252 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 253 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 254 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 255 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 256 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 257 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 258 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 259 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 260 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 261 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 262 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 263 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 264 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 265 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 266 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 267 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 268 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 269 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 270 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 271 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 272 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 273 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 274 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 275 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 276 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 277 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 278 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 279 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 280 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 281 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 282 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 283 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 284 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 285 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 286 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 287 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 288 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 289 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 290 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 291 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 292 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 293 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 294 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 295 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 296 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 297 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 298 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 299 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 300 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 301 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 302 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 303 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 304 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 305 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 306 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 307 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 308 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 309 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 310 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 311 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 312 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 313 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 314 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 315 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 316 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 317 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 318 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 319 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 320 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 321 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 322 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 323 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 324 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 325 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 326 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 327 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 328 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 329 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 330 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 331 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 332 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 333 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 334 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 335 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 336 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 337 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 338 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 339 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 340 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 341 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 342 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 343 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 344 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 345 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 346 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 347 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 348 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 349 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 350 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 351 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 352 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 353 | Summary: lang:core; ::fold; Argument[0]; Argument[1].Parameter[0]; value | +| 354 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 355 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 356 | Summary: lang:core; ::try_fold; Argument[0]; Argument[1].Parameter[0]; value | +| 357 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 358 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 359 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 360 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 361 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 362 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 363 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 364 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 365 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 366 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 367 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 368 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 369 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 370 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 371 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 372 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 373 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 374 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 375 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 376 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 377 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 378 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 379 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 380 | Summary: lang:core; ::spec_rfold; Argument[0]; Argument[1].Parameter[0]; value | +| 381 | Summary: lang:core; ::spec_rfold; Argument[0]; ReturnValue; value | +| 382 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 383 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | +| 384 | Summary: lang:core; ::spec_try_rfold; Argument[0]; Argument[1].Parameter[0]; value | +| 385 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | +| 386 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 387 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 388 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | +| 389 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 390 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | +| 391 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | +| 392 | Summary: lang:core; ::rfold; Argument[0]; Argument[1].Parameter[0]; value | +| 393 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 394 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 395 | Summary: lang:core; ::try_rfold; Argument[0]; Argument[1].Parameter[0]; value | +| 396 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 397 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 398 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 399 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 400 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 401 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 402 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 403 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 404 | Summary: lang:core; ::spec_fold; Argument[0].Field[0]; ReturnValue; value | +| 405 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | +| 406 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 407 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | +| 408 | Summary: lang:core; ::rfold; Argument[0].ReturnValue; ReturnValue; value | +| 409 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 410 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 411 | Summary: lang:core; ::rfold; Argument[self].Field[0]; ReturnValue; value | +| 412 | Summary: lang:core; ::rfold; Argument[self]; ReturnValue; value | +| 413 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 414 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 415 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 416 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | +| 417 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | +| 418 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | +| 419 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 420 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 421 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | +| 422 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 423 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | +| 424 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 425 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 426 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 427 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 428 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 429 | Summary: lang:core; ::nth_back; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 430 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 431 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 432 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 433 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 434 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 435 | Summary: lang:core; ::to_canonical; Argument[self].Reference; ReturnValue; value | +| 436 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | +| 437 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | +| 438 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | +| 439 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | +| 440 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | +| 441 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | +| 442 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | +| 443 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | +| 444 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | +| 445 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | +| 446 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | +| 447 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | +| 448 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | +| 449 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | +| 450 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | +| 451 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | +| 452 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | +| 453 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | +| 454 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | +| 455 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | +| 456 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | +| 457 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | +| 458 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 459 | Summary: lang:core; ::from_mut_unchecked; Argument[0]; ReturnValue; value | +| 460 | Summary: lang:core; ::new_unchecked; Argument[0]; ReturnValue; value | +| 461 | Summary: lang:core; ::get; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 462 | Summary: lang:core; ::get_mut; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 463 | Summary: lang:core; ::get_unchecked; Argument[0]; ReturnValue; value | +| 464 | Summary: lang:core; ::get_unchecked_mut; Argument[0]; ReturnValue; value | +| 465 | Summary: lang:core; ::index; Argument[0]; ReturnValue; value | +| 466 | Summary: lang:core; ::index_mut; Argument[0]; ReturnValue; value | +| 467 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | +| 468 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | +| 469 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 470 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 471 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 472 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 473 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 474 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 475 | Summary: lang:core; ::wrap_mut_1; Argument[0]; ReturnValue; value | +| 476 | Summary: lang:core; ::wrap_mut_2; Argument[0]; ReturnValue; value | +| 477 | Summary: lang:core; ::clone; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 478 | Summary: lang:core; ::from; Argument[0].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | +| 479 | Summary: lang:core; ::from; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 480 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 481 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | +| 482 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | +| 483 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | +| 484 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 485 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | +| 486 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | +| 487 | Summary: lang:core; ::cloned; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 488 | Summary: lang:core; ::copied; Argument[self].Field[crate::option::Option::Some(0)].Reference; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 489 | Summary: lang:core; ::expect; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 490 | Summary: lang:core; ::flatten; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 491 | Summary: lang:core; ::get_or_insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | +| 492 | Summary: lang:core; ::get_or_insert; Argument[0]; ReturnValue.Reference; value | +| 493 | Summary: lang:core; ::get_or_insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | +| 494 | Summary: lang:core; ::get_or_insert_default; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | +| 495 | Summary: lang:core; ::get_or_insert_with; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | +| 496 | Summary: lang:core; ::insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | +| 497 | Summary: lang:core; ::insert; Argument[0]; ReturnValue.Reference; value | +| 498 | Summary: lang:core; ::insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | +| 499 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | +| 500 | Summary: lang:core; ::is_none_or; Argument[0].ReturnValue; ReturnValue; value | +| 501 | Summary: lang:core; ::is_none_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | +| 502 | Summary: lang:core; ::is_some_and; Argument[0].ReturnValue; ReturnValue; value | +| 503 | Summary: lang:core; ::is_some_and; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | +| 504 | Summary: lang:core; ::map; Argument[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 505 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 506 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | +| 507 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | +| 508 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | +| 509 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | +| 510 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | +| 511 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | +| 512 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 513 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 514 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | +| 515 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | +| 516 | Summary: lang:core; ::ok_or; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 517 | Summary: lang:core; ::ok_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 518 | Summary: lang:core; ::ok_or_else; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 519 | Summary: lang:core; ::ok_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 520 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | +| 521 | Summary: lang:core; ::or; Argument[self]; ReturnValue; value | +| 522 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | +| 523 | Summary: lang:core; ::or_else; Argument[self]; ReturnValue; value | +| 524 | Summary: lang:core; ::replace; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | +| 525 | Summary: lang:core; ::replace; Argument[self].Reference; ReturnValue; value | +| 526 | Summary: lang:core; ::take; Argument[self].Reference; ReturnValue; value | +| 527 | Summary: lang:core; ::take_if; Argument[self].Reference.Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0].Reference; value | +| 528 | Summary: lang:core; ::take_if; Argument[self].Reference; ReturnValue; value | +| 529 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 530 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; value | +| 531 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 532 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | +| 533 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 534 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 535 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 536 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 537 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 538 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[0].Field[crate::option::Option::Some(0)]; value | +| 539 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[1]; ReturnValue.Field[1].Field[crate::option::Option::Some(0)]; value | +| 540 | Summary: lang:core; ::xor; Argument[0]; ReturnValue; value | +| 541 | Summary: lang:core; ::xor; Argument[self]; ReturnValue; value | +| 542 | Summary: lang:core; ::zip; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | +| 543 | Summary: lang:core; ::zip; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | +| 544 | Summary: lang:core; ::zip_with; Argument[0].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[1]; value | +| 545 | Summary: lang:core; ::zip_with; Argument[1].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 546 | Summary: lang:core; ::zip_with; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | +| 547 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | +| 548 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 549 | Summary: lang:core; ::max; Argument[0]; ReturnValue; value | +| 550 | Summary: lang:core; ::max; Argument[1]; ReturnValue; value | +| 551 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 552 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 553 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | +| 554 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 555 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 556 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 557 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 558 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | +| 559 | Summary: lang:core; ::and; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 560 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | +| 561 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 562 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | +| 563 | Summary: lang:core; ::as_deref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | +| 564 | Summary: lang:core; ::as_deref_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | +| 565 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | +| 566 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | +| 567 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | +| 568 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | +| 569 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 570 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 571 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 572 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Ok(0)].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 573 | Summary: lang:core; ::err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 574 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 575 | Summary: lang:core; ::expect_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | +| 576 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 577 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 578 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | +| 579 | Summary: lang:core; ::inspect_err; Argument[self]; ReturnValue; value | +| 580 | Summary: lang:core; ::into_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | +| 581 | Summary: lang:core; ::into_ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 582 | Summary: lang:core; ::is_err_and; Argument[0].ReturnValue; ReturnValue; value | +| 583 | Summary: lang:core; ::is_err_and; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 584 | Summary: lang:core; ::is_ok_and; Argument[0].ReturnValue; ReturnValue; value | +| 585 | Summary: lang:core; ::is_ok_and; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | +| 586 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 587 | Summary: lang:core; ::map_err; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 588 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 589 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 590 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | +| 591 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | +| 592 | Summary: lang:core; ::map_or; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | +| 593 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 594 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | +| 595 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 596 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | +| 597 | Summary: lang:core; ::ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 598 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | +| 599 | Summary: lang:core; ::or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 600 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | +| 601 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 602 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 603 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; value | +| 604 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; value | +| 605 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 606 | Summary: lang:core; ::unwrap_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | +| 607 | Summary: lang:core; ::unwrap_err_unchecked; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | +| 608 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | +| 609 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 610 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 611 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 612 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)].Reference; ReturnValue; value | +| 613 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 614 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 615 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 616 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 617 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 618 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 619 | Summary: lang:core; ::collect; Argument[self].Element; ReturnValue.Element; value | +| 620 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 621 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 622 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 623 | Summary: lang:core; ::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | +| 624 | Summary: lang:core; ::map; Argument[self].Element; Argument[0].Parameter[0]; value | +| 625 | Summary: lang:core; ::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 626 | Summary: lang:core; ::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 627 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 628 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 629 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 630 | Summary: lang:core; ::call; Argument[0].Field[0]; ReturnValue; value | +| 631 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 632 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 633 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 634 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 635 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 636 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 637 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 638 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 639 | Summary: lang:core; ::matching; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | +| 640 | Summary: lang:core; ::matching; Argument[1]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | +| 641 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | +| 642 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | +| 643 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 644 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | +| 645 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | +| 646 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | +| 647 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | +| 648 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | +| 649 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | +| 650 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | +| 651 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | +| 652 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | +| 653 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 654 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | +| 655 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | +| 656 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | +| 657 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | +| 658 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | +| 659 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | +| 660 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | +| 661 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | +| 662 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | +| 663 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 664 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | +| 665 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | +| 666 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | +| 667 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | +| 668 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | +| 669 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | +| 670 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | +| 671 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | +| 672 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | +| 673 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 674 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | +| 675 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | +| 676 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | +| 677 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | +| 678 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | +| 679 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | +| 680 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | +| 681 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | +| 682 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | +| 683 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 684 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 685 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 686 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 687 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 688 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 689 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 690 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 691 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 692 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 693 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 694 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 695 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 696 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 697 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 698 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 699 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 700 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 701 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 702 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 703 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 704 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 705 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 706 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 707 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 708 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 709 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 710 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 711 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 712 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 713 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 714 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 715 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 716 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 717 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 718 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 719 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 720 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 721 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 722 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 723 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 724 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 725 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 726 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 727 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 728 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 729 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 730 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 731 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 732 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 733 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 734 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 735 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 736 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 737 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 738 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 739 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 740 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 741 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 742 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 743 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 744 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 745 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 746 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 747 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 748 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 749 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 750 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 751 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 752 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 753 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 754 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 755 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 756 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 757 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 758 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 759 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 760 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 761 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 762 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 763 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 764 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 765 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 766 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 767 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 768 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 769 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 770 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 771 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 772 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 773 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 774 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 775 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 776 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 777 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 778 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 779 | Summary: lang:core; ::as_mut; Argument[self]; ReturnValue; value | +| 780 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | +| 781 | Summary: lang:core; ::as_str; Argument[self]; ReturnValue; value | +| 782 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 783 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 784 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 785 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 786 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 787 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 788 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 789 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 790 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 791 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 792 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 793 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 794 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 795 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 796 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 797 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 798 | Summary: lang:core; ::index; Argument[0].Reference.Element; ReturnValue.Reference; value | +| 799 | Summary: lang:core; ::index_mut; Argument[0].Reference.Element; ReturnValue.Reference; value | +| 800 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 801 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 802 | Summary: lang:core; crate::array::drain::drain_array_with; Argument[1].ReturnValue; ReturnValue; value | +| 803 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | +| 804 | Summary: lang:core; crate::cmp::max; Argument[1]; ReturnValue; value | +| 805 | Summary: lang:core; crate::cmp::max_by; Argument[0]; Argument[2].Parameter[1].Reference; value | +| 806 | Summary: lang:core; crate::cmp::max_by; Argument[0]; ReturnValue; value | +| 807 | Summary: lang:core; crate::cmp::max_by; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 808 | Summary: lang:core; crate::cmp::max_by; Argument[1]; ReturnValue; value | +| 809 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | +| 810 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; ReturnValue; value | +| 811 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 812 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; ReturnValue; value | +| 813 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | +| 814 | Summary: lang:core; crate::cmp::min; Argument[1]; ReturnValue; value | +| 815 | Summary: lang:core; crate::cmp::min_by; Argument[0]; Argument[2].Parameter[1].Reference; value | +| 816 | Summary: lang:core; crate::cmp::min_by; Argument[0]; ReturnValue; value | +| 817 | Summary: lang:core; crate::cmp::min_by; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 818 | Summary: lang:core; crate::cmp::min_by; Argument[1]; ReturnValue; value | +| 819 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | +| 820 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; ReturnValue; value | +| 821 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 822 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; ReturnValue; value | +| 823 | Summary: lang:core; crate::cmp::minmax; Argument[0]; ReturnValue.Element; value | +| 824 | Summary: lang:core; crate::cmp::minmax; Argument[1]; ReturnValue.Element; value | +| 825 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; Argument[2].Parameter[1].Reference; value | +| 826 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; ReturnValue.Element; value | +| 827 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 828 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; ReturnValue.Element; value | +| 829 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | +| 830 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; ReturnValue.Element; value | +| 831 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 832 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; ReturnValue.Element; value | +| 833 | Summary: lang:core; crate::contracts::build_check_ensures; Argument[0]; ReturnValue; value | +| 834 | Summary: lang:core; crate::convert::identity; Argument[0]; ReturnValue; value | +| 835 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | +| 836 | Summary: lang:core; crate::intrinsics::contract_check_ensures; Argument[0]; Argument[1].Parameter[0]; value | +| 837 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[1]; ReturnValue; value | +| 838 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[2]; ReturnValue; value | +| 839 | Summary: lang:core; crate::iter::traits::iterator::Iterator::collect; Argument[self].Element; ReturnValue.Element; value | +| 840 | Summary: lang:core; crate::iter::traits::iterator::Iterator::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | +| 841 | Summary: lang:core; crate::iter::traits::iterator::Iterator::map; Argument[self].Element; Argument[0].Parameter[0]; value | +| 842 | Summary: lang:core; crate::iter::traits::iterator::Iterator::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 843 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 844 | Summary: lang:core; crate::mem::copy; Argument[0].Reference; ReturnValue; value | +| 845 | Summary: lang:core; crate::mem::replace; Argument[0].Reference; ReturnValue; value | +| 846 | Summary: lang:core; crate::mem::replace; Argument[1]; Argument[0].Reference; value | +| 847 | Summary: lang:core; crate::mem::take; Argument[0].Reference; ReturnValue; value | +| 848 | Summary: lang:core; crate::num::flt2dec::strategy::dragon::mul_pow10; Argument[0]; ReturnValue; value | +| 849 | Summary: lang:core; crate::num::flt2dec::to_exact_exp_str; Argument[5].Element; Argument[0].Parameter[1].Reference; value | +| 850 | Summary: lang:core; crate::num::flt2dec::to_exact_fixed_str; Argument[4].Element; Argument[0].Parameter[1].Reference; value | +| 851 | Summary: lang:core; crate::num::flt2dec::to_shortest_exp_str; Argument[5]; Argument[0].Parameter[1]; value | +| 852 | Summary: lang:core; crate::num::flt2dec::to_shortest_str; Argument[4]; Argument[0].Parameter[1]; value | +| 853 | Summary: lang:core; crate::panic::abort_unwind; Argument[0].ReturnValue; ReturnValue; value | +| 854 | Summary: lang:core; crate::ptr::from_mut; Argument[0]; ReturnValue; value | +| 855 | Summary: lang:core; crate::ptr::from_ref; Argument[0]; ReturnValue; value | +| 856 | Summary: lang:core; crate::ptr::read; Argument[0].Reference; ReturnValue; value | +| 857 | Summary: lang:core; crate::ptr::read_unaligned; Argument[0].Reference; ReturnValue; value | +| 858 | Summary: lang:core; crate::ptr::read_volatile; Argument[0].Reference; ReturnValue; value | +| 859 | Summary: lang:core; crate::ptr::replace; Argument[0].Reference; ReturnValue; value | +| 860 | Summary: lang:core; crate::ptr::write; Argument[1]; Argument[0].Reference; value | +| 861 | Summary: lang:core; crate::ptr::write_unaligned; Argument[1]; Argument[0].Reference; value | +| 862 | Summary: lang:core; crate::ptr::write_volatile; Argument[1]; Argument[0].Reference; value | +| 863 | Summary: lang:core; crate::slice::sort::shared::find_existing_run; Argument[1].ReturnValue; ReturnValue.Field[1]; value | +| 864 | Summary: lang:core; crate::slice::sort::shared::smallsort::sort4_stable; Argument[0].Reference; Argument[2].Parameter[1].Reference; value | +| 865 | Summary: lang:core; crate::str::validations::next_code_point; Argument[0].Element; ReturnValue; value | +| 866 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_lower; Argument[0]; ReturnValue.Element; value | +| 867 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_upper; Argument[0]; ReturnValue.Element; value | +| 868 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | +| 869 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | +| 870 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; Argument[0].Reference.Reference; value | +| 871 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; ReturnValue.Reference; value | +| 872 | Summary: lang:proc_macro; <&str as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | +| 873 | Summary: lang:proc_macro; <&str as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | +| 874 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 875 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 876 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 877 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 878 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 879 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 880 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 881 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 882 | Summary: lang:proc_macro; ::into_token_stream; Argument[self]; ReturnValue; value | +| 883 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 884 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 885 | Summary: lang:proc_macro; ::take; Argument[self].Reference; ReturnValue; value | +| 886 | Summary: lang:proc_macro; ::clone; Argument[self].Reference; ReturnValue; value | +| 887 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | +| 888 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | +| 889 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | +| 890 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | +| 891 | Summary: lang:proc_macro; ::next; Argument[self].Field[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 892 | Summary: lang:proc_macro; ::error; Argument[self]; ReturnValue; value | +| 893 | Summary: lang:proc_macro; ::help; Argument[self]; ReturnValue; value | +| 894 | Summary: lang:proc_macro; ::note; Argument[self]; ReturnValue; value | +| 895 | Summary: lang:proc_macro; ::span_error; Argument[self]; ReturnValue; value | +| 896 | Summary: lang:proc_macro; ::span_help; Argument[self]; ReturnValue; value | +| 897 | Summary: lang:proc_macro; ::span_note; Argument[self]; ReturnValue; value | +| 898 | Summary: lang:proc_macro; ::span_warning; Argument[self]; ReturnValue; value | +| 899 | Summary: lang:proc_macro; ::warning; Argument[self]; ReturnValue; value | +| 900 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 901 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 902 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 903 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 904 | Summary: lang:proc_macro; ::into_spans; Argument[self]; ReturnValue; value | +| 905 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | +| 906 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 907 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 908 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | +| 909 | Summary: lang:proc_macro; ::decode; Argument[0].Element; ReturnValue; value | +| 910 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 911 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 912 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | +| 913 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1].ReturnValue; ReturnValue; value | +| 914 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1]; Argument[1].Parameter[0]; value | +| 915 | Summary: lang:proc_macro; crate::bridge::client::state::with; Argument[0].ReturnValue; ReturnValue; value | +| 916 | Summary: lang:std; <&[u8] as crate::io::BufRead>::consume; Argument[self].Element; Argument[self].Reference.Reference; value | +| 917 | Summary: lang:std; <&[u8] as crate::io::BufRead>::fill_buf; Argument[self].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 918 | Summary: lang:std; <&[u8] as crate::io::Read>::read_buf_exact; Argument[self].Element; Argument[self].Reference.Reference; value | +| 919 | Summary: lang:std; <&[u8] as crate::io::Read>::read_exact; Argument[self].Element; Argument[self].Reference.Reference; value | +| 920 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_end; Argument[self].Element; Argument[self].Reference.Reference; value | +| 921 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_string; Argument[self].Element; Argument[self].Reference.Reference; value | +| 922 | Summary: lang:std; <&[u8] as crate::io::copy::BufferedReaderSpec>::copy_to; Argument[self].Element; Argument[self].Reference.Reference; value | +| 923 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | +| 924 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | +| 925 | Summary: lang:std; ::pretty; Argument[self]; ReturnValue; value | +| 926 | Summary: lang:std; ::show_backtrace; Argument[self]; ReturnValue; value | +| 927 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | +| 928 | Summary: lang:std; ::borrow; Argument[self].Element; ReturnValue.Reference; value | +| 929 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | +| 930 | Summary: lang:std; ::deref; Argument[self].Element; ReturnValue.Reference; value | +| 931 | Summary: lang:std; ::deref_mut; Argument[self].Element; ReturnValue.Reference; value | +| 932 | Summary: lang:std; ::as_os_str; Argument[self]; ReturnValue; value | +| 933 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | +| 934 | Summary: lang:std; ::recursive; Argument[self]; ReturnValue; value | +| 935 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 936 | Summary: lang:std; ::set_created; Argument[self]; ReturnValue; value | +| 937 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 938 | Summary: lang:std; ::set_accessed; Argument[self]; ReturnValue; value | +| 939 | Summary: lang:std; ::set_modified; Argument[self]; ReturnValue; value | +| 940 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 941 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 942 | Summary: lang:std; ::custom_flags; Argument[self]; ReturnValue; value | +| 943 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | +| 944 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 945 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 946 | Summary: lang:std; ::append; Argument[self]; ReturnValue; value | +| 947 | Summary: lang:std; ::create; Argument[self]; ReturnValue; value | +| 948 | Summary: lang:std; ::create_new; Argument[self]; ReturnValue; value | +| 949 | Summary: lang:std; ::read; Argument[self]; ReturnValue; value | +| 950 | Summary: lang:std; ::truncate; Argument[self]; ReturnValue; value | +| 951 | Summary: lang:std; ::write; Argument[self]; ReturnValue; value | +| 952 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 953 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | +| 954 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | +| 955 | Summary: lang:std; ::error; Argument[self].Field[1]; ReturnValue.Reference; value | +| 956 | Summary: lang:std; ::into_error; Argument[self].Field[1]; ReturnValue; value | +| 957 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 958 | Summary: lang:std; ::into_parts; Argument[self].Field[0]; ReturnValue.Field[1]; value | +| 959 | Summary: lang:std; ::into_parts; Argument[self].Field[1]; ReturnValue.Field[0]; value | +| 960 | Summary: lang:std; ::from; Argument[0].Field[1]; ReturnValue; value | +| 961 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 962 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 963 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 964 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 965 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 966 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 967 | Summary: lang:std; ::as_fd; Argument[self].Reference; ReturnValue; value | +| 968 | Summary: lang:std; ::new; Argument[0].ReturnValue; ReturnValue; value | +| 969 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 970 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 971 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | +| 972 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | +| 973 | Summary: lang:std; ::as_path; Argument[self]; ReturnValue; value | +| 974 | Summary: lang:std; ::arg0; Argument[self]; ReturnValue; value | +| 975 | Summary: lang:std; ::gid; Argument[self]; ReturnValue; value | +| 976 | Summary: lang:std; ::groups; Argument[self]; ReturnValue; value | +| 977 | Summary: lang:std; ::pre_exec; Argument[self]; ReturnValue; value | +| 978 | Summary: lang:std; ::process_group; Argument[self]; ReturnValue; value | +| 979 | Summary: lang:std; ::uid; Argument[self]; ReturnValue; value | +| 980 | Summary: lang:std; ::arg; Argument[self]; ReturnValue; value | +| 981 | Summary: lang:std; ::args; Argument[self]; ReturnValue; value | +| 982 | Summary: lang:std; ::current_dir; Argument[self]; ReturnValue; value | +| 983 | Summary: lang:std; ::env; Argument[self]; ReturnValue; value | +| 984 | Summary: lang:std; ::env_clear; Argument[self]; ReturnValue; value | +| 985 | Summary: lang:std; ::env_remove; Argument[self]; ReturnValue; value | +| 986 | Summary: lang:std; ::envs; Argument[self]; ReturnValue; value | +| 987 | Summary: lang:std; ::stderr; Argument[self]; ReturnValue; value | +| 988 | Summary: lang:std; ::stdin; Argument[self]; ReturnValue; value | +| 989 | Summary: lang:std; ::stdout; Argument[self]; ReturnValue; value | +| 990 | Summary: lang:std; ::report; Argument[self]; ReturnValue; value | +| 991 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 992 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 993 | Summary: lang:std; ::is_leader; Argument[self].Field[0]; ReturnValue; value | +| 994 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 995 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 996 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 997 | Summary: lang:std; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 998 | Summary: lang:std; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | +| 999 | Summary: lang:std; ::wait; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 1000 | Summary: lang:std; ::wait_timeout; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | +| 1001 | Summary: lang:std; ::wait_timeout_ms; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | +| 1002 | Summary: lang:std; ::wait_timeout_while; Argument[0].Reference; Argument[2].Parameter[0].Reference; value | +| 1003 | Summary: lang:std; ::wait_timeout_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | +| 1004 | Summary: lang:std; ::wait_while; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 1005 | Summary: lang:std; ::wait_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 1006 | Summary: lang:std; ::timed_out; Argument[self].Field[0]; ReturnValue; value | +| 1007 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1008 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1009 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1010 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1011 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1012 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1013 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1014 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1015 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1016 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1017 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1018 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1019 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1020 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1021 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1022 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1023 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1024 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1025 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1026 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1027 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1028 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1029 | Summary: lang:std; ::as_file_desc; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1030 | Summary: lang:std; ::into_raw; Argument[self].Field[0]; ReturnValue; value | +| 1031 | Summary: lang:std; ::index; Argument[self]; ReturnValue; value | +| 1032 | Summary: lang:std; ::into_string; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1033 | Summary: lang:std; ::name; Argument[self]; ReturnValue; value | +| 1034 | Summary: lang:std; ::no_hooks; Argument[self]; ReturnValue; value | +| 1035 | Summary: lang:std; ::stack_size; Argument[self]; ReturnValue; value | +| 1036 | Summary: lang:std; ::as_u64; Argument[self].Field[0]; ReturnValue; value | +| 1037 | Summary: lang:std; ::try_with; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 1038 | Summary: lang:std; ::with; Argument[0].ReturnValue; ReturnValue; value | +| 1039 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1040 | Summary: lang:std; ::duration; Argument[self].Field[0]; ReturnValue; value | +| 1041 | Summary: lang:std; ::as_raw_fd; Argument[self].Reference; ReturnValue; value | +| 1042 | Summary: lang:std; ::from_raw_fd; Argument[0]; ReturnValue; value | +| 1043 | Summary: lang:std; ::into_raw_fd; Argument[self]; ReturnValue; value | +| 1044 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::as_str; Argument[self].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 1045 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::get; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1046 | Summary: lang:std; <{491}::RewrapBox as crate::panic::PanicPayload>::get; Argument[self].Field[0].Reference; ReturnValue.Reference; value | +| 1047 | Summary: lang:std; crate::backtrace::helper::lazy_resolve; Argument[0]; ReturnValue; value | +| 1048 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1049 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue; ReturnValue; value | +| 1050 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1051 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1052 | Summary: lang:std; crate::io::default_read_vectored; Argument[0].ReturnValue; ReturnValue; value | +| 1053 | Summary: lang:std; crate::io::default_write_vectored; Argument[0].ReturnValue; ReturnValue; value | +| 1054 | Summary: lang:std; crate::sys::backtrace::__rust_begin_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | +| 1055 | Summary: lang:std; crate::sys::backtrace::__rust_end_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | +| 1056 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_path_with_cstr; Argument[1].ReturnValue; ReturnValue; value | +| 1057 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_with_cstr; Argument[1].ReturnValue; ReturnValue; value | +| 1058 | Summary: lang:std; crate::sys::pal::unix::cvt; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 1059 | Summary: lang:std; crate::sys_common::ignore_notfound; Argument[0].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1060 | Summary: lang:std; crate::thread::current::set_current; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1061 | Summary: lang:std; crate::thread::current::try_with_current; Argument[0].ReturnValue; ReturnValue; value | +| 1062 | Summary: lang:std; crate::thread::with_current_name; Argument[0].ReturnValue; ReturnValue; value | +| 1063 | Summary: repo:https://github.com/rust-lang/futures-rs:futures-executor; crate::local_pool::block_on; Argument[0]; ReturnValue; value | storeStep | file://:0:0:0:0 | [summary] to write: Argument[0].Field[crate::option::Option::Some(0)] in lang:core::_::::zip_with | Some | file://:0:0:0:0 | [post] [summary param] 0 in lang:core::_::::zip_with | | file://:0:0:0:0 | [summary] to write: Argument[0].Parameter[0].Reference in lang:alloc::_::::retain | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Parameter[0] in lang:alloc::_::::retain | From 2c31363680154c32b4a5049f824e0f3e80767f93 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Tue, 15 Apr 2025 17:09:12 +0200 Subject: [PATCH 103/240] Partially revert "Rust: fix compilation errors" This reverts commit 260322b669e436f5f7776869b363489b202459d2. --- rust/extractor/src/crate_graph.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 88802e6239b6..4fea5d9984d5 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -18,18 +18,17 @@ use ra_ap_hir_def::{ }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; +use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; use ra_ap_hir_ty::WhereClause; +use ra_ap_hir_ty::db::InternedCallableDefId; +use ra_ap_hir_ty::from_assoc_type_id; use ra_ap_hir_ty::{Binders, FnPointer}; use ra_ap_hir_ty::{Interner, ProjectionTy}; -use ra_ap_hir_ty::{TraitRefExt, from_assoc_type_id}; use ra_ap_ide_db::RootDatabase; use ra_ap_vfs::{Vfs, VfsPath}; -use ra_ap_hir_def::data::ConstFlags; -use ra_ap_hir_def::item_tree::StaticFlags; -use ra_ap_hir_ty::db::InternedCallableDefId; use std::hash::Hasher; use std::{cmp::Ordering, collections::HashMap, path::PathBuf}; use std::{hash::Hash, vec}; @@ -377,7 +376,7 @@ fn emit_const( attrs: vec![], body: None, is_const: true, - is_default: konst.flags.contains(ConstFlags::HAS_BODY), + is_default: konst.has_body(), type_repr, visibility, }) @@ -410,9 +409,9 @@ fn emit_static( body: None, type_repr, visibility, - is_mut: statik.flags.contains(StaticFlags::MUTABLE), + is_mut: statik.mutable(), is_static: true, - is_unsafe: statik.flags.contains(StaticFlags::HAS_UNSAFE_KW), + is_unsafe: statik.has_unsafe_kw(), }) .into(), ); @@ -1307,7 +1306,7 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari trap.emit(generated::StructField { id: trap::TrapId::Star, attrs: vec![], - is_unsafe: false, + is_unsafe: field_data[field_id].is_unsafe, name, type_repr, visibility, From a7ccba9aeb58979b64c51ddd3770dbd2951a941a Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 28 Mar 2025 16:30:33 +0100 Subject: [PATCH 104/240] Rust: crate graph: type variables --- rust/extractor/src/crate_graph.rs | 127 ++++++++++++++---- .../extractor-tests/crate_graph/module.rs | 10 ++ .../crate_graph/modules.expected | 15 ++- 3 files changed, 120 insertions(+), 32 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 4fea5d9984d5..f75224f3fdfc 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -18,6 +18,7 @@ use ra_ap_hir_def::{ }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; +use ra_ap_hir_ty::GenericArg; use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; @@ -244,7 +245,7 @@ fn emit_reexport( name, }) }); - let path = make_qualified_path(trap, path_components); + let path = make_qualified_path(trap, path_components, None); let use_tree = trap.emit(generated::UseTree { id: trap::TrapId::Star, is_glob: false, @@ -638,15 +639,13 @@ fn emit_module_impls( module.scope.impls().for_each(|imp| { let self_ty = db.impl_self_ty(imp); let self_ty = emit_hir_ty(trap, db, self_ty.skip_binders()); - let imp_data = db.impl_data(imp); - let trait_ = imp_data - .target_trait - .as_ref() - .and_then(|t| make_qualified_path(trap, emit_hir_path(&imp_data.types_map[t.path]))); - let trait_ = trait_.map(|trait_| { + let path = db + .impl_trait(imp) + .map(|trait_ref| trait_path(db, trap, trait_ref.skip_binders())); + let trait_ = path.map(|path| { trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, - path: Some(trait_), + path, }) .into() }); @@ -759,7 +758,7 @@ fn emit_visibility( Visibility::Module(_, VisibilityExplicitness::Implicit) => None, }; path.map(|path| { - let path = make_qualified_path(trap, path); + let path = make_qualified_path(trap, path, None); trap.emit(generated::Visibility { id: trap::TrapId::Star, path, @@ -859,14 +858,7 @@ fn emit_hir_type_bound( ) -> Option> { match type_bound.skip_binders() { WhereClause::Implemented(trait_ref) => { - let mut path = make_path(db, trait_ref.hir_trait_id()); - path.push( - db.trait_data(trait_ref.hir_trait_id()) - .name - .as_str() - .to_owned(), - ); - let path = make_qualified_path(trap, path); + let path = trait_path(db, trap, trait_ref); let type_repr = Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -887,11 +879,22 @@ fn emit_hir_type_bound( } } -fn emit_hir_path(path: &ra_ap_hir_def::path::Path) -> Vec { - path.segments() - .iter() - .map(|x| x.name.as_str().to_owned()) - .collect() +fn trait_path( + db: &dyn HirDatabase, + trap: &mut TrapFile, + trait_ref: &chalk_ir::TraitRef, +) -> Option> { + let mut path = make_path(db, trait_ref.hir_trait_id()); + path.push( + db.trait_data(trait_ref.hir_trait_id()) + .name + .as_str() + .to_owned(), + ); + let generic_arg_list = + emit_generic_arg_list(trap, db, &trait_ref.substitution.as_slice(Interner)[1..]); + let path = make_qualified_path(trap, path, generic_arg_list); + path } fn emit_hir_fn_ptr( @@ -995,14 +998,17 @@ fn make_path_mod(db: &dyn DefDatabase, module: ModuleId) -> Vec { path.reverse(); path } + fn make_qualified_path( trap: &mut TrapFile, path: Vec, + generic_arg_list: Option>, ) -> Option> { fn qualified_path( trap: &mut TrapFile, qualifier: Option>, name: String, + generic_arg_list: Option>, ) -> trap::Label { let identifier = Some(trap.emit(generated::NameRef { id: trap::TrapId::Star, @@ -1010,7 +1016,7 @@ fn make_qualified_path( })); let segment = Some(trap.emit(generated::PathSegment { id: trap::TrapId::Star, - generic_arg_list: None, + generic_arg_list, identifier, parenthesized_arg_list: None, ret_type: None, @@ -1022,8 +1028,10 @@ fn make_qualified_path( segment, }) } + let args = std::iter::repeat_n(None, &path.len() - 1).chain(std::iter::once(generic_arg_list)); path.into_iter() - .fold(None, |q, p| Some(qualified_path(trap, q, p))) + .zip(args) + .fold(None, |q, (p, a)| Some(qualified_path(trap, q, p, a))) } fn emit_hir_ty( trap: &mut TrapFile, @@ -1109,7 +1117,7 @@ fn emit_hir_ty( ) } - chalk_ir::TyKind::Adt(adt_id, _substitution) => { + chalk_ir::TyKind::Adt(adt_id, substitution) => { let mut path = make_path(db, adt_id.0); let name = match adt_id.0 { ra_ap_hir_def::AdtId::StructId(struct_id) => { @@ -1123,7 +1131,8 @@ fn emit_hir_ty( } }; path.push(name); - let path = make_qualified_path(trap, path); + let generic_arg_list = emit_generic_arg_list(trap, db, substitution.as_slice(Interner)); + let path = make_qualified_path(trap, path, generic_arg_list); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1133,7 +1142,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Scalar(scalar) => { - let path = make_qualified_path(trap, vec![scalar_to_str(scalar).to_owned()]); + let path = make_qualified_path(trap, vec![scalar_to_str(scalar).to_owned()], None); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1143,7 +1152,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Str => { - let path = make_qualified_path(trap, vec!["str".to_owned()]); + let path = make_qualified_path(trap, vec!["str".to_owned()], None); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1234,7 +1243,7 @@ fn emit_hir_ty( } chalk_ir::TyKind::BoundVar(var) => { let var = format!("T_{}_{}", var.debruijn.depth(), var.index); - let path = make_qualified_path(trap, vec![var]); + let path = make_qualified_path(trap, vec![var], None); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1255,6 +1264,66 @@ fn emit_hir_ty( } } +fn emit_generic_arg_list( + trap: &mut TrapFile, + db: &dyn HirDatabase, + args: &[GenericArg], +) -> Option> { + if args.is_empty() { + return None; + } + let generic_args = args + .iter() + .flat_map(|arg| { + if let Some(ty) = arg.ty(Interner) { + let type_repr = emit_hir_ty(trap, db, ty); + Some( + trap.emit(generated::TypeArg { + id: trap::TrapId::Star, + type_repr, + }) + .into(), + ) + } else if let Some(l) = arg.lifetime(Interner) { + let text = match l.data(Interner) { + chalk_ir::LifetimeData::BoundVar(var) => { + format!("'T_{}_{}", var.debruijn.depth(), var.index).into() + } + chalk_ir::LifetimeData::Static => "'static'".to_owned().into(), + _ => None, + }; + let lifetime = trap.emit(generated::Lifetime { + id: trap::TrapId::Star, + text, + }); + Some( + trap.emit(generated::LifetimeArg { + id: trap::TrapId::Star, + lifetime: Some(lifetime), + }) + .into(), + ) + } else if let Some(_) = arg.constant(Interner) { + Some( + trap.emit(generated::ConstArg { + id: trap::TrapId::Star, + expr: None, + }) + .into(), + ) + } else { + None + } + }) + .collect(); + + trap.emit(generated::GenericArgList { + id: trap::TrapId::Star, + generic_args, + }) + .into() +} + enum Variant { Unit, Record(trap::Label), diff --git a/rust/ql/test/extractor-tests/crate_graph/module.rs b/rust/ql/test/extractor-tests/crate_graph/module.rs index 17ef271a7292..716c882da330 100644 --- a/rust/ql/test/extractor-tests/crate_graph/module.rs +++ b/rust/ql/test/extractor-tests/crate_graph/module.rs @@ -43,3 +43,13 @@ pub static X_B: X = X::B; pub use std::fs::create_dir as mkdir; pub use std::{fs::*, path::PathBuf}; + +pub struct LocalKey { + inner: fn(Option<&mut Option>) -> *const T, +} + +impl From for X { + fn from(x: usize) -> Self { + X::A + } +} diff --git a/rust/ql/test/extractor-tests/crate_graph/modules.expected b/rust/ql/test/extractor-tests/crate_graph/modules.expected index 40ee24579e07..11eb095ea790 100644 --- a/rust/ql/test/extractor-tests/crate_graph/modules.expected +++ b/rust/ql/test/extractor-tests/crate_graph/modules.expected @@ -10,13 +10,18 @@ #-----| fn fmt +#-----| fn from + #-----| fn length +#-----| impl ...::AsString for ...::X { ... } +#-----| -> fn as_string + #-----| impl ...::Display for ...::X { ... } #-----| -> fn fmt -#-----| impl AsString for ...::X { ... } -#-----| -> fn as_string +#-----| impl ...::From::<...> for ...::X { ... } +#-----| -> fn from lib.rs: # 0| mod crate @@ -27,8 +32,10 @@ lib.rs: #-----| -> Static #-----| -> enum X #-----| -> fn length +#-----| -> impl ...::AsString for ...::X { ... } #-----| -> impl ...::Display for ...::X { ... } -#-----| -> impl AsString for ...::X { ... } +#-----| -> impl ...::From::<...> for ...::X { ... } +#-----| -> struct LocalKey #-----| -> struct X_List #-----| -> trait AsString #-----| -> use ...::DirBuilder @@ -62,6 +69,8 @@ lib.rs: #-----| -> use ...::symlink_metadata #-----| -> use ...::write +#-----| struct LocalKey + #-----| struct X_List #-----| trait AsString From cec95ae87597847dce347bd019afeee8dbb8c8f5 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 31 Mar 2025 14:13:48 +0200 Subject: [PATCH 105/240] Rust: crate graph: generic parameters --- rust/extractor/src/crate_graph.rs | 133 ++++++++++++++++-- .../extractor-tests/crate_graph/module.rs | 9 +- .../crate_graph/modules.expected | 11 +- .../extractor-tests/crate_graph/modules.ql | 29 +++- 4 files changed, 160 insertions(+), 22 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index f75224f3fdfc..535624625345 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -11,10 +11,12 @@ use ra_ap_base_db::{Crate, RootQueryDb}; use ra_ap_cfg::CfgAtom; use ra_ap_hir::{DefMap, ModuleDefId, PathKind, db::HirDatabase}; use ra_ap_hir::{VariantId, Visibility, db::DefDatabase}; +use ra_ap_hir_def::GenericDefId; use ra_ap_hir_def::Lookup; use ra_ap_hir_def::{ - AssocItemId, LocalModuleId, data::adt::VariantData, item_scope::ImportOrGlob, - item_tree::ImportKind, nameres::ModuleData, path::ImportAlias, + AssocItemId, ConstParamId, LocalModuleId, TypeOrConstParamId, data::adt::VariantData, + generics::TypeOrConstParamData, item_scope::ImportOrGlob, item_tree::ImportKind, + nameres::ModuleData, path::ImportAlias, }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; @@ -22,6 +24,7 @@ use ra_ap_hir_ty::GenericArg; use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; +use ra_ap_hir_ty::TyLoweringContext; use ra_ap_hir_ty::WhereClause; use ra_ap_hir_ty::db::InternedCallableDefId; use ra_ap_hir_ty::from_assoc_type_id; @@ -432,7 +435,98 @@ fn emit_enum_variant( } items } +fn emit_generic_param_list( + trap: &mut TrapFile, + db: &dyn HirDatabase, + def: GenericDefId, +) -> Option> { + let params = db.generic_params(def); + let trait_self_param = params.trait_self_param(); + if params.is_empty() || params.len() == 1 && trait_self_param.is_some() { + return None; + } + let mut generic_params = Vec::new(); + generic_params.extend(params.iter_lt().map( + |(_, param)| -> trap::Label { + let lifetime = trap + .emit(generated::Lifetime { + id: trap::TrapId::Star, + text: Some(param.name.as_str().to_owned()), + }) + .into(); + trap.emit(generated::LifetimeParam { + id: trap::TrapId::Star, + attrs: vec![], + lifetime, + type_bound_list: None, + }) + .into() + }, + )); + generic_params.extend( + params + .iter_type_or_consts() + .filter(|(id, _)| trait_self_param != Some(*id)) + .map( + |(param_id, param)| -> trap::Label { + match param { + TypeOrConstParamData::TypeParamData(param) => { + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: param.name.as_ref().map(|name| name.as_str().to_owned()), + })); + let resolver = def.resolver(db.upcast()); + let mut ctx = TyLoweringContext::new( + db, + &resolver, + ¶ms.types_map, + def.into(), + ); + + let default_type = param + .default + .and_then(|ty| emit_hir_ty(trap, db, &ctx.lower_ty(ty))); + trap.emit(generated::TypeParam { + id: trap::TrapId::Star, + attrs: vec![], + name, + default_type, + type_bound_list: None, + }) + .into() + } + TypeOrConstParamData::ConstParamData(param) => { + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: param.name.as_str().to_owned().into(), + })); + let param_id = TypeOrConstParamId { + parent: def, + local_id: param_id, + }; + let ty = db.const_param_ty(ConstParamId::from_unchecked(param_id)); + let type_repr = emit_hir_ty(trap, db, &ty); + trap.emit(generated::ConstParam { + id: trap::TrapId::Star, + attrs: vec![], + name, + default_val: None, + is_const: true, + type_repr, + }) + .into() + } + } + }, + ), + ); + trap.emit(generated::GenericParamList { + id: trap::TrapId::Star, + generic_params, + }) + .into() +} fn emit_adt( db: &dyn HirDatabase, name: &str, @@ -441,6 +535,7 @@ fn emit_adt( visibility: Visibility, ) -> Vec> { let mut items = Vec::new(); + match adt_id { ra_ap_hir_def::AdtId::StructId(struct_id) => { let name = Some(trap.emit(generated::Name { @@ -449,13 +544,14 @@ fn emit_adt( })); let field_list = emit_variant_data(trap, db, struct_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); items.push( trap.emit(generated::Struct { id: trap::TrapId::Star, name, attrs: vec![], field_list, - generic_param_list: None, + generic_param_list, visibility, where_clause: None, }) @@ -493,12 +589,13 @@ fn emit_adt( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); items.push( trap.emit(generated::Enum { id: trap::TrapId::Star, name, attrs: vec![], - generic_param_list: None, + generic_param_list, variant_list, visibility, where_clause: None, @@ -513,13 +610,14 @@ fn emit_adt( })); let struct_field_list = emit_variant_data(trap, db, union_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); items.push( trap.emit(generated::Union { id: trap::TrapId::Star, name, attrs: vec![], struct_field_list, - generic_param_list: None, + generic_param_list, visibility, where_clause: None, }) @@ -538,8 +636,8 @@ fn emit_trait( visibility: Visibility, ) -> Vec> { let mut items = Vec::new(); - let data = db.trait_items(trait_id); - let assoc_items: Vec> = data + let trait_items = db.trait_items(trait_id); + let assoc_items: Vec> = trait_items .items .iter() .flat_map(|(name, item)| { @@ -577,6 +675,7 @@ fn emit_trait( text: Some(name.as_str().to_owned()), })); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, (*function).into()); Some( trap.emit(generated::Function { id: trap::TrapId::Star, @@ -590,7 +689,7 @@ fn emit_trait( is_async: false, is_gen: false, is_unsafe: matches!(sig.to_fn_ptr().sig.safety, Safety::Unsafe), - generic_param_list: None, //TODO + generic_param_list, param_list: Some(param_list), ret_type, where_clause: None, @@ -612,13 +711,14 @@ fn emit_trait( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, trait_id.into()); items.push( trap.emit(generated::Trait { id: trap::TrapId::Star, name, assoc_item_list, attrs: vec![], - generic_param_list: None, + generic_param_list, is_auto: false, is_unsafe: false, type_bound_list: None, @@ -694,7 +794,7 @@ fn emit_module_impls( data.visibility .resolve(db.upcast(), &function.resolver(db.upcast())), ); - + let generic_param_list = emit_generic_param_list(trap, db, (*function).into()); Some( trap.emit(generated::Function { id: trap::TrapId::Star, @@ -708,7 +808,7 @@ fn emit_module_impls( is_async: false, is_gen: false, is_unsafe: matches!(sig.to_fn_ptr().sig.safety, Safety::Unsafe), - generic_param_list: None, //TODO + generic_param_list, param_list: Some(param_list), ret_type, where_clause: None, @@ -725,6 +825,7 @@ fn emit_module_impls( assoc_items, attrs: vec![], })); + let generic_param_list = emit_generic_param_list(trap, db, imp.into()); items.push( trap.emit(generated::Impl { id: trap::TrapId::Star, @@ -732,7 +833,7 @@ fn emit_module_impls( self_ty, assoc_item_list, attrs: vec![], - generic_param_list: None, + generic_param_list, is_const: false, is_default: false, is_unsafe: false, @@ -778,7 +879,6 @@ fn const_or_function( let callable_def_id = db.lookup_intern_callable_def(InternedCallableDefId::from(*fn_def_id)); let data = db.fn_def_datum(callable_def_id); - let sig = ra_ap_hir_ty::CallableSig::from_def(db, *fn_def_id, parameters); let params = sig .params() @@ -811,6 +911,11 @@ fn const_or_function( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); + let callable_def_id = db.lookup_intern_callable_def((*fn_def_id).into()); + let generic_def_id = GenericDefId::from_callable(db.upcast(), callable_def_id); + let generic_param_list: Option> = + emit_generic_param_list(trap, db, generic_def_id); + trap.emit(generated::Function { id: trap::TrapId::Star, name, @@ -823,7 +928,7 @@ fn const_or_function( is_async: false, is_gen: false, is_unsafe: matches!(data.sig.safety, Safety::Unsafe), - generic_param_list: None, //TODO + generic_param_list, param_list: Some(param_list), ret_type, where_clause: None, diff --git a/rust/ql/test/extractor-tests/crate_graph/module.rs b/rust/ql/test/extractor-tests/crate_graph/module.rs index 716c882da330..0cb34cbcb1ba 100644 --- a/rust/ql/test/extractor-tests/crate_graph/module.rs +++ b/rust/ql/test/extractor-tests/crate_graph/module.rs @@ -48,8 +48,11 @@ pub struct LocalKey { inner: fn(Option<&mut Option>) -> *const T, } -impl From for X { - fn from(x: usize) -> Self { - X::A +pub struct Thing { + x: T, +} +impl From for Thing { + fn from(_x: usize) -> Self { + Thing { x: X::A } } } diff --git a/rust/ql/test/extractor-tests/crate_graph/modules.expected b/rust/ql/test/extractor-tests/crate_graph/modules.expected index 11eb095ea790..157432a77e33 100644 --- a/rust/ql/test/extractor-tests/crate_graph/modules.expected +++ b/rust/ql/test/extractor-tests/crate_graph/modules.expected @@ -20,7 +20,7 @@ #-----| impl ...::Display for ...::X { ... } #-----| -> fn fmt -#-----| impl ...::From::<...> for ...::X { ... } +#-----| impl ...::From::<...> for ...::Thing::<...> { ... } #-----| -> fn from lib.rs: @@ -34,8 +34,9 @@ lib.rs: #-----| -> fn length #-----| -> impl ...::AsString for ...::X { ... } #-----| -> impl ...::Display for ...::X { ... } -#-----| -> impl ...::From::<...> for ...::X { ... } -#-----| -> struct LocalKey +#-----| -> impl ...::From::<...> for ...::Thing::<...> { ... } +#-----| -> struct LocalKey +#-----| -> struct Thing #-----| -> struct X_List #-----| -> trait AsString #-----| -> use ...::DirBuilder @@ -69,7 +70,9 @@ lib.rs: #-----| -> use ...::symlink_metadata #-----| -> use ...::write -#-----| struct LocalKey +#-----| struct LocalKey + +#-----| struct Thing #-----| struct X_List diff --git a/rust/ql/test/extractor-tests/crate_graph/modules.ql b/rust/ql/test/extractor-tests/crate_graph/modules.ql index 42b0e5c0fcbb..5554a69d1a96 100644 --- a/rust/ql/test/extractor-tests/crate_graph/modules.ql +++ b/rust/ql/test/extractor-tests/crate_graph/modules.ql @@ -13,6 +13,33 @@ class RelevantNode extends Item { this.getParentNode*() = any(Crate m | m.getName() = "test" and m.getVersion() = "0.0.1").getModule() } + + string label() { result = this.toString() } +} + +class HasGenericParams extends RelevantNode { + private GenericParamList params; + + HasGenericParams() { + params = this.(Function).getGenericParamList() or + params = this.(Enum).getGenericParamList() or + params = this.(Struct).getGenericParamList() or + params = this.(Union).getGenericParamList() or + params = this.(Impl).getGenericParamList() or + params = this.(Enum).getGenericParamList() or + params = this.(Trait).getGenericParamList() or + params = this.(TraitAlias).getGenericParamList() + } + + override string label() { + result = + super.toString() + "<" + + strictconcat(string part, int index | + part = params.getGenericParam(index).toString() + | + part, ", " order by index + ) + ">" + } } predicate edges(RelevantNode container, RelevantNode element) { @@ -25,7 +52,7 @@ query predicate nodes(RelevantNode node, string attr, string val) { nodes(node) and ( attr = "semmle.label" and - val = node.toString() + val = node.label() or attr = "semmle.order" and val = From b24fbe8db951a870963bb6c051c2641ecf4ebe76 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 3 Apr 2025 12:45:59 +0200 Subject: [PATCH 106/240] Rust: remove unreachable case Enum variants cannot be declared as a module item, they can only be imported --- rust/extractor/src/crate_graph.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 535624625345..fa4f1636a931 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -305,9 +305,6 @@ fn emit_module_items( ModuleDefId::StaticId(statik) => { items.extend(emit_static(db, name.as_str(), trap, statik, vis)); } - ModuleDefId::EnumVariantId(variant_id) => { - items.extend(emit_enum_variant(db, name.as_str(), trap, variant_id, vis)); - } _ => (), } } @@ -422,19 +419,6 @@ fn emit_static( items } -fn emit_enum_variant( - db: &dyn HirDatabase, - name: &str, - trap: &mut TrapFile, - variant_id: ra_ap_hir_def::EnumVariantId, - visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); - if let Some(type_) = db.value_ty(variant_id.into()) { - items.push(const_or_function(db, name, trap, type_, visibility)); - } - items -} fn emit_generic_param_list( trap: &mut TrapFile, db: &dyn HirDatabase, From 5cfbedc114ada4ef9d56519cb48a06d4f3756db5 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 3 Apr 2025 12:58:21 +0200 Subject: [PATCH 107/240] Rust: replace singleton vectors with Option --- rust/extractor/src/crate_graph.rs | 50 ++++++++++++------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index fa4f1636a931..701d87abb69c 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -346,12 +346,9 @@ fn emit_function( trap: &mut TrapFile, function: ra_ap_hir_def::FunctionId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); - if let Some(type_) = db.value_ty(function.into()) { - items.push(const_or_function(db, name, trap, type_, visibility)); - } - items +) -> Option> { + db.value_ty(function.into()) + .map(|type_| const_or_function(db, name, trap, type_, visibility)) } fn emit_const( @@ -360,8 +357,7 @@ fn emit_const( trap: &mut TrapFile, konst: ra_ap_hir_def::ConstId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); +) -> Option> { let type_ = db.value_ty(konst.into()); let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, type_.skip_binders())); let name = Some(trap.emit(generated::Name { @@ -370,7 +366,7 @@ fn emit_const( })); let konst = db.const_data(konst); let visibility = emit_visibility(db, trap, visibility); - items.push( + Some( trap.emit(generated::Const { id: trap::TrapId::Star, name, @@ -382,8 +378,7 @@ fn emit_const( visibility, }) .into(), - ); - items + ) } fn emit_static( @@ -392,8 +387,7 @@ fn emit_static( trap: &mut TrapFile, statik: ra_ap_hir_def::StaticId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); +) -> Option> { let type_ = db.value_ty(statik.into()); let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, type_.skip_binders())); let name = Some(trap.emit(generated::Name { @@ -402,7 +396,7 @@ fn emit_static( })); let statik = db.static_data(statik); let visibility = emit_visibility(db, trap, visibility); - items.push( + Some( trap.emit(generated::Static { id: trap::TrapId::Star, name, @@ -415,8 +409,7 @@ fn emit_static( is_unsafe: statik.has_unsafe_kw(), }) .into(), - ); - items + ) } fn emit_generic_param_list( @@ -517,9 +510,7 @@ fn emit_adt( trap: &mut TrapFile, adt_id: ra_ap_hir_def::AdtId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); - +) -> Option> { match adt_id { ra_ap_hir_def::AdtId::StructId(struct_id) => { let name = Some(trap.emit(generated::Name { @@ -529,7 +520,7 @@ fn emit_adt( let field_list = emit_variant_data(trap, db, struct_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); - items.push( + Some( trap.emit(generated::Struct { id: trap::TrapId::Star, name, @@ -540,7 +531,7 @@ fn emit_adt( where_clause: None, }) .into(), - ); + ) } ra_ap_hir_def::AdtId::EnumId(enum_id) => { let data = db.enum_variants(enum_id); @@ -574,7 +565,7 @@ fn emit_adt( })); let visibility = emit_visibility(db, trap, visibility); let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); - items.push( + Some( trap.emit(generated::Enum { id: trap::TrapId::Star, name, @@ -585,7 +576,7 @@ fn emit_adt( where_clause: None, }) .into(), - ); + ) } ra_ap_hir_def::AdtId::UnionId(union_id) => { let name = Some(trap.emit(generated::Name { @@ -595,7 +586,7 @@ fn emit_adt( let struct_field_list = emit_variant_data(trap, db, union_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); - items.push( + Some( trap.emit(generated::Union { id: trap::TrapId::Star, name, @@ -606,10 +597,9 @@ fn emit_adt( where_clause: None, }) .into(), - ); + ) } } - items } fn emit_trait( @@ -618,8 +608,7 @@ fn emit_trait( trap: &mut TrapFile, trait_id: ra_ap_hir_def::TraitId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); +) -> Option> { let trait_items = db.trait_items(trait_id); let assoc_items: Vec> = trait_items .items @@ -696,7 +685,7 @@ fn emit_trait( })); let visibility = emit_visibility(db, trap, visibility); let generic_param_list = emit_generic_param_list(trap, db, trait_id.into()); - items.push( + Some( trap.emit(generated::Trait { id: trap::TrapId::Star, name, @@ -710,8 +699,7 @@ fn emit_trait( where_clause: None, }) .into(), - ); - items + ) } fn emit_module_impls( From 0545f782e04572244986bfc518e860c6c3bc946d Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 3 Apr 2025 13:30:20 +0200 Subject: [PATCH 108/240] Rust: get rid of const_or_function --- rust/extractor/src/crate_graph.rs | 147 +++++++++++------------------- 1 file changed, 55 insertions(+), 92 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 701d87abb69c..998af55e175e 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -26,7 +26,6 @@ use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; use ra_ap_hir_ty::TyLoweringContext; use ra_ap_hir_ty::WhereClause; -use ra_ap_hir_ty::db::InternedCallableDefId; use ra_ap_hir_ty::from_assoc_type_id; use ra_ap_hir_ty::{Binders, FnPointer}; use ra_ap_hir_ty::{Interner, ProjectionTy}; @@ -347,8 +346,61 @@ fn emit_function( function: ra_ap_hir_def::FunctionId, visibility: Visibility, ) -> Option> { - db.value_ty(function.into()) - .map(|type_| const_or_function(db, name, trap, type_, visibility)) + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: Some(name.to_owned()), + })); + let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, function.into()); + let data = db.function_data(function); + let sig = db.callable_item_signature(function.into()); + let sig = sig.skip_binders(); + let params = sig + .params() + .iter() + .map(|p| { + let type_repr = emit_hir_ty(trap, db, p); + trap.emit(generated::Param { + id: trap::TrapId::Star, + attrs: vec![], + type_repr, + pat: None, + }) + }) + .collect(); + + let ret_type = emit_hir_ty(trap, db, sig.ret()); + let param_list = trap.emit(generated::ParamList { + id: trap::TrapId::Star, + params, + self_param: None, + }); + let ret_type = ret_type.map(|ret_type| { + trap.emit(generated::RetTypeRepr { + id: trap::TrapId::Star, + type_repr: Some(ret_type), + }) + }); + Some( + trap.emit(generated::Function { + id: trap::TrapId::Star, + name, + attrs: vec![], + body: None, + is_const: data.is_const(), + is_default: data.is_default(), + visibility, + abi: None, + is_async: data.is_async(), + is_gen: false, + is_unsafe: data.is_unsafe(), + generic_param_list, + param_list: Some(param_list), + ret_type, + where_clause: None, + }) + .into(), + ) } fn emit_const( @@ -838,96 +890,7 @@ fn emit_visibility( }) }) } -fn const_or_function( - db: &dyn HirDatabase, - name: &str, - trap: &mut TrapFile, - type_: Binders, - visibility: Visibility, -) -> trap::Label { - let type_: &chalk_ir::Ty = type_.skip_binders(); - match type_.kind(ra_ap_hir_ty::Interner) { - chalk_ir::TyKind::FnDef(fn_def_id, parameters) => { - let callable_def_id = - db.lookup_intern_callable_def(InternedCallableDefId::from(*fn_def_id)); - let data = db.fn_def_datum(callable_def_id); - let sig = ra_ap_hir_ty::CallableSig::from_def(db, *fn_def_id, parameters); - let params = sig - .params() - .iter() - .map(|p| { - let type_repr = emit_hir_ty(trap, db, p); - trap.emit(generated::Param { - id: trap::TrapId::Star, - attrs: vec![], - type_repr, - pat: None, - }) - }) - .collect(); - let ret_type = emit_hir_ty(trap, db, sig.ret()); - let param_list = trap.emit(generated::ParamList { - id: trap::TrapId::Star, - params, - self_param: None, - }); - let ret_type = ret_type.map(|ret_type| { - trap.emit(generated::RetTypeRepr { - id: trap::TrapId::Star, - type_repr: Some(ret_type), - }) - }); - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.to_owned()), - })); - let visibility = emit_visibility(db, trap, visibility); - let callable_def_id = db.lookup_intern_callable_def((*fn_def_id).into()); - let generic_def_id = GenericDefId::from_callable(db.upcast(), callable_def_id); - let generic_param_list: Option> = - emit_generic_param_list(trap, db, generic_def_id); - - trap.emit(generated::Function { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: false, - is_default: false, - visibility, - abi: None, - is_async: false, - is_gen: false, - is_unsafe: matches!(data.sig.safety, Safety::Unsafe), - generic_param_list, - param_list: Some(param_list), - ret_type, - where_clause: None, - }) - .into() - } - _ => { - let type_repr = emit_hir_ty(trap, db, type_); - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.to_owned()), - })); - let visibility = emit_visibility(db, trap, visibility); - trap.emit(generated::Const { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: false, - is_default: false, - type_repr, - visibility, - }) - .into() - } - } -} fn emit_hir_type_bound( db: &dyn HirDatabase, trap: &mut TrapFile, From db4306d0c1d3d3317027d30e6400f34e62c57aee Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 3 Apr 2025 14:06:21 +0200 Subject: [PATCH 109/240] Rust: avoid duplication for functions and methods --- rust/extractor/src/crate_graph.rs | 181 ++++++------------------------ 1 file changed, 35 insertions(+), 146 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 998af55e175e..16a65d779f1a 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -2,10 +2,10 @@ use crate::{ generated::{self}, trap::{self, TrapFile}, }; +use chalk_ir::FloatTy; use chalk_ir::IntTy; use chalk_ir::Scalar; use chalk_ir::UintTy; -use chalk_ir::{FloatTy, Safety}; use itertools::Itertools; use ra_ap_base_db::{Crate, RootQueryDb}; use ra_ap_cfg::CfgAtom; @@ -296,7 +296,7 @@ fn emit_module_items( { match value { ModuleDefId::FunctionId(function) => { - items.extend(emit_function(db, name.as_str(), trap, function, vis)); + items.push(emit_function(db, trap, function, name).into()); } ModuleDefId::ConstId(konst) => { items.extend(emit_const(db, name.as_str(), trap, konst, vis)); @@ -341,18 +341,10 @@ fn emit_module_items( fn emit_function( db: &dyn HirDatabase, - name: &str, trap: &mut TrapFile, function: ra_ap_hir_def::FunctionId, - visibility: Visibility, -) -> Option> { - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.to_owned()), - })); - let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, function.into()); - let data = db.function_data(function); + name: &ra_ap_hir::Name, +) -> trap::Label { let sig = db.callable_item_signature(function.into()); let sig = sig.skip_binders(); let params = sig @@ -381,26 +373,35 @@ fn emit_function( type_repr: Some(ret_type), }) }); - Some( - trap.emit(generated::Function { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: data.is_const(), - is_default: data.is_default(), - visibility, - abi: None, - is_async: data.is_async(), - is_gen: false, - is_unsafe: data.is_unsafe(), - generic_param_list, - param_list: Some(param_list), - ret_type, - where_clause: None, - }) - .into(), - ) + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: Some(name.as_str().to_owned()), + })); + let data = db.function_data(function); + let visibility = emit_visibility( + db, + trap, + data.visibility + .resolve(db.upcast(), &function.resolver(db.upcast())), + ); + let generic_param_list = emit_generic_param_list(trap, db, function.into()); + trap.emit(generated::Function { + id: trap::TrapId::Star, + name, + attrs: vec![], + body: None, + is_const: data.is_const(), + is_default: data.is_default(), + visibility, + abi: None, + is_async: data.is_async(), + is_gen: false, + is_unsafe: data.is_unsafe(), + generic_param_list, + param_list: Some(param_list), + ret_type, + where_clause: None, + }) } fn emit_const( @@ -667,60 +668,7 @@ fn emit_trait( .iter() .flat_map(|(name, item)| { if let AssocItemId::FunctionId(function) = item { - let sig = db.callable_item_signature((*function).into()); - let sig = sig.skip_binders(); - let params = sig - .params() - .iter() - .map(|p| { - let type_repr = emit_hir_ty(trap, db, p); - trap.emit(generated::Param { - id: trap::TrapId::Star, - attrs: vec![], - type_repr, - pat: None, - }) - }) - .collect(); - - let ret_type = emit_hir_ty(trap, db, sig.ret()); - let param_list = trap.emit(generated::ParamList { - id: trap::TrapId::Star, - params, - self_param: None, - }); - let ret_type = ret_type.map(|ret_type| { - trap.emit(generated::RetTypeRepr { - id: trap::TrapId::Star, - type_repr: Some(ret_type), - }) - }); - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.as_str().to_owned()), - })); - let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, (*function).into()); - Some( - trap.emit(generated::Function { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: false, - is_default: false, - visibility, - abi: None, - is_async: false, - is_gen: false, - is_unsafe: matches!(sig.to_fn_ptr().sig.safety, Safety::Unsafe), - generic_param_list, - param_list: Some(param_list), - ret_type, - where_clause: None, - }) - .into(), - ) + Some(emit_function(db, trap, *function, name).into()) } else { None } @@ -779,66 +727,7 @@ fn emit_module_impls( .iter() .flat_map(|item| { if let (name, AssocItemId::FunctionId(function)) = item { - let sig = db.callable_item_signature((*function).into()); - let sig = sig.skip_binders(); - let params = sig - .params() - .iter() - .map(|p| { - let type_repr = emit_hir_ty(trap, db, p); - trap.emit(generated::Param { - id: trap::TrapId::Star, - attrs: vec![], - type_repr, - pat: None, - }) - }) - .collect(); - - let ret_type = emit_hir_ty(trap, db, sig.ret()); - let param_list = trap.emit(generated::ParamList { - id: trap::TrapId::Star, - params, - self_param: None, - }); - let ret_type = ret_type.map(|ret_type| { - trap.emit(generated::RetTypeRepr { - id: trap::TrapId::Star, - type_repr: Some(ret_type), - }) - }); - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.as_str().to_owned()), - })); - let data = db.function_data(*function); - let visibility = emit_visibility( - db, - trap, - data.visibility - .resolve(db.upcast(), &function.resolver(db.upcast())), - ); - let generic_param_list = emit_generic_param_list(trap, db, (*function).into()); - Some( - trap.emit(generated::Function { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: false, - is_default: false, - visibility, - abi: None, - is_async: false, - is_gen: false, - is_unsafe: matches!(sig.to_fn_ptr().sig.safety, Safety::Unsafe), - generic_param_list, - param_list: Some(param_list), - ret_type, - where_clause: None, - }) - .into(), - ) + Some(emit_function(db, trap, *function, name).into()) } else { None } From a4b1c2bbdc961cfe42dc017a0e91b62d02d77b48 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 4 Apr 2025 14:35:13 +0200 Subject: [PATCH 110/240] Rust: crate graph: resolve bound type variablesp --- rust/extractor/src/crate_graph.rs | 299 +++++++++++++----- .../rust/elements/internal/LifetimeImpl.qll | 2 +- 2 files changed, 229 insertions(+), 72 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 16a65d779f1a..64dced1b19ed 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -14,9 +14,13 @@ use ra_ap_hir::{VariantId, Visibility, db::DefDatabase}; use ra_ap_hir_def::GenericDefId; use ra_ap_hir_def::Lookup; use ra_ap_hir_def::{ - AssocItemId, ConstParamId, LocalModuleId, TypeOrConstParamId, data::adt::VariantData, - generics::TypeOrConstParamData, item_scope::ImportOrGlob, item_tree::ImportKind, - nameres::ModuleData, path::ImportAlias, + AssocItemId, ConstParamId, LocalModuleId, TypeOrConstParamId, + data::adt::VariantData, + generics::{GenericParams, TypeOrConstParamData}, + item_scope::ImportOrGlob, + item_tree::ImportKind, + nameres::ModuleData, + path::ImportAlias, }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; @@ -296,15 +300,24 @@ fn emit_module_items( { match value { ModuleDefId::FunctionId(function) => { - items.push(emit_function(db, trap, function, name).into()); + items.push(emit_function(db, trap, None, function, name).into()); } ModuleDefId::ConstId(konst) => { - items.extend(emit_const(db, name.as_str(), trap, konst, vis)); + items.extend(emit_const(db, name.as_str(), trap, None, konst, vis)); } ModuleDefId::StaticId(statik) => { items.extend(emit_static(db, name.as_str(), trap, statik, vis)); } - _ => (), + // Enum variants can only be introduced into the value namespace by an import (`use`) statement + ModuleDefId::EnumVariantId(_) => (), + // Not in the "value" namespace + ModuleDefId::ModuleId(_) + | ModuleDefId::AdtId(_) + | ModuleDefId::TraitId(_) + | ModuleDefId::TraitAliasId(_) + | ModuleDefId::TypeAliasId(_) + | ModuleDefId::BuiltinType(_) + | ModuleDefId::MacroId(_) => (), } } if let Some(ra_ap_hir_def::per_ns::Item { @@ -331,7 +344,17 @@ fn emit_module_items( ModuleDefId::TraitId(trait_id) => { items.extend(emit_trait(db, name.as_str(), trap, trait_id, vis)); } - _ => (), + ModuleDefId::TraitAliasId(_) | ModuleDefId::TypeAliasId(_) => (), // TODO + ModuleDefId::BuiltinType(_) => (), // TODO? + // modules are handled separatedly + ModuleDefId::ModuleId(_) => (), + // Enum variants cannot be declarted, only imported + ModuleDefId::EnumVariantId(_) => (), + // Not in the "types" namespace + ModuleDefId::FunctionId(_) + | ModuleDefId::ConstId(_) + | ModuleDefId::StaticId(_) + | ModuleDefId::MacroId(_) => (), } } } @@ -342,16 +365,21 @@ fn emit_module_items( fn emit_function( db: &dyn HirDatabase, trap: &mut TrapFile, + container: Option, function: ra_ap_hir_def::FunctionId, name: &ra_ap_hir::Name, ) -> trap::Label { let sig = db.callable_item_signature(function.into()); + let parameters = collect_generic_parameters(db, function.into(), container); + + assert_eq!(sig.binders.len(Interner), parameters.len()); let sig = sig.skip_binders(); + let ty_vars = &[parameters]; let params = sig .params() .iter() .map(|p| { - let type_repr = emit_hir_ty(trap, db, p); + let type_repr = emit_hir_ty(trap, db, ty_vars, p); trap.emit(generated::Param { id: trap::TrapId::Star, attrs: vec![], @@ -361,7 +389,7 @@ fn emit_function( }) .collect(); - let ret_type = emit_hir_ty(trap, db, sig.ret()); + let ret_type = emit_hir_ty(trap, db, ty_vars, sig.ret()); let param_list = trap.emit(generated::ParamList { id: trap::TrapId::Star, params, @@ -384,7 +412,7 @@ fn emit_function( data.visibility .resolve(db.upcast(), &function.resolver(db.upcast())), ); - let generic_param_list = emit_generic_param_list(trap, db, function.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, function.into()); trap.emit(generated::Function { id: trap::TrapId::Star, name, @@ -404,15 +432,54 @@ fn emit_function( }) } +fn collect_generic_parameters( + db: &dyn HirDatabase, + def: GenericDefId, + container: Option, +) -> Vec { + let mut parameters = Vec::new(); + let gen_params = db.generic_params(def); + collect(&gen_params, &mut parameters); + if let Some(gen_params) = container.map(|container| db.generic_params(container)) { + collect(gen_params.as_ref(), &mut parameters); + } + return parameters; + + fn collect(gen_params: &GenericParams, parameters: &mut Vec) { + // Self, Lifetimes, TypesOrConsts + let skip = if gen_params.trait_self_param().is_some() { + parameters.push("Self".into()); + 1 + } else { + 0 + }; + parameters.extend(gen_params.iter_lt().map(|(_, lt)| lt.name.as_str().into())); + parameters.extend(gen_params.iter_type_or_consts().skip(skip).map(|(_, p)| { + p.name() + .map(|p| p.as_str().into()) + .unwrap_or("{error}".into()) + })); + } +} + fn emit_const( db: &dyn HirDatabase, name: &str, trap: &mut TrapFile, + container: Option, konst: ra_ap_hir_def::ConstId, visibility: Visibility, ) -> Option> { let type_ = db.value_ty(konst.into()); - let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, type_.skip_binders())); + let parameters = collect_generic_parameters(db, konst.into(), container); + assert_eq!( + type_ + .as_ref() + .map_or(0, |type_| type_.binders.len(Interner)), + parameters.len() + ); + let ty_vars = &[parameters]; + let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, ty_vars, type_.skip_binders())); let name = Some(trap.emit(generated::Name { id: trap::TrapId::Star, text: Some(name.to_owned()), @@ -442,7 +509,15 @@ fn emit_static( visibility: Visibility, ) -> Option> { let type_ = db.value_ty(statik.into()); - let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, type_.skip_binders())); + let parameters = collect_generic_parameters(db, statik.into(), None); + assert_eq!( + type_ + .as_ref() + .map_or(0, |type_| type_.binders.len(Interner)), + parameters.len() + ); + let ty_vars = &[parameters]; + let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, ty_vars, type_.skip_binders())); let name = Some(trap.emit(generated::Name { id: trap::TrapId::Star, text: Some(name.to_owned()), @@ -468,6 +543,7 @@ fn emit_static( fn emit_generic_param_list( trap: &mut TrapFile, db: &dyn HirDatabase, + ty_vars: &[Vec], def: GenericDefId, ) -> Option> { let params = db.generic_params(def); @@ -516,7 +592,7 @@ fn emit_generic_param_list( let default_type = param .default - .and_then(|ty| emit_hir_ty(trap, db, &ctx.lower_ty(ty))); + .and_then(|ty| emit_hir_ty(trap, db, ty_vars, &ctx.lower_ty(ty))); trap.emit(generated::TypeParam { id: trap::TrapId::Star, attrs: vec![], @@ -536,7 +612,7 @@ fn emit_generic_param_list( local_id: param_id, }; let ty = db.const_param_ty(ConstParamId::from_unchecked(param_id)); - let type_repr = emit_hir_ty(trap, db, &ty); + let type_repr = emit_hir_ty(trap, db, ty_vars, &ty); trap.emit(generated::ConstParam { id: trap::TrapId::Star, attrs: vec![], @@ -564,15 +640,18 @@ fn emit_adt( adt_id: ra_ap_hir_def::AdtId, visibility: Visibility, ) -> Option> { + let parameters = collect_generic_parameters(db, adt_id.into(), None); + let ty_vars = &[parameters]; + match adt_id { ra_ap_hir_def::AdtId::StructId(struct_id) => { let name = Some(trap.emit(generated::Name { id: trap::TrapId::Star, text: Some(name.to_owned()), })); - let field_list = emit_variant_data(trap, db, struct_id.into()).into(); + let field_list = emit_variant_data(trap, db, ty_vars, struct_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, adt_id.into()); Some( trap.emit(generated::Struct { id: trap::TrapId::Star, @@ -596,7 +675,7 @@ fn emit_adt( id: trap::TrapId::Star, text: Some(name.as_str().to_owned()), })); - let field_list = emit_variant_data(trap, db, (*enum_id).into()).into(); + let field_list = emit_variant_data(trap, db, ty_vars, (*enum_id).into()).into(); let visibility = None; trap.emit(generated::Variant { id: trap::TrapId::Star, @@ -617,7 +696,7 @@ fn emit_adt( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, adt_id.into()); Some( trap.emit(generated::Enum { id: trap::TrapId::Star, @@ -636,9 +715,9 @@ fn emit_adt( id: trap::TrapId::Star, text: Some(name.to_owned()), })); - let struct_field_list = emit_variant_data(trap, db, union_id.into()).into(); + let struct_field_list = emit_variant_data(trap, db, ty_vars, union_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, adt_id.into()); Some( trap.emit(generated::Union { id: trap::TrapId::Star, @@ -662,13 +741,15 @@ fn emit_trait( trait_id: ra_ap_hir_def::TraitId, visibility: Visibility, ) -> Option> { + let parameters = collect_generic_parameters(db, trait_id.into(), None); + let ty_vars = &[parameters]; let trait_items = db.trait_items(trait_id); let assoc_items: Vec> = trait_items .items .iter() .flat_map(|(name, item)| { if let AssocItemId::FunctionId(function) = item { - Some(emit_function(db, trap, *function, name).into()) + Some(emit_function(db, trap, Some(trait_id.into()), *function, name).into()) } else { None } @@ -684,7 +765,7 @@ fn emit_trait( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, trait_id.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, trait_id.into()); Some( trap.emit(generated::Trait { id: trap::TrapId::Star, @@ -710,10 +791,16 @@ fn emit_module_impls( let mut items = Vec::new(); module.scope.impls().for_each(|imp| { let self_ty = db.impl_self_ty(imp); - let self_ty = emit_hir_ty(trap, db, self_ty.skip_binders()); - let path = db - .impl_trait(imp) - .map(|trait_ref| trait_path(db, trap, trait_ref.skip_binders())); + let parameters = collect_generic_parameters(db, imp.into(), None); + let parameters_len = parameters.len(); + assert_eq!(self_ty.binders.len(Interner), parameters_len); + + let ty_vars = &[parameters]; + let self_ty = emit_hir_ty(trap, db, ty_vars, self_ty.skip_binders()); + let path = db.impl_trait(imp).map(|trait_ref| { + assert_eq!(trait_ref.binders.len(Interner), parameters_len); + trait_path(db, trap, ty_vars, trait_ref.skip_binders()) + }); let trait_ = path.map(|path| { trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -727,7 +814,7 @@ fn emit_module_impls( .iter() .flat_map(|item| { if let (name, AssocItemId::FunctionId(function)) = item { - Some(emit_function(db, trap, *function, name).into()) + Some(emit_function(db, trap, Some(imp.into()), *function, name).into()) } else { None } @@ -738,7 +825,7 @@ fn emit_module_impls( assoc_items, attrs: vec![], })); - let generic_param_list = emit_generic_param_list(trap, db, imp.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, imp.into()); items.push( trap.emit(generated::Impl { id: trap::TrapId::Star, @@ -779,15 +866,25 @@ fn emit_visibility( }) }) } - +fn push_ty_vars(ty_vars: &[Vec], vars: Vec) -> Vec> { + let mut result = ty_vars.to_vec(); + result.push(vars); + result +} fn emit_hir_type_bound( db: &dyn HirDatabase, trap: &mut TrapFile, + ty_vars: &[Vec], type_bound: &Binders>, ) -> Option> { + // Rust-analyzer seems to call `wrap_empty_binders` on `WhereClause`s. + let parameters = vec![]; + assert_eq!(type_bound.binders.len(Interner), parameters.len(),); + let ty_vars = &push_ty_vars(ty_vars, parameters); + match type_bound.skip_binders() { WhereClause::Implemented(trait_ref) => { - let path = trait_path(db, trap, trait_ref); + let path = trait_path(db, trap, ty_vars, trait_ref); let type_repr = Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -804,13 +901,16 @@ fn emit_hir_type_bound( use_bound_generic_args: None, })) } - _ => None, + WhereClause::AliasEq(_) + | WhereClause::LifetimeOutlives(_) + | WhereClause::TypeOutlives(_) => None, // TODO } } fn trait_path( db: &dyn HirDatabase, trap: &mut TrapFile, + ty_vars: &[Vec], trait_ref: &chalk_ir::TraitRef, ) -> Option> { let mut path = make_path(db, trait_ref.hir_trait_id()); @@ -820,23 +920,37 @@ fn trait_path( .as_str() .to_owned(), ); - let generic_arg_list = - emit_generic_arg_list(trap, db, &trait_ref.substitution.as_slice(Interner)[1..]); - let path = make_qualified_path(trap, path, generic_arg_list); - path + let generic_arg_list = emit_generic_arg_list( + trap, + db, + ty_vars, + &trait_ref.substitution.as_slice(Interner)[1..], + ); + + make_qualified_path(trap, path, generic_arg_list) } fn emit_hir_fn_ptr( trap: &mut TrapFile, - db: &dyn HirDatabase, + ty_vars: &[Vec], function: &FnPointer, ) -> trap::Label { + // Currently rust-analyzer does not handle `for<'a'> fn()` correctly: + // ```rust + // TyKind::Function(FnPointer { + // num_binders: 0, // FIXME lower `for<'a> fn()` correctly + // ``` + // https://github.com/rust-lang/rust-analyzer/blob/c5882732e6e6e09ac75cddd13545e95860be1c42/crates/hir-ty/src/lower.rs#L325 + let parameters = vec![]; + assert_eq!(function.num_binders, parameters.len(),); + let ty_vars = &push_ty_vars(ty_vars, parameters); + let parameters: Vec<_> = function.substitution.0.type_parameters(Interner).collect(); let (ret_type, params) = parameters.split_last().unwrap(); - let ret_type = emit_hir_ty(trap, db, ret_type); + let ret_type = emit_hir_ty(trap, db, ty_vars, ret_type); let ret_type = Some(trap.emit(generated::RetTypeRepr { id: trap::TrapId::Star, type_repr: ret_type, @@ -844,7 +958,7 @@ fn emit_hir_fn_ptr( let params = params .iter() .map(|t| { - let type_repr = emit_hir_ty(trap, db, t); + let type_repr = emit_hir_ty(trap, db, ty_vars, t); trap.emit(generated::Param { id: trap::TrapId::Star, attrs: vec![], @@ -964,8 +1078,8 @@ fn make_qualified_path( } fn emit_hir_ty( trap: &mut TrapFile, - db: &dyn HirDatabase, + ty_vars: &[Vec], ty: &Ty, ) -> Option> { match ty.kind(ra_ap_hir_ty::Interner) { @@ -986,7 +1100,7 @@ fn emit_hir_ty( chalk_ir::TyKind::Tuple(_size, substitution) => { let fields = substitution.type_parameters(ra_ap_hir_ty::Interner); let fields = fields - .flat_map(|field| emit_hir_ty(trap, db, &field)) + .flat_map(|field| emit_hir_ty(trap, db, ty_vars, &field)) .collect(); Some( @@ -998,7 +1112,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Raw(mutability, ty) => { - let type_repr = emit_hir_ty(trap, db, ty); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty); Some( trap.emit(generated::PtrTypeRepr { @@ -1010,21 +1124,21 @@ fn emit_hir_ty( .into(), ) } - chalk_ir::TyKind::Ref(mutability, _lifetime, ty) => { - let type_repr = emit_hir_ty(trap, db, ty); - let lifetime = None; //TODO: ? + chalk_ir::TyKind::Ref(mutability, lifetime, ty) => { + let type_repr = emit_hir_ty(trap, db, ty_vars, ty); + let lifetime = emit_lifetime(trap, ty_vars, lifetime); Some( trap.emit(generated::RefTypeRepr { id: trap::TrapId::Star, is_mut: matches!(mutability, chalk_ir::Mutability::Mut), - lifetime, + lifetime: Some(lifetime), type_repr, }) .into(), ) } chalk_ir::TyKind::Array(ty, _konst) => { - let element_type_repr = emit_hir_ty(trap, db, ty); + let element_type_repr = emit_hir_ty(trap, db, ty_vars, ty); // TODO: handle array size constant Some( trap.emit(generated::ArrayTypeRepr { @@ -1036,7 +1150,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Slice(ty) => { - let type_repr = emit_hir_ty(trap, db, ty); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty); Some( trap.emit(generated::SliceTypeRepr { id: trap::TrapId::Star, @@ -1060,7 +1174,8 @@ fn emit_hir_ty( } }; path.push(name); - let generic_arg_list = emit_generic_arg_list(trap, db, substitution.as_slice(Interner)); + let generic_arg_list = + emit_generic_arg_list(trap, db, ty_vars, substitution.as_slice(Interner)); let path = make_qualified_path(trap, path, generic_arg_list); Some( trap.emit(generated::PathTypeRepr { @@ -1091,7 +1206,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Function(fn_pointer) => { - Some(emit_hir_fn_ptr(trap, db, fn_pointer).into()) + Some(emit_hir_fn_ptr(trap, db, ty_vars, fn_pointer).into()) } chalk_ir::TyKind::OpaqueType(_, _) | chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(_)) => { @@ -1099,7 +1214,7 @@ fn emit_hir_ty( .impl_trait_bounds(db) .iter() .flatten() - .flat_map(|t| emit_hir_type_bound(db, trap, t)) + .flat_map(|t| emit_hir_type_bound(db, trap, ty_vars, t)) .collect(); let type_bound_list = Some(trap.emit(generated::TypeBoundList { id: trap::TrapId::Star, @@ -1114,11 +1229,15 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Dyn(dyn_ty) => { + let parameters = vec!["Self".to_owned()]; + assert_eq!(dyn_ty.bounds.binders.len(Interner), parameters.len(),); + let ty_vars = &push_ty_vars(ty_vars, parameters); + let bounds = dyn_ty .bounds .skip_binders() .iter(ra_ap_hir_ty::Interner) - .flat_map(|t| emit_hir_type_bound(db, trap, t)) + .flat_map(|t| emit_hir_type_bound(db, trap, ty_vars, t)) .collect(); let type_bound_list = Some(trap.emit(generated::TypeBoundList { id: trap::TrapId::Star, @@ -1134,7 +1253,7 @@ fn emit_hir_ty( } chalk_ir::TyKind::FnDef(fn_def_id, parameters) => { let sig = ra_ap_hir_ty::CallableSig::from_def(db, *fn_def_id, parameters); - Some(emit_hir_fn_ptr(trap, db, &sig.to_fn_ptr()).into()) + Some(emit_hir_fn_ptr(trap, db, ty_vars, &sig.to_fn_ptr()).into()) } chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(ProjectionTy { @@ -1171,8 +1290,17 @@ fn emit_hir_ty( None } chalk_ir::TyKind::BoundVar(var) => { - let var = format!("T_{}_{}", var.debruijn.depth(), var.index); - let path = make_qualified_path(trap, vec![var], None); + let var_ = ty_vars + .get(ty_vars.len() - 1 - var.debruijn.depth() as usize) + .and_then(|ty_vars| ty_vars.get(var.index)); + let path = make_qualified_path( + trap, + vec![ + var_.unwrap_or(&format!("E_{}_{}", var.debruijn.depth(), var.index)) + .clone(), + ], + None, + ); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1196,6 +1324,7 @@ fn emit_hir_ty( fn emit_generic_arg_list( trap: &mut TrapFile, db: &dyn HirDatabase, + ty_vars: &[Vec], args: &[GenericArg], ) -> Option> { if args.is_empty() { @@ -1205,7 +1334,7 @@ fn emit_generic_arg_list( .iter() .flat_map(|arg| { if let Some(ty) = arg.ty(Interner) { - let type_repr = emit_hir_ty(trap, db, ty); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty); Some( trap.emit(generated::TypeArg { id: trap::TrapId::Star, @@ -1214,17 +1343,7 @@ fn emit_generic_arg_list( .into(), ) } else if let Some(l) = arg.lifetime(Interner) { - let text = match l.data(Interner) { - chalk_ir::LifetimeData::BoundVar(var) => { - format!("'T_{}_{}", var.debruijn.depth(), var.index).into() - } - chalk_ir::LifetimeData::Static => "'static'".to_owned().into(), - _ => None, - }; - let lifetime = trap.emit(generated::Lifetime { - id: trap::TrapId::Star, - text, - }); + let lifetime = emit_lifetime(trap, ty_vars, l); Some( trap.emit(generated::LifetimeArg { id: trap::TrapId::Star, @@ -1232,7 +1351,7 @@ fn emit_generic_arg_list( }) .into(), ) - } else if let Some(_) = arg.constant(Interner) { + } else if arg.constant(Interner).is_some() { Some( trap.emit(generated::ConstArg { id: trap::TrapId::Star, @@ -1253,6 +1372,36 @@ fn emit_generic_arg_list( .into() } +fn emit_lifetime( + trap: &mut TrapFile, + ty_vars: &[Vec], + l: &chalk_ir::Lifetime, +) -> trap::Label { + let text = match l.data(Interner) { + chalk_ir::LifetimeData::BoundVar(var) => { + let var_ = ty_vars + .get(ty_vars.len() - 1 - var.debruijn.depth() as usize) + .and_then(|ty_vars| ty_vars.get(var.index)); + + Some(var_.map(|v| v.to_string()).unwrap_or(format!( + "'E_{}_{}", + var.debruijn.depth(), + var.index + ))) + } + chalk_ir::LifetimeData::Static => "'static'".to_owned().into(), + chalk_ir::LifetimeData::InferenceVar(_) + | chalk_ir::LifetimeData::Placeholder(_) + | chalk_ir::LifetimeData::Erased + | chalk_ir::LifetimeData::Phantom(_, _) + | chalk_ir::LifetimeData::Error => None, + }; + trap.emit(generated::Lifetime { + id: trap::TrapId::Star, + text, + }) +} + enum Variant { Unit, Record(trap::Label), @@ -1263,7 +1412,7 @@ impl From for Option> { fn from(val: Variant) -> Self { match val { Variant::Record(label) => Some(label), - _ => None, + Variant::Unit | Variant::Tuple(_) => None, } } } @@ -1278,7 +1427,13 @@ impl From for Option> { } } -fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: VariantId) -> Variant { +fn emit_variant_data( + trap: &mut TrapFile, + db: &dyn HirDatabase, + ty_vars: &[Vec], + variant_id: VariantId, +) -> Variant { + let parameters_len = ty_vars.last().map_or(0, Vec::len); let variant = variant_id.variant_data(db.upcast()); match variant.as_ref() { VariantData::Record { @@ -1293,7 +1448,8 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari id: trap::TrapId::Star, text: Some(field_data[field_id].name.as_str().to_owned()), })); - let type_repr = emit_hir_ty(trap, db, ty.skip_binders()); + assert_eq!(ty.binders.len(Interner), parameters_len); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty.skip_binders()); let visibility = emit_visibility( db, trap, @@ -1324,7 +1480,8 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari let fields = field_types .iter() .map(|(field_id, ty)| { - let type_repr = emit_hir_ty(trap, db, ty.skip_binders()); + assert_eq!(ty.binders.len(Interner), parameters_len); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty.skip_binders()); let visibility = emit_visibility( db, trap, diff --git a/rust/ql/lib/codeql/rust/elements/internal/LifetimeImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/LifetimeImpl.qll index 08bc22901fe8..e15f5733748a 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/LifetimeImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/LifetimeImpl.qll @@ -20,7 +20,7 @@ module Impl { */ class Lifetime extends Generated::Lifetime { override string toStringImpl() { - result = "'" + this.getText() + result = this.getText() or not this.hasText() and result = "'_" } From 2f87630dedd6bea10426eb5703e6d9349e321957 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Tue, 8 Apr 2025 09:58:52 +0200 Subject: [PATCH 111/240] Rust: update expected output --- .../generated/BreakExpr/BreakExpr.expected | 4 +- .../BreakExpr/BreakExpr_getExpr.expected | 4 +- .../BreakExpr/BreakExpr_getLifetime.expected | 4 +- .../ContinueExpr_getLifetime.expected | 2 +- .../Label/Label_getLifetime.expected | 2 +- .../SelfParam/SelfParam_getLifetime.expected | 2 +- .../ql/test/extractor-tests/utf8/ast.expected | 2 +- .../controlflow/BasicBlocks.expected | 108 +++++++++--------- .../library-tests/controlflow/Cfg.expected | 50 ++++---- .../dataflow/local/DataFlowStep.expected | 12 +- 10 files changed, 95 insertions(+), 95 deletions(-) diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected index 30c734fd682d..26a3ea2d9987 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected @@ -1,3 +1,3 @@ | gen_break_expr.rs:7:13:7:17 | break | getNumberOfAttrs: | 0 | hasExpr: | no | hasLifetime: | no | -| gen_break_expr.rs:12:13:12:27 | break ''label 42 | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | -| gen_break_expr.rs:17:13:17:27 | break ''label 42 | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | +| gen_break_expr.rs:12:13:12:27 | break 'label 42 | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | +| gen_break_expr.rs:17:13:17:27 | break 'label 42 | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected index 20c5295354af..276f1d3333be 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected @@ -1,2 +1,2 @@ -| gen_break_expr.rs:12:13:12:27 | break ''label 42 | gen_break_expr.rs:12:26:12:27 | 42 | -| gen_break_expr.rs:17:13:17:27 | break ''label 42 | gen_break_expr.rs:17:26:17:27 | 42 | +| gen_break_expr.rs:12:13:12:27 | break 'label 42 | gen_break_expr.rs:12:26:12:27 | 42 | +| gen_break_expr.rs:17:13:17:27 | break 'label 42 | gen_break_expr.rs:17:26:17:27 | 42 | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected index 2e1a88017950..09f1132362f6 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected @@ -1,2 +1,2 @@ -| gen_break_expr.rs:12:13:12:27 | break ''label 42 | gen_break_expr.rs:12:19:12:24 | ''label | -| gen_break_expr.rs:17:13:17:27 | break ''label 42 | gen_break_expr.rs:17:19:17:24 | ''label | +| gen_break_expr.rs:12:13:12:27 | break 'label 42 | gen_break_expr.rs:12:19:12:24 | 'label | +| gen_break_expr.rs:17:13:17:27 | break 'label 42 | gen_break_expr.rs:17:19:17:24 | 'label | diff --git a/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLifetime.expected b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLifetime.expected index d81d276ce0ae..3260e45d1b74 100644 --- a/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLifetime.expected +++ b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLifetime.expected @@ -1 +1 @@ -| gen_continue_expr.rs:12:13:12:27 | continue 'label | gen_continue_expr.rs:12:22:12:27 | ''label | +| gen_continue_expr.rs:12:13:12:27 | continue 'label | gen_continue_expr.rs:12:22:12:27 | 'label | diff --git a/rust/ql/test/extractor-tests/generated/Label/Label_getLifetime.expected b/rust/ql/test/extractor-tests/generated/Label/Label_getLifetime.expected index 73ebbe963e85..9bbe91519133 100644 --- a/rust/ql/test/extractor-tests/generated/Label/Label_getLifetime.expected +++ b/rust/ql/test/extractor-tests/generated/Label/Label_getLifetime.expected @@ -1 +1 @@ -| gen_label.rs:5:5:5:11 | 'label | gen_label.rs:5:5:5:10 | ''label | +| gen_label.rs:5:5:5:11 | 'label | gen_label.rs:5:5:5:10 | 'label | diff --git a/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam_getLifetime.expected b/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam_getLifetime.expected index 47e9eba10acc..cfe91c68c858 100644 --- a/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam_getLifetime.expected +++ b/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam_getLifetime.expected @@ -1 +1 @@ -| gen_self_param.rs:10:15:10:22 | SelfParam | gen_self_param.rs:10:16:10:17 | ''a | +| gen_self_param.rs:10:15:10:22 | SelfParam | gen_self_param.rs:10:16:10:17 | 'a | diff --git a/rust/ql/test/extractor-tests/utf8/ast.expected b/rust/ql/test/extractor-tests/utf8/ast.expected index 58f926364c04..a37eed8e2641 100644 --- a/rust/ql/test/extractor-tests/utf8/ast.expected +++ b/rust/ql/test/extractor-tests/utf8/ast.expected @@ -5,7 +5,7 @@ | utf8_identifiers.rs:1:1:12:2 | SourceFile | | utf8_identifiers.rs:1:4:1:6 | foo | | utf8_identifiers.rs:1:7:4:1 | <...> | -| utf8_identifiers.rs:2:5:2:6 | ''\u03b2 | +| utf8_identifiers.rs:2:5:2:6 | '\u03b2 | | utf8_identifiers.rs:2:5:2:6 | LifetimeParam | | utf8_identifiers.rs:3:5:3:5 | \u03b3 | | utf8_identifiers.rs:3:5:3:5 | \u03b3 | diff --git a/rust/ql/test/library-tests/controlflow/BasicBlocks.expected b/rust/ql/test/library-tests/controlflow/BasicBlocks.expected index 8de7e7066cd8..d5d978b9f52a 100644 --- a/rust/ql/test/library-tests/controlflow/BasicBlocks.expected +++ b/rust/ql/test/library-tests/controlflow/BasicBlocks.expected @@ -304,8 +304,8 @@ dominates | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:227:9:236:9 | if ... {...} else {...} | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:228:13:230:13 | if ... {...} | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:228:13:230:14 | ExprStmt | -| test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:36 | ExprStmt | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:233:13:233:13 | 1 | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:235:13:235:13 | 0 | @@ -314,18 +314,18 @@ dominates | test.rs:228:13:230:14 | ExprStmt | test.rs:227:9:236:9 | if ... {...} else {...} | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:14 | ExprStmt | -| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | | test.rs:228:13:230:14 | ExprStmt | test.rs:233:13:233:13 | 1 | | test.rs:228:13:230:14 | ExprStmt | test.rs:235:13:235:13 | 0 | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:235:13:235:13 | 0 | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:233:13:233:13 | 1 | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:235:13:235:13 | 0 | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:233:13:233:13 | 1 | | test.rs:229:17:229:36 | ExprStmt | test.rs:227:9:236:9 | if ... {...} else {...} | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | | test.rs:229:17:229:36 | ExprStmt | test.rs:233:13:233:13 | 1 | | test.rs:229:17:229:36 | ExprStmt | test.rs:235:13:235:13 | 0 | @@ -333,15 +333,15 @@ dominates | test.rs:235:13:235:13 | 0 | test.rs:235:13:235:13 | 0 | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:239:5:247:5 | enter fn test_labelled_block | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:240:9:246:9 | if ... {...} else {...} | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:243:13:243:13 | 1 | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:245:13:245:13 | 0 | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:240:9:246:9 | if ... {...} else {...} | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:245:13:245:13 | 0 | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:243:13:243:13 | 1 | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:245:13:245:13 | 0 | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:243:13:243:13 | 1 | | test.rs:243:13:243:13 | 1 | test.rs:243:13:243:13 | 1 | | test.rs:245:13:245:13 | 0 | test.rs:245:13:245:13 | 0 | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:252:5:255:5 | enter fn test_and_operator | @@ -1031,8 +1031,8 @@ postDominance | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:227:9:236:9 | if ... {...} else {...} | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:228:13:230:13 | if ... {...} | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:228:13:230:14 | ExprStmt | -| test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:36 | ExprStmt | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:233:13:233:13 | 1 | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:235:13:235:13 | 0 | @@ -1040,28 +1040,28 @@ postDominance | test.rs:228:13:230:14 | ExprStmt | test.rs:226:5:237:5 | enter fn test_if_loop2 | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:14 | ExprStmt | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:229:17:229:36 | ExprStmt | test.rs:226:5:237:5 | enter fn test_if_loop2 | | test.rs:229:17:229:36 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | | test.rs:229:17:229:36 | ExprStmt | test.rs:228:13:230:14 | ExprStmt | | test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | -| test.rs:233:13:233:13 | 1 | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:233:13:233:13 | 1 | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:233:13:233:13 | 1 | test.rs:233:13:233:13 | 1 | -| test.rs:235:13:235:13 | 0 | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | +| test.rs:235:13:235:13 | 0 | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | | test.rs:235:13:235:13 | 0 | test.rs:235:13:235:13 | 0 | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:239:5:247:5 | enter fn test_labelled_block | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:239:5:247:5 | enter fn test_labelled_block | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:240:9:246:9 | if ... {...} else {...} | -| test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | -| test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | +| test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | +| test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:243:13:243:13 | 1 | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:245:13:245:13 | 0 | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | -| test.rs:243:13:243:13 | 1 | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | +| test.rs:243:13:243:13 | 1 | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | | test.rs:243:13:243:13 | 1 | test.rs:243:13:243:13 | 1 | -| test.rs:245:13:245:13 | 0 | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | +| test.rs:245:13:245:13 | 0 | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | | test.rs:245:13:245:13 | 0 | test.rs:245:13:245:13 | 0 | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:252:5:255:5 | enter fn test_and_operator | | test.rs:253:17:253:22 | [boolean(false)] ... && ... | test.rs:253:17:253:22 | [boolean(false)] ... && ... | @@ -1543,16 +1543,16 @@ immediateDominator | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:36 | ExprStmt | | test.rs:228:13:230:13 | if ... {...} | test.rs:228:13:230:14 | ExprStmt | | test.rs:228:13:230:14 | ExprStmt | test.rs:226:5:237:5 | enter fn test_if_loop2 | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:229:17:229:36 | ExprStmt | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:229:17:229:36 | ExprStmt | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:229:17:229:36 | ExprStmt | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:229:17:229:36 | ExprStmt | | test.rs:229:17:229:36 | ExprStmt | test.rs:228:13:230:14 | ExprStmt | -| test.rs:233:13:233:13 | 1 | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | -| test.rs:235:13:235:13 | 0 | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | +| test.rs:233:13:233:13 | 1 | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | +| test.rs:235:13:235:13 | 0 | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:239:5:247:5 | enter fn test_labelled_block | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:239:5:247:5 | enter fn test_labelled_block | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:239:5:247:5 | enter fn test_labelled_block | -| test.rs:243:13:243:13 | 1 | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | -| test.rs:245:13:245:13 | 0 | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:239:5:247:5 | enter fn test_labelled_block | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:239:5:247:5 | enter fn test_labelled_block | +| test.rs:243:13:243:13 | 1 | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | +| test.rs:245:13:245:13 | 0 | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | | test.rs:253:17:253:22 | [boolean(false)] ... && ... | test.rs:252:5:255:5 | enter fn test_and_operator | | test.rs:253:17:253:22 | [boolean(true)] ... && ... | test.rs:253:22:253:22 | b | | test.rs:253:17:253:27 | ... && ... | test.rs:252:5:255:5 | enter fn test_and_operator | @@ -1798,23 +1798,23 @@ controls | test.rs:216:17:216:29 | ExprStmt | test.rs:222:13:222:13 | 0 | false | | test.rs:228:13:230:14 | ExprStmt | test.rs:227:9:236:9 | if ... {...} else {...} | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | false | -| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | true | -| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | true | +| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | true | +| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:233:13:233:13 | 1 | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:235:13:235:13 | 0 | true | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:235:13:235:13 | 0 | false | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:233:13:233:13 | 1 | true | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | false | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | true | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:235:13:235:13 | 0 | false | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:233:13:233:13 | 1 | true | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | false | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | true | | test.rs:229:17:229:36 | ExprStmt | test.rs:233:13:233:13 | 1 | true | | test.rs:229:17:229:36 | ExprStmt | test.rs:235:13:235:13 | 0 | false | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | false | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | true | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | false | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | true | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:243:13:243:13 | 1 | true | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:245:13:245:13 | 0 | false | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:245:13:245:13 | 0 | false | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:243:13:243:13 | 1 | true | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:245:13:245:13 | 0 | false | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:243:13:243:13 | 1 | true | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:17:253:22 | [boolean(true)] ... && ... | true | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:22:253:22 | b | true | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:27:253:27 | c | true | @@ -1974,14 +1974,14 @@ successor | test.rs:216:17:216:29 | ExprStmt | test.rs:216:17:216:28 | [boolean(true)] break ... | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | false | | test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | true | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:235:13:235:13 | 0 | false | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:233:13:233:13 | 1 | true | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | false | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | true | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | false | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | true | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:245:13:245:13 | 0 | false | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:243:13:243:13 | 1 | true | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:235:13:235:13 | 0 | false | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:233:13:233:13 | 1 | true | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | false | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | true | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | false | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | true | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:245:13:245:13 | 0 | false | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:243:13:243:13 | 1 | true | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:17:253:22 | [boolean(false)] ... && ... | false | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:22:253:22 | b | true | | test.rs:253:17:253:22 | [boolean(false)] ... && ... | test.rs:253:17:253:27 | ... && ... | false | diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 40348a474e5f..1705b88e3d75 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -119,10 +119,10 @@ edges | test.rs:49:24:51:17 | if b {...} | test.rs:47:17:51:17 | if b {...} else {...} | | | test.rs:49:27:49:27 | b | test.rs:49:24:51:17 | if b {...} | false | | test.rs:49:27:49:27 | b | test.rs:50:21:50:33 | ExprStmt | true | -| test.rs:50:21:50:32 | break ''outer | test.rs:45:9:54:9 | 'outer: loop { ... } | break | -| test.rs:50:21:50:33 | ExprStmt | test.rs:50:21:50:32 | break ''outer | | -| test.rs:52:17:52:28 | break ''inner | test.rs:46:13:53:13 | 'inner: loop { ... } | break | -| test.rs:52:17:52:29 | ExprStmt | test.rs:52:17:52:28 | break ''inner | | +| test.rs:50:21:50:32 | break 'outer | test.rs:45:9:54:9 | 'outer: loop { ... } | break | +| test.rs:50:21:50:33 | ExprStmt | test.rs:50:21:50:32 | break 'outer | | +| test.rs:52:17:52:28 | break 'inner | test.rs:46:13:53:13 | 'inner: loop { ... } | break | +| test.rs:52:17:52:29 | ExprStmt | test.rs:52:17:52:28 | break 'inner | | | test.rs:55:9:55:12 | true | test.rs:44:48:56:5 | { ... } | | | test.rs:58:5:70:5 | enter fn test_continue_with_labels | test.rs:58:34:58:34 | b | | | test.rs:58:34:58:34 | b | test.rs:58:34:58:34 | b | | @@ -534,12 +534,12 @@ edges | test.rs:228:16:228:20 | ... > ... | test.rs:228:13:230:13 | if ... {...} | false | | test.rs:228:16:228:20 | ... > ... | test.rs:229:17:229:36 | ExprStmt | true | | test.rs:228:20:228:20 | 0 | test.rs:228:16:228:20 | ... > ... | | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:227:13:232:9 | [boolean(false)] 'label: loop { ... } | break | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:227:13:232:9 | [boolean(true)] 'label: loop { ... } | break | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:227:13:232:9 | [boolean(false)] 'label: loop { ... } | break | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:227:13:232:9 | [boolean(true)] 'label: loop { ... } | break | | test.rs:229:17:229:36 | ExprStmt | test.rs:229:30:229:30 | a | | | test.rs:229:30:229:30 | a | test.rs:229:34:229:35 | 10 | | -| test.rs:229:30:229:35 | ... > ... | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | false | -| test.rs:229:30:229:35 | ... > ... | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | true | +| test.rs:229:30:229:35 | ... > ... | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | false | +| test.rs:229:30:229:35 | ... > ... | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | true | | test.rs:229:34:229:35 | 10 | test.rs:229:30:229:35 | ... > ... | | | test.rs:231:13:231:13 | a | test.rs:231:17:231:18 | 10 | | | test.rs:231:13:231:18 | ... < ... | test.rs:227:26:232:9 | { ... } | | @@ -558,12 +558,12 @@ edges | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:239:43:247:5 | { ... } | | | test.rs:240:13:242:9 | [boolean(false)] 'block: { ... } | test.rs:245:13:245:13 | 0 | false | | test.rs:240:13:242:9 | [boolean(true)] 'block: { ... } | test.rs:243:13:243:13 | 1 | true | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:240:13:242:9 | [boolean(false)] 'block: { ... } | break | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:240:13:242:9 | [boolean(true)] 'block: { ... } | break | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:240:13:242:9 | [boolean(false)] 'block: { ... } | break | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:240:13:242:9 | [boolean(true)] 'block: { ... } | break | | test.rs:241:13:241:31 | ExprStmt | test.rs:241:26:241:26 | a | | | test.rs:241:26:241:26 | a | test.rs:241:30:241:30 | 0 | | -| test.rs:241:26:241:30 | ... > ... | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | false | -| test.rs:241:26:241:30 | ... > ... | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | true | +| test.rs:241:26:241:30 | ... > ... | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | false | +| test.rs:241:26:241:30 | ... > ... | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | true | | test.rs:241:30:241:30 | 0 | test.rs:241:26:241:30 | ... > ... | | | test.rs:242:12:244:9 | { ... } | test.rs:240:9:246:9 | if ... {...} else {...} | | | test.rs:243:13:243:13 | 1 | test.rs:242:12:244:9 | { ... } | | @@ -1364,9 +1364,9 @@ edges | test.rs:571:12:571:28 | condition_not_met | test.rs:571:12:571:30 | condition_not_met(...) | | | test.rs:571:12:571:30 | condition_not_met(...) | test.rs:571:9:573:9 | if ... {...} | false | | test.rs:571:12:571:30 | condition_not_met(...) | test.rs:572:13:572:27 | ExprStmt | true | -| test.rs:572:13:572:26 | break ''block 1 | test.rs:569:18:580:5 | 'block: { ... } | break | +| test.rs:572:13:572:26 | break 'block 1 | test.rs:569:18:580:5 | 'block: { ... } | break | | test.rs:572:13:572:27 | ExprStmt | test.rs:572:26:572:26 | 1 | | -| test.rs:572:26:572:26 | 1 | test.rs:572:13:572:26 | break ''block 1 | | +| test.rs:572:26:572:26 | 1 | test.rs:572:13:572:26 | break 'block 1 | | | test.rs:574:9:574:21 | do_next_thing | test.rs:574:9:574:23 | do_next_thing(...) | | | test.rs:574:9:574:23 | do_next_thing(...) | test.rs:575:9:577:9 | ExprStmt | | | test.rs:574:9:574:24 | ExprStmt | test.rs:574:9:574:21 | do_next_thing | | @@ -1375,9 +1375,9 @@ edges | test.rs:575:12:575:28 | condition_not_met | test.rs:575:12:575:30 | condition_not_met(...) | | | test.rs:575:12:575:30 | condition_not_met(...) | test.rs:575:9:577:9 | if ... {...} | false | | test.rs:575:12:575:30 | condition_not_met(...) | test.rs:576:13:576:27 | ExprStmt | true | -| test.rs:576:13:576:26 | break ''block 2 | test.rs:569:18:580:5 | 'block: { ... } | break | +| test.rs:576:13:576:26 | break 'block 2 | test.rs:569:18:580:5 | 'block: { ... } | break | | test.rs:576:13:576:27 | ExprStmt | test.rs:576:26:576:26 | 2 | | -| test.rs:576:26:576:26 | 2 | test.rs:576:13:576:26 | break ''block 2 | | +| test.rs:576:26:576:26 | 2 | test.rs:576:13:576:26 | break 'block 2 | | | test.rs:578:9:578:21 | do_last_thing | test.rs:578:9:578:23 | do_last_thing(...) | | | test.rs:578:9:578:23 | do_last_thing(...) | test.rs:579:9:579:9 | 3 | | | test.rs:578:9:578:24 | ExprStmt | test.rs:578:9:578:21 | do_last_thing | | @@ -1400,9 +1400,9 @@ edges | test.rs:587:18:587:18 | y | test.rs:587:18:587:18 | y | | | test.rs:587:18:587:18 | y | test.rs:590:9:590:9 | 0 | match | | test.rs:587:23:587:23 | x | test.rs:587:13:587:19 | Some(...) | | -| test.rs:588:13:588:26 | break ''block 1 | test.rs:585:18:591:5 | 'block: { ... } | break | +| test.rs:588:13:588:26 | break 'block 1 | test.rs:585:18:591:5 | 'block: { ... } | break | | test.rs:588:13:588:27 | ExprStmt | test.rs:588:26:588:26 | 1 | | -| test.rs:588:26:588:26 | 1 | test.rs:588:13:588:26 | break ''block 1 | | +| test.rs:588:26:588:26 | 1 | test.rs:588:13:588:26 | break 'block 1 | | | test.rs:590:9:590:9 | 0 | test.rs:585:18:591:5 | 'block: { ... } | | | test.rs:594:1:600:1 | enter fn test_nested_function2 | test.rs:595:5:595:18 | let ... = 0 | | | test.rs:594:1:600:1 | exit fn test_nested_function2 (normal) | test.rs:594:1:600:1 | exit fn test_nested_function2 | | @@ -1468,18 +1468,18 @@ edges breakTarget | test.rs:34:17:34:21 | break | test.rs:28:9:40:9 | loop { ... } | | test.rs:48:21:48:25 | break | test.rs:46:13:53:13 | 'inner: loop { ... } | -| test.rs:50:21:50:32 | break ''outer | test.rs:45:9:54:9 | 'outer: loop { ... } | -| test.rs:52:17:52:28 | break ''inner | test.rs:46:13:53:13 | 'inner: loop { ... } | +| test.rs:50:21:50:32 | break 'outer | test.rs:45:9:54:9 | 'outer: loop { ... } | +| test.rs:52:17:52:28 | break 'inner | test.rs:46:13:53:13 | 'inner: loop { ... } | | test.rs:91:17:91:21 | break | test.rs:88:9:94:9 | while b { ... } | | test.rs:101:17:101:21 | break | test.rs:99:9:103:9 | while ... { ... } | | test.rs:109:17:109:21 | break | test.rs:107:9:112:9 | for ... in ... { ... } | | test.rs:117:13:117:26 | break ... | test.rs:116:9:118:9 | loop { ... } | | test.rs:216:17:216:28 | break ... | test.rs:214:13:219:9 | loop { ... } | -| test.rs:229:17:229:35 | break ''label ... | test.rs:227:13:232:9 | 'label: loop { ... } | -| test.rs:241:13:241:30 | break ''block ... | test.rs:240:13:242:9 | 'block: { ... } | -| test.rs:572:13:572:26 | break ''block 1 | test.rs:569:18:580:5 | 'block: { ... } | -| test.rs:576:13:576:26 | break ''block 2 | test.rs:569:18:580:5 | 'block: { ... } | -| test.rs:588:13:588:26 | break ''block 1 | test.rs:585:18:591:5 | 'block: { ... } | +| test.rs:229:17:229:35 | break 'label ... | test.rs:227:13:232:9 | 'label: loop { ... } | +| test.rs:241:13:241:30 | break 'block ... | test.rs:240:13:242:9 | 'block: { ... } | +| test.rs:572:13:572:26 | break 'block 1 | test.rs:569:18:580:5 | 'block: { ... } | +| test.rs:576:13:576:26 | break 'block 2 | test.rs:569:18:580:5 | 'block: { ... } | +| test.rs:588:13:588:26 | break 'block 1 | test.rs:585:18:591:5 | 'block: { ... } | continueTarget | test.rs:37:17:37:24 | continue | test.rs:28:9:40:9 | loop { ... } | | test.rs:63:21:63:28 | continue | test.rs:61:13:68:13 | 'inner: loop { ... } | diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index c147ec62e2e9..79b0ebc62f04 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -90,8 +90,8 @@ localStep | main.rs:66:9:66:9 | a | main.rs:66:9:66:9 | [SSA] a | | main.rs:66:9:66:9 | a | main.rs:66:9:66:9 | a | | main.rs:66:13:71:5 | 'block: { ... } | main.rs:66:9:66:9 | a | -| main.rs:68:13:68:26 | break ''block 1 | main.rs:66:13:71:5 | 'block: { ... } | -| main.rs:68:26:68:26 | 1 | main.rs:68:13:68:26 | break ''block 1 | +| main.rs:68:13:68:26 | break 'block 1 | main.rs:66:13:71:5 | 'block: { ... } | +| main.rs:68:26:68:26 | 1 | main.rs:68:13:68:26 | break 'block 1 | | main.rs:70:9:70:9 | 2 | main.rs:66:13:71:5 | 'block: { ... } | | main.rs:72:5:72:5 | a | main.rs:65:38:73:1 | { ... } | | main.rs:75:22:75:22 | [SSA] b | main.rs:77:12:77:12 | b | @@ -102,10 +102,10 @@ localStep | main.rs:76:9:76:9 | a | main.rs:76:9:76:9 | [SSA] a | | main.rs:76:9:76:9 | a | main.rs:76:9:76:9 | a | | main.rs:76:13:81:5 | 'block: { ... } | main.rs:76:9:76:9 | a | -| main.rs:78:13:78:26 | break ''block 1 | main.rs:76:13:81:5 | 'block: { ... } | -| main.rs:78:26:78:26 | 1 | main.rs:78:13:78:26 | break ''block 1 | -| main.rs:80:9:80:22 | break ''block 2 | main.rs:76:13:81:5 | 'block: { ... } | -| main.rs:80:22:80:22 | 2 | main.rs:80:9:80:22 | break ''block 2 | +| main.rs:78:13:78:26 | break 'block 1 | main.rs:76:13:81:5 | 'block: { ... } | +| main.rs:78:26:78:26 | 1 | main.rs:78:13:78:26 | break 'block 1 | +| main.rs:80:9:80:22 | break 'block 2 | main.rs:76:13:81:5 | 'block: { ... } | +| main.rs:80:22:80:22 | 2 | main.rs:80:9:80:22 | break 'block 2 | | main.rs:82:5:82:5 | a | main.rs:75:38:83:1 | { ... } | | main.rs:89:9:89:9 | [SSA] i | main.rs:90:11:90:11 | i | | main.rs:89:9:89:9 | i | main.rs:89:9:89:9 | [SSA] i | From 7bfd5f161ed3c0281063ebd1dc2b8811467f0d8a Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Tue, 8 Apr 2025 19:42:15 +0200 Subject: [PATCH 112/240] Rust: crate graph: extract associated types --- rust/extractor/src/crate_graph.rs | 192 ++++++++++++++++++++++-------- 1 file changed, 141 insertions(+), 51 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 64dced1b19ed..0203e8adc47d 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -25,6 +25,7 @@ use ra_ap_hir_def::{ use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; use ra_ap_hir_ty::GenericArg; +use ra_ap_hir_ty::ProjectionTyExt; use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; @@ -279,7 +280,7 @@ fn emit_module_items( module: &ModuleData, trap: &mut TrapFile, ) -> Vec> { - let mut items = Vec::new(); + let mut items: Vec> = Vec::new(); let mut uses = HashMap::new(); let item_scope = &module.scope; for (name, item) in item_scope.entries() { @@ -303,7 +304,10 @@ fn emit_module_items( items.push(emit_function(db, trap, None, function, name).into()); } ModuleDefId::ConstId(konst) => { - items.extend(emit_const(db, name.as_str(), trap, None, konst, vis)); + items.extend( + emit_const(db, trap, None, name.as_str(), konst, vis) + .map(Into::>::into), + ); } ModuleDefId::StaticId(statik) => { items.extend(emit_static(db, name.as_str(), trap, statik, vis)); @@ -344,8 +348,12 @@ fn emit_module_items( ModuleDefId::TraitId(trait_id) => { items.extend(emit_trait(db, name.as_str(), trap, trait_id, vis)); } - ModuleDefId::TraitAliasId(_) | ModuleDefId::TypeAliasId(_) => (), // TODO - ModuleDefId::BuiltinType(_) => (), // TODO? + ModuleDefId::TypeAliasId(type_alias_id_) => items.extend( + emit_type_alias(db, trap, None, name.as_str(), type_alias_id_, vis) + .map(Into::>::into), + ), + ModuleDefId::TraitAliasId(_) => (), + ModuleDefId::BuiltinType(_) => (), // modules are handled separatedly ModuleDefId::ModuleId(_) => (), // Enum variants cannot be declarted, only imported @@ -464,12 +472,12 @@ fn collect_generic_parameters( fn emit_const( db: &dyn HirDatabase, - name: &str, trap: &mut TrapFile, container: Option, + name: &str, konst: ra_ap_hir_def::ConstId, visibility: Visibility, -) -> Option> { +) -> Option> { let type_ = db.value_ty(konst.into()); let parameters = collect_generic_parameters(db, konst.into(), container); assert_eq!( @@ -486,19 +494,16 @@ fn emit_const( })); let konst = db.const_data(konst); let visibility = emit_visibility(db, trap, visibility); - Some( - trap.emit(generated::Const { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: true, - is_default: konst.has_body(), - type_repr, - visibility, - }) - .into(), - ) + Some(trap.emit(generated::Const { + id: trap::TrapId::Star, + name, + attrs: vec![], + body: None, + is_const: true, + is_default: konst.has_body(), + type_repr, + visibility, + })) } fn emit_static( @@ -540,6 +545,39 @@ fn emit_static( ) } +fn emit_type_alias( + db: &dyn HirDatabase, + trap: &mut TrapFile, + container: Option, + name: &str, + alias_id: ra_ap_hir_def::TypeAliasId, + visibility: Visibility, +) -> Option> { + let (type_, _) = db.type_for_type_alias_with_diagnostics(alias_id); + let parameters = collect_generic_parameters(db, alias_id.into(), container); + assert_eq!(type_.binders.len(Interner), parameters.len()); + let ty_vars = &[parameters]; + let type_repr = emit_hir_ty(trap, db, ty_vars, type_.skip_binders()); + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: Some(name.to_owned()), + })); + let visibility = emit_visibility(db, trap, visibility); + let alias = db.type_alias_data(alias_id); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, alias_id.into()); + Some(trap.emit(generated::TypeAlias { + id: trap::TrapId::Star, + name, + attrs: vec![], + is_default: container.is_some() && alias.type_ref.is_some(), + type_repr, + visibility, + generic_param_list, + type_bound_list: None, + where_clause: None, + })) +} + fn emit_generic_param_list( trap: &mut TrapFile, db: &dyn HirDatabase, @@ -747,12 +785,29 @@ fn emit_trait( let assoc_items: Vec> = trait_items .items .iter() - .flat_map(|(name, item)| { - if let AssocItemId::FunctionId(function) = item { - Some(emit_function(db, trap, Some(trait_id.into()), *function, name).into()) - } else { - None + .flat_map(|(name, item)| match item { + AssocItemId::FunctionId(function_id) => { + Some(emit_function(db, trap, Some(trait_id.into()), *function_id, name).into()) } + + AssocItemId::ConstId(const_id) => emit_const( + db, + trap, + Some(trait_id.into()), + name.as_str(), + *const_id, + visibility, + ) + .map(Into::into), + AssocItemId::TypeAliasId(type_alias_id) => emit_type_alias( + db, + trap, + Some(trait_id.into()), + name.as_str(), + *type_alias_id, + visibility, + ) + .map(Into::into), }) .collect(); let assoc_item_list = Some(trap.emit(generated::AssocItemList { @@ -1258,36 +1313,71 @@ fn emit_hir_ty( chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(ProjectionTy { associated_ty_id, - substitution: _, + substitution, })) - | chalk_ir::TyKind::AssociatedType(associated_ty_id, _) => { - let assoc_ty_data = db.associated_ty_data(from_assoc_type_id(*associated_ty_id)); + | chalk_ir::TyKind::AssociatedType(associated_ty_id, substitution) => { + let pt = ProjectionTy { + associated_ty_id: *associated_ty_id, + substitution: substitution.clone(), + }; - let _name = db - .type_alias_data(assoc_ty_data.name) - .name - .as_str() - .to_owned(); + // >::Name<...> - let trait_ref = ra_ap_hir_ty::TraitRef { - trait_id: assoc_ty_data.trait_id, - substitution: assoc_ty_data.binders.identity_substitution(Interner), - }; - let mut trait_path = make_path(db, trait_ref.hir_trait_id()); - trait_path.push( - db.trait_data(trait_ref.hir_trait_id()) - .name - .as_str() - .to_owned(), - ); - //TODO - // trap.emit(generated::AssociatedType { - // id: trap::TrapId::Star, - // trait_path, - // name, - // }) - // .into() - None + let qualifier = trap.emit(generated::PathSegment { + id: trap::TrapId::Star, + generic_arg_list: None, + identifier: None, + parenthesized_arg_list: None, + ret_type: None, + return_type_syntax: None, + }); + let self_ty = pt.self_type_parameter(db); + let self_ty = emit_hir_ty(trap, db, ty_vars, &self_ty); + if let Some(self_ty) = self_ty { + generated::PathSegment::emit_type_repr(qualifier, self_ty, &mut trap.writer) + } + let trait_ref = pt.trait_ref(db); + let trait_ref = trait_path(db, trap, ty_vars, &trait_ref); + let trait_ref = trait_ref.map(|path| { + trap.emit(generated::PathTypeRepr { + id: trap::TrapId::Star, + path: Some(path), + }) + }); + if let Some(trait_ref) = trait_ref { + generated::PathSegment::emit_trait_type_repr(qualifier, trait_ref, &mut trap.writer) + } + let data = db.type_alias_data(from_assoc_type_id(*associated_ty_id)); + + let identifier = Some(trap.emit(generated::NameRef { + id: trap::TrapId::Star, + text: Some(data.name.as_str().to_owned()), + })); + let segment = trap.emit(generated::PathSegment { + id: trap::TrapId::Star, + generic_arg_list: None, + identifier, + parenthesized_arg_list: None, + ret_type: None, + return_type_syntax: None, + }); + let qualifier = trap.emit(generated::Path { + id: trap::TrapId::Star, + qualifier: None, + segment: Some(qualifier), + }); + let path = trap.emit(generated::Path { + id: trap::TrapId::Star, + qualifier: Some(qualifier), + segment: Some(segment), + }); + Some( + trap.emit(generated::PathTypeRepr { + id: trap::TrapId::Star, + path: Some(path), + }) + .into(), + ) } chalk_ir::TyKind::BoundVar(var) => { let var_ = ty_vars From d78736b1bf238085efc8ba255283e3a6ff6428ad Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 15 Apr 2025 16:33:15 +0000 Subject: [PATCH 113/240] Post-release preparation for codeql-cli-2.21.1 --- actions/ql/lib/qlpack.yml | 2 +- actions/ql/src/qlpack.yml | 2 +- cpp/ql/lib/qlpack.yml | 2 +- cpp/ql/src/qlpack.yml | 2 +- csharp/ql/campaigns/Solorigate/lib/qlpack.yml | 2 +- csharp/ql/campaigns/Solorigate/src/qlpack.yml | 2 +- csharp/ql/lib/qlpack.yml | 2 +- csharp/ql/src/qlpack.yml | 2 +- go/ql/consistency-queries/qlpack.yml | 2 +- go/ql/lib/qlpack.yml | 2 +- go/ql/src/qlpack.yml | 2 +- java/ql/lib/qlpack.yml | 2 +- java/ql/src/qlpack.yml | 2 +- javascript/ql/lib/qlpack.yml | 2 +- javascript/ql/src/qlpack.yml | 2 +- misc/suite-helpers/qlpack.yml | 2 +- python/ql/lib/qlpack.yml | 2 +- python/ql/src/qlpack.yml | 2 +- ruby/ql/lib/qlpack.yml | 2 +- ruby/ql/src/qlpack.yml | 2 +- rust/ql/lib/qlpack.yml | 2 +- rust/ql/src/qlpack.yml | 2 +- shared/controlflow/qlpack.yml | 2 +- shared/dataflow/qlpack.yml | 2 +- shared/mad/qlpack.yml | 2 +- shared/rangeanalysis/qlpack.yml | 2 +- shared/regex/qlpack.yml | 2 +- shared/ssa/qlpack.yml | 2 +- shared/threat-models/qlpack.yml | 2 +- shared/tutorial/qlpack.yml | 2 +- shared/typeflow/qlpack.yml | 2 +- shared/typeinference/qlpack.yml | 2 +- shared/typetracking/qlpack.yml | 2 +- shared/typos/qlpack.yml | 2 +- shared/util/qlpack.yml | 2 +- shared/xml/qlpack.yml | 2 +- shared/yaml/qlpack.yml | 2 +- swift/ql/lib/qlpack.yml | 2 +- swift/ql/src/qlpack.yml | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-) diff --git a/actions/ql/lib/qlpack.yml b/actions/ql/lib/qlpack.yml index 361f8bf995d3..31e85dd618ae 100644 --- a/actions/ql/lib/qlpack.yml +++ b/actions/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-all -version: 0.4.7 +version: 0.4.8-dev library: true warnOnImplicitThis: true dependencies: diff --git a/actions/ql/src/qlpack.yml b/actions/ql/src/qlpack.yml index 6e59f29dd11f..e8af2efb3372 100644 --- a/actions/ql/src/qlpack.yml +++ b/actions/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-queries -version: 0.5.4 +version: 0.5.5-dev library: false warnOnImplicitThis: true groups: [actions, queries] diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index 6ce41fd3e93f..faa1d6c3d6a0 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 4.2.0 +version: 4.2.1-dev groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index b6f5c9ad6426..c62bc64277e8 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 1.3.8 +version: 1.3.9-dev groups: - cpp - queries diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index fbd64509040a..403da4292813 100644 --- a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-all -version: 1.7.38 +version: 1.7.39-dev groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index 179247e4ef51..888f784b86d8 100644 --- a/csharp/ql/campaigns/Solorigate/src/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-queries -version: 1.7.38 +version: 1.7.39-dev groups: - csharp - solorigate diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index 9d39196e6f6b..db0a477a5cdc 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 5.1.4 +version: 5.1.5-dev groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/src/qlpack.yml b/csharp/ql/src/qlpack.yml index f87c44597d33..ac3522ef68ce 100644 --- a/csharp/ql/src/qlpack.yml +++ b/csharp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-queries -version: 1.1.1 +version: 1.1.2-dev groups: - csharp - queries diff --git a/go/ql/consistency-queries/qlpack.yml b/go/ql/consistency-queries/qlpack.yml index 8cba3ce7a4f4..6555842cf3b2 100644 --- a/go/ql/consistency-queries/qlpack.yml +++ b/go/ql/consistency-queries/qlpack.yml @@ -1,5 +1,5 @@ name: codeql-go-consistency-queries -version: 1.0.21 +version: 1.0.22-dev groups: - go - queries diff --git a/go/ql/lib/qlpack.yml b/go/ql/lib/qlpack.yml index 4306f3f8b436..3aabb5860bc5 100644 --- a/go/ql/lib/qlpack.yml +++ b/go/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-all -version: 4.2.3 +version: 4.2.4-dev groups: go dbscheme: go.dbscheme extractor: go diff --git a/go/ql/src/qlpack.yml b/go/ql/src/qlpack.yml index 0804625f085e..34af2e380187 100644 --- a/go/ql/src/qlpack.yml +++ b/go/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-queries -version: 1.1.12 +version: 1.1.13-dev groups: - go - queries diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml index d1e431b431d5..342dcb646267 100644 --- a/java/ql/lib/qlpack.yml +++ b/java/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-all -version: 7.1.3 +version: 7.1.4-dev groups: java dbscheme: config/semmlecode.dbscheme extractor: java diff --git a/java/ql/src/qlpack.yml b/java/ql/src/qlpack.yml index 1a1ed7fac405..38c7ecf94c5c 100644 --- a/java/ql/src/qlpack.yml +++ b/java/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-queries -version: 1.4.1 +version: 1.4.2-dev groups: - java - queries diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index 5b5e10e0c0dc..3955e8909e53 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-all -version: 2.6.1 +version: 2.6.2-dev groups: javascript dbscheme: semmlecode.javascript.dbscheme extractor: javascript diff --git a/javascript/ql/src/qlpack.yml b/javascript/ql/src/qlpack.yml index 1239092b279b..471704d59550 100644 --- a/javascript/ql/src/qlpack.yml +++ b/javascript/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-queries -version: 1.5.3 +version: 1.5.4-dev groups: - javascript - queries diff --git a/misc/suite-helpers/qlpack.yml b/misc/suite-helpers/qlpack.yml index fa098c1e8055..9dd4a6e2d6e6 100644 --- a/misc/suite-helpers/qlpack.yml +++ b/misc/suite-helpers/qlpack.yml @@ -1,4 +1,4 @@ name: codeql/suite-helpers -version: 1.0.21 +version: 1.0.22-dev groups: shared warnOnImplicitThis: true diff --git a/python/ql/lib/qlpack.yml b/python/ql/lib/qlpack.yml index a269f6ea9467..3517e1daa3d2 100644 --- a/python/ql/lib/qlpack.yml +++ b/python/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-all -version: 4.0.5 +version: 4.0.6-dev groups: python dbscheme: semmlecode.python.dbscheme extractor: python diff --git a/python/ql/src/qlpack.yml b/python/ql/src/qlpack.yml index 88b09575d0c9..c9bbffd46b3a 100644 --- a/python/ql/src/qlpack.yml +++ b/python/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-queries -version: 1.4.7 +version: 1.4.8-dev groups: - python - queries diff --git a/ruby/ql/lib/qlpack.yml b/ruby/ql/lib/qlpack.yml index 4bc89e7863ab..fcc413c263f2 100644 --- a/ruby/ql/lib/qlpack.yml +++ b/ruby/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-all -version: 4.1.4 +version: 4.1.5-dev groups: ruby extractor: ruby dbscheme: ruby.dbscheme diff --git a/ruby/ql/src/qlpack.yml b/ruby/ql/src/qlpack.yml index 6003cc96ddfd..d12d9343d8a4 100644 --- a/ruby/ql/src/qlpack.yml +++ b/ruby/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-queries -version: 1.2.0 +version: 1.2.1-dev groups: - ruby - queries diff --git a/rust/ql/lib/qlpack.yml b/rust/ql/lib/qlpack.yml index 5a7ba107f7ad..817d23c54c28 100644 --- a/rust/ql/lib/qlpack.yml +++ b/rust/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rust-all -version: 0.1.6 +version: 0.1.7-dev groups: rust extractor: rust dbscheme: rust.dbscheme diff --git a/rust/ql/src/qlpack.yml b/rust/ql/src/qlpack.yml index f7afd1d4c99f..d5fd49b0c385 100644 --- a/rust/ql/src/qlpack.yml +++ b/rust/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rust-queries -version: 0.1.6 +version: 0.1.7-dev groups: - rust - queries diff --git a/shared/controlflow/qlpack.yml b/shared/controlflow/qlpack.yml index 91c33675babb..34183f2048b8 100644 --- a/shared/controlflow/qlpack.yml +++ b/shared/controlflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/controlflow -version: 2.0.5 +version: 2.0.6-dev groups: shared library: true dependencies: diff --git a/shared/dataflow/qlpack.yml b/shared/dataflow/qlpack.yml index 82b137f996d7..06d87a5c3cc0 100644 --- a/shared/dataflow/qlpack.yml +++ b/shared/dataflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/dataflow -version: 2.0.5 +version: 2.0.6-dev groups: shared library: true dependencies: diff --git a/shared/mad/qlpack.yml b/shared/mad/qlpack.yml index bd73c23bb126..77eeff61cb8c 100644 --- a/shared/mad/qlpack.yml +++ b/shared/mad/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/mad -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/rangeanalysis/qlpack.yml b/shared/rangeanalysis/qlpack.yml index 76a9eeb51964..4e2065f70d2b 100644 --- a/shared/rangeanalysis/qlpack.yml +++ b/shared/rangeanalysis/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rangeanalysis -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/regex/qlpack.yml b/shared/regex/qlpack.yml index b32c38cae91d..1121f153bf55 100644 --- a/shared/regex/qlpack.yml +++ b/shared/regex/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/regex -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/ssa/qlpack.yml b/shared/ssa/qlpack.yml index 1fa4f9cd7192..7ed319dae575 100644 --- a/shared/ssa/qlpack.yml +++ b/shared/ssa/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ssa -version: 1.1.0 +version: 1.1.1-dev groups: shared library: true dependencies: diff --git a/shared/threat-models/qlpack.yml b/shared/threat-models/qlpack.yml index ca7ab6760c8e..2b35e47d089c 100644 --- a/shared/threat-models/qlpack.yml +++ b/shared/threat-models/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/threat-models -version: 1.0.21 +version: 1.0.22-dev library: true groups: shared dataExtensions: diff --git a/shared/tutorial/qlpack.yml b/shared/tutorial/qlpack.yml index 0735fce8bb12..3dcf3d9653a1 100644 --- a/shared/tutorial/qlpack.yml +++ b/shared/tutorial/qlpack.yml @@ -1,7 +1,7 @@ name: codeql/tutorial description: Library for the CodeQL detective tutorials, helping new users learn to write CodeQL queries. -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/typeflow/qlpack.yml b/shared/typeflow/qlpack.yml index b918a6647d4c..2a80a2fd93df 100644 --- a/shared/typeflow/qlpack.yml +++ b/shared/typeflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeflow -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/typeinference/qlpack.yml b/shared/typeinference/qlpack.yml index e53d74a0f0b0..2ae46b4a8f37 100644 --- a/shared/typeinference/qlpack.yml +++ b/shared/typeinference/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeinference -version: 0.0.2 +version: 0.0.3-dev groups: shared library: true dependencies: diff --git a/shared/typetracking/qlpack.yml b/shared/typetracking/qlpack.yml index 3a49c1318701..5a18f7e7bb7e 100644 --- a/shared/typetracking/qlpack.yml +++ b/shared/typetracking/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typetracking -version: 2.0.5 +version: 2.0.6-dev groups: shared library: true dependencies: diff --git a/shared/typos/qlpack.yml b/shared/typos/qlpack.yml index 9f9eb31e03fc..640123cfba69 100644 --- a/shared/typos/qlpack.yml +++ b/shared/typos/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typos -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/util/qlpack.yml b/shared/util/qlpack.yml index 8f17062384d0..923d31ad8952 100644 --- a/shared/util/qlpack.yml +++ b/shared/util/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/util -version: 2.0.8 +version: 2.0.9-dev groups: shared library: true dependencies: null diff --git a/shared/xml/qlpack.yml b/shared/xml/qlpack.yml index 36d5e9aaf98d..1cbd3609e729 100644 --- a/shared/xml/qlpack.yml +++ b/shared/xml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/xml -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/yaml/qlpack.yml b/shared/yaml/qlpack.yml index 2a582f48a94c..38c92ec2777c 100644 --- a/shared/yaml/qlpack.yml +++ b/shared/yaml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/yaml -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true warnOnImplicitThis: true diff --git a/swift/ql/lib/qlpack.yml b/swift/ql/lib/qlpack.yml index a4a4492d599c..758992289527 100644 --- a/swift/ql/lib/qlpack.yml +++ b/swift/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-all -version: 4.1.4 +version: 4.1.5-dev groups: swift extractor: swift dbscheme: swift.dbscheme diff --git a/swift/ql/src/qlpack.yml b/swift/ql/src/qlpack.yml index a99b65317ee1..efe9d3232c8f 100644 --- a/swift/ql/src/qlpack.yml +++ b/swift/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-queries -version: 1.1.1 +version: 1.1.2-dev groups: - swift - queries From 495276856987c7b4155ee5146242487db27163a5 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Tue, 15 Apr 2025 10:21:54 -0700 Subject: [PATCH 114/240] Actions: Fix change note newline --- .../2025-04-14-excessive-secrets-exposure-security-severity.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md b/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md index 9beaabecbe65..c59e1eb9db33 100644 --- a/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md +++ b/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md @@ -1,5 +1,4 @@ --- category: fix --- -* Assigned a `security-severity` to the query `actions - excessive-secrets-exposure`. \ No newline at end of file +* Assigned a `security-severity` to the query `actions/excessive-secrets-exposure`. \ No newline at end of file From 49183bb82a78b0414cd9e9be67d12849fceae462 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Wed, 16 Apr 2025 16:19:26 +0200 Subject: [PATCH 115/240] C++: add predicate to distinguish between array/field designators --- cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll | 41 +++++++++++++++++++- cpp/ql/lib/semmlecode.cpp.dbscheme | 6 ++- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll index a36758417bb9..fb79988c10f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll @@ -213,7 +213,27 @@ class ClassAggregateLiteral extends AggregateLiteral { Expr getFieldExpr(Field field, int position) { field = classType.getAField() and aggregate_field_init(underlyingElement(this), unresolveElement(result), unresolveElement(field), - position) + position, _) + } + + /** + * Holds if the `position`-th initialization of `field` in this aggregate initializer + * uses a designator (e.g., `.x =`, `[42] =`) rather than a positional initializer. + * + * This can be used to distinguish explicitly designated initializations from + * implicit positional ones. + * + * For example, in the initializer: + * ```c + * struct S { int x, y; }; + * struct S s = { .x = 1, 2 }; + * ``` + * - `.x = 1` is a designator init, therefore `isDesignatorInit(x, 0)` holds. + * - `2` is a positional init for `.y`, therefore `isDesignatorInit(y, 1)` does **not** hold. + */ + predicate isDesignatorInit(Field field, int position) { + field = classType.getAField() and + aggregate_field_init(underlyingElement(this), _, unresolveElement(field), position, true) } /** @@ -304,7 +324,24 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral { * - `a.getElementExpr(0, 2)` gives `789`. */ Expr getElementExpr(int elementIndex, int position) { - aggregate_array_init(underlyingElement(this), unresolveElement(result), elementIndex, position) + aggregate_array_init(underlyingElement(this), unresolveElement(result), elementIndex, position, + _) + } + + /** + * Holds if the `position`-th initialization of the array element at `elementIndex` + * in this aggregate initializer uses a designator (e.g., `[0] = ...`) rather than + * an implicit positional initializer. + * + * For example, in: + * ```c + * int x[] = { [0] = 1, 2 }; + * ``` + * - `[0] = 1` is a designator init, therefore `isDesignatorInit(0, 0)` holds. + * - `2` is a positional init for `x[1]`, therefore `isDesignatorInit(1, 1)` does **not** hold. + */ + predicate isDesignatorInit(int elementIndex, int position) { + aggregate_array_init(underlyingElement(this), _, elementIndex, position, true) } /** diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme b/cpp/ql/lib/semmlecode.cpp.dbscheme index 0f0a390468a5..2e2d805ef93d 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme @@ -2039,7 +2039,8 @@ aggregate_field_init( int aggregate: @aggregateliteral ref, int initializer: @expr ref, int field: @membervariable ref, - int position: int ref + int position: int ref, + boolean is_designated: boolean ref ); /** @@ -2051,7 +2052,8 @@ aggregate_array_init( int aggregate: @aggregateliteral ref, int initializer: @expr ref, int element_index: int ref, - int position: int ref + int position: int ref, + boolean is_designated: boolean ref ); @ctorinit = @ctordirectinit From d8afd2a786e4b73ef3ce5344cf51fe2d87ee20e0 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Wed, 16 Apr 2025 16:23:32 +0200 Subject: [PATCH 116/240] C++: add change note for designator-based initializations --- cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md diff --git a/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md new file mode 100644 index 000000000000..8b4911abd44d --- /dev/null +++ b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Introduced `isDesignatorInit()` predicates to distinguish between designator-based and positional initializations for both struct/union fields and array elements. \ No newline at end of file From 36a425715cefa967855257d169d4cb17d6a01e83 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Wed, 16 Apr 2025 16:23:55 +0200 Subject: [PATCH 117/240] C++: add upgrade and downgrade scripts --- .../aggregate_array_init.ql | 11 + .../aggregate_field_init.ql | 15 + .../old.dbscheme | 2448 +++++++++++++++++ .../semmlecode.cpp.dbscheme | 2446 ++++++++++++++++ .../upgrade.properties | 4 + .../aggregate_array_init.ql | 11 + .../aggregate_field_init.ql | 15 + .../old.dbscheme | 2446 ++++++++++++++++ .../semmlecode.cpp.dbscheme | 2448 +++++++++++++++++ .../upgrade.properties | 4 + 10 files changed, 9848 insertions(+) create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_array_init.ql create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_field_init.ql create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_array_init.ql create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_field_init.ql create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_array_init.ql b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_array_init.ql new file mode 100644 index 000000000000..acf38e449509 --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_array_init.ql @@ -0,0 +1,11 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, int element_index, int position +where aggregate_array_init(aggregate, initializer, element_index, position, _) +select aggregate, initializer, element_index, position diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_field_init.ql b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_field_init.ql new file mode 100644 index 000000000000..47503cbfd17a --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_field_init.ql @@ -0,0 +1,15 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +class MemberVariable extends @membervariable { + string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, MemberVariable field, int position +where aggregate_field_init(aggregate, initializer, field, position, _) +select aggregate, initializer, field, position diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme new file mode 100644 index 000000000000..2e2d805ef93d --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme @@ -0,0 +1,2448 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..0f0a390468a5 --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme @@ -0,0 +1,2446 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties new file mode 100644 index 000000000000..b7e78b39ee7a --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties @@ -0,0 +1,4 @@ +description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +compatibility: backwards +aggregate_array_init.rel: run aggregate_array_init.qlo +aggregate_field_init.rel: run aggregate_field_init.qlo \ No newline at end of file diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_array_init.ql b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_array_init.ql new file mode 100644 index 000000000000..9d09506d2d46 --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_array_init.ql @@ -0,0 +1,11 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, int element_index, int position +where aggregate_array_init(aggregate, initializer, element_index, position) +select aggregate, initializer, element_index, position, false diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_field_init.ql b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_field_init.ql new file mode 100644 index 000000000000..dd300af4c22c --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_field_init.ql @@ -0,0 +1,15 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +class MemberVariable extends @membervariable { + string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, MemberVariable field, int position +where aggregate_field_init(aggregate, initializer, field, position) +select aggregate, initializer, field, position, false diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme new file mode 100644 index 000000000000..0f0a390468a5 --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme @@ -0,0 +1,2446 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..2e2d805ef93d --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme @@ -0,0 +1,2448 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties new file mode 100644 index 000000000000..b7e78b39ee7a --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties @@ -0,0 +1,4 @@ +description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +compatibility: backwards +aggregate_array_init.rel: run aggregate_array_init.qlo +aggregate_field_init.rel: run aggregate_field_init.qlo \ No newline at end of file From 9da6d9435ea96d04e608734db334e38e7f917065 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 16 Apr 2025 16:07:30 +0100 Subject: [PATCH 118/240] Rust: More tests affected. --- .../dataflow/strings/inline-taint-flow.expected | 2 +- rust/ql/test/library-tests/dataflow/strings/main.rs | 2 +- .../test/query-tests/security/CWE-089/SqlInjection.expected | 6 +++++- .../query-tests/security/CWE-312/CleartextLogging.expected | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected b/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected index 08c883f1ec17..63076f6b5dfd 100644 --- a/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected +++ b/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected @@ -1,7 +1,7 @@ models | 1 | Summary: lang:alloc; <_ as crate::string::ToString>::to_string; Argument[self]; ReturnValue; taint | | 2 | Summary: lang:alloc; ::from; Argument[0]; ReturnValue; value | -| 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; taint | +| 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | | 4 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | | 5 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | edges diff --git a/rust/ql/test/library-tests/dataflow/strings/main.rs b/rust/ql/test/library-tests/dataflow/strings/main.rs index 01041e3df463..c04934de0517 100644 --- a/rust/ql/test/library-tests/dataflow/strings/main.rs +++ b/rust/ql/test/library-tests/dataflow/strings/main.rs @@ -61,7 +61,7 @@ fn string_to_string() { fn as_str() { let s = source(67); - sink_slice(s.as_str()); // $ hasTaintFlow=67 + sink_slice(s.as_str()); // $ hasValueFlow=67 } fn format_args_built_in() { diff --git a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected index f2b9d39fd162..267728ef9df0 100644 --- a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected @@ -32,11 +32,15 @@ edges | sqlx.rs:52:32:52:87 | MacroExpr | sqlx.rs:52:32:52:87 | ...::format(...) | provenance | MaD:4 | | sqlx.rs:52:32:52:87 | { ... } | sqlx.rs:52:32:52:87 | ...::must_use(...) | provenance | MaD:9 | | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:63:26:63:39 | unsafe_query_1 [&ref] | provenance | | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:63:26:63:48 | unsafe_query_1.as_str() | provenance | MaD:3 | | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:74:25:74:38 | unsafe_query_1 [&ref] | provenance | | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:74:25:74:47 | unsafe_query_1.as_str() | provenance | MaD:3 | | sqlx.rs:53:26:53:36 | &arg_string [&ref] | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | provenance | | | sqlx.rs:53:27:53:36 | arg_string | sqlx.rs:53:26:53:36 | &arg_string [&ref] | provenance | | | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:65:30:65:43 | unsafe_query_2 [&ref] | provenance | | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:65:30:65:52 | unsafe_query_2.as_str() | provenance | MaD:3 | | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:76:29:76:42 | unsafe_query_2 [&ref] | provenance | | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:76:29:76:51 | unsafe_query_2.as_str() | provenance | MaD:3 | | sqlx.rs:54:26:54:39 | &remote_string [&ref] | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | provenance | | | sqlx.rs:54:27:54:39 | remote_string | sqlx.rs:54:26:54:39 | &remote_string [&ref] | provenance | | | sqlx.rs:56:9:56:22 | unsafe_query_4 | sqlx.rs:67:30:67:52 | unsafe_query_4.as_str() | provenance | MaD:3 | @@ -53,7 +57,7 @@ edges models | 1 | Source: lang:std; crate::env::args; command-line-source; ReturnValue.Element | | 2 | Source: repo:https://github.com/seanmonstar/reqwest:reqwest; crate::blocking::get; remote; ReturnValue.Field[crate::result::Result::Ok(0)] | -| 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; taint | +| 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | | 4 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | | 5 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | | 6 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | diff --git a/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected b/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected index 92ba9448e38c..61218e9c9085 100644 --- a/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected +++ b/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected @@ -226,8 +226,8 @@ models | 8 | Sink: lang:std; crate::io::stdio::_print; log-injection; Argument[0] | | 9 | Sink: repo:https://github.com/rust-lang/log:log; crate::__private_api::log; log-injection; Argument[1] | | 10 | Sink: repo:https://github.com/rust-lang/log:log; crate::__private_api::log; log-injection; Argument[3] | -| 11 | Summary: lang:alloc; ::as_bytes; Argument[self]; ReturnValue; taint | -| 12 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; taint | +| 11 | Summary: lang:alloc; ::as_bytes; Argument[self]; ReturnValue; value | +| 12 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | | 13 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | | 14 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | nodes From 15fe2fbba6a0466e8cc5a112c1c0539ab4fb0acc Mon Sep 17 00:00:00 2001 From: idrissrio Date: Wed, 16 Apr 2025 16:25:24 +0200 Subject: [PATCH 119/240] C++: update stats file --- cpp/ql/lib/semmlecode.cpp.dbscheme.stats | 1259 ++++++++++++++-------- 1 file changed, 809 insertions(+), 450 deletions(-) diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats index 585e8f31e0a1..1a4c6b8c5c97 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats @@ -2,7 +2,7 @@ @compilation - 16215 + 16216 @externalDataElement @@ -34,7 +34,7 @@ @file - 83639 + 83640 @folder @@ -42,7 +42,7 @@ @macro_expansion - 40299208 + 40299816 @other_macro_reference @@ -58,11 +58,11 @@ @var_decl - 6734225 + 6733822 @type_decl - 1890777 + 1890806 @namespace_decl @@ -70,7 +70,7 @@ @using_declaration - 333244 + 333262 @using_directive @@ -90,7 +90,7 @@ @membervariable - 1441778 + 1441833 @globalvariable @@ -98,7 +98,7 @@ @localvariable - 735324 + 735322 @enumconstant @@ -370,7 +370,7 @@ @usertype - 4987434 + 4987509 @mangledname @@ -390,7 +390,7 @@ @ptrtomember - 12083 + 12084 @specifier @@ -422,7 +422,7 @@ @attribute_arg_constant_expr - 89600 + 89384 @attribute_arg_expr @@ -538,7 +538,7 @@ @divexpr - 60352 + 60353 @remexpr @@ -734,7 +734,7 @@ @temp_init - 1076139 + 1076142 @errorexpr @@ -818,7 +818,7 @@ @throw_expr - 26159 + 26260 @condition_decl @@ -966,7 +966,7 @@ @static_cast - 335479 + 335484 @reinterpret_cast @@ -986,7 +986,7 @@ @param_ref - 177993 + 177994 @noopexpr @@ -1430,7 +1430,7 @@ @stmt_decl - 770895 + 770907 @stmt_empty @@ -1446,7 +1446,7 @@ @stmt_try_block - 28973 + 29068 @stmt_microsoft_try @@ -1470,7 +1470,7 @@ @stmt_handler - 47475 + 47531 @stmt_constexpr_if @@ -1514,7 +1514,7 @@ @ppd_plain_include - 408579 + 408585 @ppd_define @@ -1592,11 +1592,11 @@ compilations - 16215 + 16216 id - 16215 + 16216 cwd @@ -1614,7 +1614,7 @@ 1 2 - 16215 + 16216 @@ -1640,11 +1640,11 @@ compilation_args - 1298229 + 1298248 id - 16215 + 16216 num @@ -1652,7 +1652,7 @@ arg - 37538 + 37539 @@ -2011,12 +2011,12 @@ 1 2 - 24858 + 24859 2 3 - 11189 + 11190 3 @@ -2031,11 +2031,11 @@ compilation_build_mode - 16215 + 16216 id - 16215 + 16216 mode @@ -2053,7 +2053,7 @@ 1 2 - 16215 + 16216 @@ -2079,11 +2079,11 @@ compilation_compiling_files - 16215 + 16216 id - 16215 + 16216 num @@ -2105,7 +2105,7 @@ 1 2 - 16215 + 16216 @@ -2121,7 +2121,7 @@ 1 2 - 16215 + 16216 @@ -2205,7 +2205,7 @@ compilation_time - 64592 + 64593 id @@ -2221,7 +2221,7 @@ seconds - 17407 + 17652 @@ -2267,17 +2267,17 @@ 2 3 - 149 + 203 3 4 - 8277 + 8250 4 5 - 7721 + 7694 @@ -2323,8 +2323,8 @@ 12 - 1285 - 1286 + 1303 + 1304 13 @@ -2371,18 +2371,18 @@ 12 - 9 - 10 + 8 + 9 13 - 11 - 12 + 10 + 11 13 - 718 - 719 + 710 + 711 13 @@ -2404,27 +2404,27 @@ 1 2 - 10837 + 11162 2 3 - 3617 + 3508 3 4 - 1368 + 1598 4 - 10 + 55 1327 - 10 - 694 - 257 + 77 + 700 + 54 @@ -2440,7 +2440,7 @@ 1 2 - 17407 + 17652 @@ -2456,16 +2456,16 @@ 1 2 - 14414 + 15051 2 3 - 2980 + 2587 - 3 - 4 + 4 + 5 13 @@ -2722,19 +2722,19 @@ compilation_finished - 16215 + 16216 id - 16215 + 16216 cpu_seconds - 12083 + 12165 elapsed_seconds - 257 + 243 @@ -2748,7 +2748,7 @@ 1 2 - 16215 + 16216 @@ -2764,7 +2764,7 @@ 1 2 - 16215 + 16216 @@ -2785,12 +2785,12 @@ 2 3 - 1246 + 1408 3 - 35 - 596 + 38 + 514 @@ -2806,12 +2806,12 @@ 1 2 - 11365 + 11311 2 3 - 717 + 853 @@ -2827,7 +2827,7 @@ 1 2 - 67 + 40 2 @@ -2840,48 +2840,63 @@ 13 - 6 - 7 + 4 + 5 13 - 11 - 12 - 54 + 8 + 9 + 13 - 20 - 21 + 9 + 10 13 - 31 - 32 + 10 + 11 + 27 + + + 13 + 14 13 - 43 - 44 + 19 + 20 13 - 127 - 128 + 28 + 29 13 - 265 - 266 + 42 + 43 13 - 321 - 322 + 142 + 143 13 - 330 - 331 + 272 + 273 + 13 + + + 296 + 297 + 13 + + + 336 + 337 13 @@ -2898,7 +2913,7 @@ 1 2 - 67 + 40 2 @@ -2911,48 +2926,63 @@ 13 - 6 - 7 + 4 + 5 13 - 11 - 12 - 54 + 8 + 9 + 13 - 20 - 21 + 9 + 10 13 - 31 - 32 + 10 + 11 + 27 + + + 13 + 14 13 - 43 - 44 + 19 + 20 13 - 120 - 121 + 28 + 29 13 - 171 - 172 + 42 + 43 13 - 233 - 234 + 136 + 137 13 - 267 - 268 + 183 + 184 + 13 + + + 245 + 246 + 13 + + + 246 + 247 13 @@ -11159,15 +11189,15 @@ files - 83639 + 83640 id - 83639 + 83640 name - 83639 + 83640 @@ -11181,7 +11211,7 @@ 1 2 - 83639 + 83640 @@ -11197,7 +11227,7 @@ 1 2 - 83639 + 83640 @@ -11255,7 +11285,7 @@ containerparent - 99503 + 99504 parent @@ -11263,7 +11293,7 @@ child - 99503 + 99504 @@ -11328,7 +11358,7 @@ 1 2 - 99503 + 99504 @@ -11338,7 +11368,7 @@ fileannotations - 5387479 + 5387560 id @@ -11350,11 +11380,11 @@ name - 75308 + 75309 value - 50679 + 50680 @@ -11604,7 +11634,7 @@ 2 3 - 5594 + 5595 3 @@ -11619,7 +11649,7 @@ 7 9 - 5892 + 5893 9 @@ -11644,7 +11674,7 @@ 47 128 - 6312 + 6313 128 @@ -11670,7 +11700,7 @@ 1 2 - 75308 + 75309 @@ -11752,7 +11782,7 @@ 1 2 - 4307 + 4308 2 @@ -12195,19 +12225,19 @@ macroinvocations - 40601294 + 40601906 id - 40601294 + 40601906 macro_id - 109907 + 109909 location - 1070096 + 1070112 kind @@ -12225,7 +12255,7 @@ 1 2 - 40601294 + 40601906 @@ -12241,7 +12271,7 @@ 1 2 - 40601294 + 40601906 @@ -12257,7 +12287,7 @@ 1 2 - 40601294 + 40601906 @@ -12273,12 +12303,12 @@ 1 2 - 23517 + 23518 2 3 - 20428 + 20429 3 @@ -12298,7 +12328,7 @@ 11 21 - 9184 + 9185 21 @@ -12334,17 +12364,17 @@ 1 2 - 60257 + 60258 2 3 - 13641 + 13642 3 4 - 6881 + 6882 4 @@ -12380,7 +12410,7 @@ 1 2 - 101453 + 101455 2 @@ -12401,37 +12431,37 @@ 1 2 - 426610 + 426617 2 3 - 252707 + 252710 3 4 - 113199 + 113201 4 6 - 77502 + 77503 6 11 - 82759 + 82760 11 42 - 80456 + 80457 42 226288 - 36861 + 36862 @@ -12447,7 +12477,7 @@ 1 2 - 1009649 + 1009664 2 @@ -12468,7 +12498,7 @@ 1 2 - 1070096 + 1070112 @@ -12541,15 +12571,15 @@ macroparent - 35811023 + 35811564 id - 35811023 + 35811564 parent_id - 28060082 + 28060505 @@ -12563,7 +12593,7 @@ 1 2 - 35811023 + 35811564 @@ -12579,17 +12609,17 @@ 1 2 - 21858004 + 21858334 2 3 - 5174275 + 5174353 3 91 - 1027802 + 1027818 @@ -12677,11 +12707,11 @@ macro_argument_unexpanded - 103252337 + 103253896 invocation - 31226086 + 31226557 argument_index @@ -12689,7 +12719,7 @@ text - 440266 + 440272 @@ -12703,22 +12733,22 @@ 1 2 - 9979461 + 9979611 2 3 - 12505068 + 12505256 3 4 - 6395516 + 6395613 4 67 - 2346040 + 2346075 @@ -12734,22 +12764,22 @@ 1 2 - 10213703 + 10213857 2 3 - 12526567 + 12526756 3 4 - 6195602 + 6195695 4 67 - 2290213 + 2290247 @@ -12817,32 +12847,32 @@ 1 2 - 52020 + 52021 2 3 - 79995 + 79996 3 4 - 29681 + 29682 4 5 - 44447 + 44448 5 6 - 50218 + 50219 6 9 - 36590 + 36591 9 @@ -12862,7 +12892,7 @@ 57 517 - 33244 + 33245 518 @@ -12883,12 +12913,12 @@ 1 2 - 311894 + 311898 2 3 - 115272 + 115273 3 @@ -12903,11 +12933,11 @@ macro_argument_expanded - 103252337 + 103253896 invocation - 31226086 + 31226557 argument_index @@ -12915,7 +12945,7 @@ text - 266687 + 266691 @@ -12929,22 +12959,22 @@ 1 2 - 9979461 + 9979611 2 3 - 12505068 + 12505256 3 4 - 6395516 + 6395613 4 67 - 2346040 + 2346075 @@ -12960,22 +12990,22 @@ 1 2 - 13763116 + 13763324 2 3 - 10789751 + 10789914 3 4 - 5403993 + 5404074 4 9 - 1269224 + 1269243 @@ -13043,17 +13073,17 @@ 1 2 - 28299 + 28300 2 3 - 35154 + 35155 3 4 - 58509 + 58510 4 @@ -13078,12 +13108,12 @@ 10 19 - 22948 + 22949 19 51 - 20076 + 20077 51 @@ -13109,12 +13139,12 @@ 1 2 - 134779 + 134781 2 3 - 114039 + 114040 3 @@ -14871,7 +14901,7 @@ constraint - 30948 + 30949 @@ -15010,7 +15040,7 @@ 1 2 - 30948 + 30949 @@ -15296,11 +15326,11 @@ var_decls - 6739203 + 6738800 id - 6734225 + 6733822 variable @@ -15330,7 +15360,7 @@ 1 2 - 6734225 + 6733822 @@ -15346,7 +15376,7 @@ 1 2 - 6729247 + 6728843 2 @@ -15367,7 +15397,7 @@ 1 2 - 6734225 + 6733822 @@ -15383,7 +15413,7 @@ 1 2 - 6734225 + 6733822 @@ -15399,12 +15429,12 @@ 1 2 - 6408486 + 6408890 2 4 - 157285 + 156882 @@ -15488,12 +15518,12 @@ 2 3 - 294120 + 294254 3 5 - 133201 + 133067 5 @@ -15646,7 +15676,7 @@ 28 - 6411 + 6408 27716 @@ -15780,7 +15810,7 @@ 4 - 2760 + 2757 194017 @@ -16018,19 +16048,19 @@ type_decls - 1890777 + 1890806 id - 1890777 + 1890806 type_id - 1849364 + 1849392 location - 1485517 + 1485539 @@ -16044,7 +16074,7 @@ 1 2 - 1890777 + 1890806 @@ -16060,7 +16090,7 @@ 1 2 - 1890777 + 1890806 @@ -16076,7 +16106,7 @@ 1 2 - 1819574 + 1819601 2 @@ -16097,7 +16127,7 @@ 1 2 - 1820902 + 1820929 2 @@ -16118,12 +16148,12 @@ 1 2 - 1408989 + 1409011 2 651 - 76527 + 76528 @@ -16139,12 +16169,12 @@ 1 2 - 1410331 + 1410352 2 651 - 75186 + 75187 @@ -16154,11 +16184,11 @@ type_def - 1297362 + 1297381 id - 1297362 + 1297381 @@ -16234,7 +16264,7 @@ 1 2 - 8186 + 8187 2 @@ -16615,19 +16645,19 @@ usings - 338568 + 338586 id - 338568 + 338586 element_id - 65337 + 65352 location - 33921 + 33922 kind @@ -16645,7 +16675,7 @@ 1 2 - 338568 + 338586 @@ -16661,7 +16691,7 @@ 1 2 - 338568 + 338586 @@ -16677,7 +16707,7 @@ 1 2 - 338568 + 338586 @@ -16693,7 +16723,7 @@ 1 2 - 55421 + 55435 2 @@ -16703,7 +16733,7 @@ 4 134 - 4307 + 4308 @@ -16719,7 +16749,7 @@ 1 2 - 55421 + 55435 2 @@ -16729,7 +16759,7 @@ 4 134 - 4307 + 4308 @@ -16745,7 +16775,7 @@ 1 2 - 65337 + 65352 @@ -16761,17 +16791,17 @@ 1 2 - 26809 + 26810 2 4 - 2858 + 2844 4 145 - 2465 + 2479 145 @@ -16792,17 +16822,17 @@ 1 2 - 26809 + 26810 2 4 - 2858 + 2844 4 145 - 2465 + 2479 145 @@ -16823,7 +16853,7 @@ 1 2 - 33921 + 33922 @@ -16842,8 +16872,8 @@ 13 - 24599 - 24600 + 24600 + 24601 13 @@ -16863,8 +16893,8 @@ 13 - 4609 - 4610 + 4610 + 4611 13 @@ -16896,7 +16926,7 @@ using_container - 732097 + 732121 parent @@ -16904,7 +16934,7 @@ child - 338568 + 338586 @@ -16918,17 +16948,17 @@ 1 2 - 12327 + 12328 2 4 - 2438 + 2424 4 6 - 1598 + 1612 6 @@ -16969,12 +16999,12 @@ 1 2 - 114174 + 114189 2 3 - 154260 + 154262 3 @@ -18206,15 +18236,15 @@ membervariables - 1444236 + 1444291 id - 1441778 + 1441833 type_id - 448006 + 448060 name @@ -18232,7 +18262,7 @@ 1 2 - 1439430 + 1439484 2 @@ -18253,7 +18283,7 @@ 1 2 - 1441778 + 1441833 @@ -18269,12 +18299,12 @@ 1 2 - 332222 + 332331 2 3 - 70944 + 70890 3 @@ -18283,7 +18313,7 @@ 10 - 4152 + 4153 9939 @@ -18300,12 +18330,12 @@ 1 2 - 348934 + 349043 2 3 - 63517 + 63462 3 @@ -18553,11 +18583,11 @@ localvariables - 735324 + 735322 id - 735324 + 735322 type_id @@ -18565,7 +18595,7 @@ name - 102827 + 102826 @@ -18579,7 +18609,7 @@ 1 2 - 735324 + 735322 @@ -18595,7 +18625,7 @@ 1 2 - 735324 + 735322 @@ -18616,7 +18646,7 @@ 2 3 - 7926 + 7925 3 @@ -18657,7 +18687,7 @@ 1 2 - 38831 + 38830 2 @@ -18688,7 +18718,7 @@ 1 2 - 63262 + 63261 2 @@ -21390,7 +21420,7 @@ decltypes - 175649 + 175650 id @@ -21711,15 +21741,15 @@ usertypes - 4987434 + 4987509 id - 4987434 + 4987509 name - 1074810 + 1074799 kind @@ -21737,7 +21767,7 @@ 1 2 - 4987434 + 4987509 @@ -21753,7 +21783,7 @@ 1 2 - 4987434 + 4987509 @@ -21769,22 +21799,22 @@ 1 2 - 743259 + 743244 2 3 - 196974 + 196950 3 7 - 85996 + 86025 7 30181 - 48579 + 48580 @@ -21800,12 +21830,12 @@ 1 2 - 1008457 + 1008445 2 10 - 66353 + 66354 @@ -21935,8 +21965,8 @@ 13 - 10829 - 10830 + 10827 + 10828 13 @@ -21957,11 +21987,11 @@ usertypesize - 1632137 + 1632161 id - 1632137 + 1632161 size @@ -21983,7 +22013,7 @@ 1 2 - 1632137 + 1632161 @@ -21999,7 +22029,7 @@ 1 2 - 1632137 + 1632161 @@ -22334,7 +22364,7 @@ constraint - 27881 + 27882 @@ -22399,15 +22429,15 @@ mangled_name - 7776179 + 7776283 id - 7776179 + 7776283 mangled_name - 5325040 + 5327221 is_complete @@ -22425,7 +22455,7 @@ 1 2 - 7776179 + 7776283 @@ -22441,7 +22471,7 @@ 1 2 - 7776179 + 7776283 @@ -22457,17 +22487,17 @@ 1 2 - 4731503 + 4733728 2 3 - 459353 + 459564 3 9032 - 134183 + 133928 @@ -22483,7 +22513,7 @@ 1 2 - 5325040 + 5327221 @@ -22497,13 +22527,13 @@ 12 - 5005 - 5006 + 4842 + 4843 13 - 570633 - 570634 + 570790 + 570791 13 @@ -22518,13 +22548,13 @@ 12 - 1518 - 1519 + 1515 + 1516 13 - 391559 - 391560 + 391717 + 391718 13 @@ -22546,48 +22576,48 @@ is_standard_layout_class - 1344858 + 1344878 id - 1344858 + 1344878 is_complete - 1611274 + 1611299 id - 1611274 + 1611299 is_class_template - 292183 + 292187 id - 292183 + 292187 class_instantiation - 1327030 + 1327050 to - 1323128 + 1323148 from - 91605 + 91606 @@ -22601,7 +22631,7 @@ 1 2 - 1320392 + 1320411 2 @@ -22672,11 +22702,11 @@ class_template_argument - 3501700 + 3501753 type_id - 1631215 + 1631240 index @@ -22684,7 +22714,7 @@ arg_type - 1034467 + 1034483 @@ -22698,22 +22728,22 @@ 1 2 - 678884 + 678894 2 3 - 490105 + 490113 3 4 - 308751 + 308755 4 7 - 124118 + 124120 7 @@ -22734,22 +22764,22 @@ 1 2 - 713442 + 713453 2 3 - 505454 + 505462 3 4 - 306813 + 306818 4 113 - 105504 + 105506 @@ -22857,22 +22887,22 @@ 1 2 - 649080 + 649090 2 3 - 212187 + 212190 3 4 - 62153 + 62154 4 11 - 78667 + 78669 11 @@ -22893,12 +22923,12 @@ 1 2 - 912381 + 912395 2 3 - 98852 + 98854 3 @@ -23139,15 +23169,15 @@ is_proxy_class_for - 62059 + 62060 id - 62059 + 62060 templ_param_id - 58631 + 58632 @@ -23161,7 +23191,7 @@ 1 2 - 62059 + 62060 @@ -23177,7 +23207,7 @@ 1 2 - 57710 + 57711 2 @@ -24710,12 +24740,12 @@ 1 2 - 6461 + 6462 2 4 - 717 + 718 4 @@ -24863,7 +24893,7 @@ 1 2 - 11609 + 11610 3 @@ -26066,11 +26096,11 @@ ptrtomembers - 12083 + 12084 id - 12083 + 12084 type_id @@ -26092,7 +26122,7 @@ 1 2 - 12083 + 12084 @@ -26108,7 +26138,7 @@ 1 2 - 12083 + 12084 @@ -26166,7 +26196,7 @@ 1 2 - 4876 + 4877 2 @@ -26197,7 +26227,7 @@ 1 2 - 4876 + 4877 2 @@ -26270,11 +26300,11 @@ typespecifiers - 991496 + 991511 type_id - 984912 + 984927 spec_id @@ -26292,7 +26322,7 @@ 1 2 - 978328 + 978343 2 @@ -26358,7 +26388,7 @@ funspecifiers - 9728427 + 9728384 func_id @@ -26385,12 +26415,12 @@ 2 3 - 677260 + 677303 3 4 - 1424206 + 1424163 4 @@ -26494,8 +26524,8 @@ 42 - 42407 - 42408 + 42406 + 42407 42 @@ -26516,11 +26546,11 @@ varspecifiers - 2898030 + 2898085 var_id - 2544999 + 2545054 spec_id @@ -26538,7 +26568,7 @@ 1 2 - 2191969 + 2192023 2 @@ -26587,8 +26617,8 @@ 54 - 32448 - 32449 + 32449 + 32450 54 @@ -27185,11 +27215,11 @@ attribute_args - 99123 + 98908 id - 99123 + 98908 kind @@ -27197,7 +27227,7 @@ attribute - 85332 + 85334 index @@ -27205,7 +27235,7 @@ location - 91943 + 91945 @@ -27219,7 +27249,7 @@ 1 2 - 99123 + 98908 @@ -27235,7 +27265,7 @@ 1 2 - 99123 + 98908 @@ -27251,7 +27281,7 @@ 1 2 - 99123 + 98908 @@ -27267,7 +27297,7 @@ 1 2 - 99123 + 98908 @@ -27296,8 +27326,8 @@ 13 - 6614 - 6615 + 6598 + 6599 13 @@ -27402,12 +27432,12 @@ 1 2 - 77177 + 77395 2 4 - 6800 + 6583 4 @@ -27428,7 +27458,7 @@ 1 2 - 83029 + 83031 2 @@ -27449,7 +27479,7 @@ 1 2 - 79047 + 79048 2 @@ -27470,7 +27500,7 @@ 1 2 - 80659 + 80660 2 @@ -27509,8 +27539,8 @@ 13 - 6497 - 6498 + 6481 + 6482 13 @@ -27625,12 +27655,12 @@ 1 2 - 89329 + 89547 2 23 - 2614 + 2397 @@ -27646,7 +27676,7 @@ 1 2 - 91727 + 91728 2 @@ -27667,7 +27697,7 @@ 1 2 - 91537 + 91538 2 @@ -27688,7 +27718,7 @@ 1 2 - 91388 + 91389 2 @@ -27859,15 +27889,15 @@ attribute_arg_constant - 89600 + 89384 arg - 89600 + 89384 constant - 89600 + 89384 @@ -27881,7 +27911,7 @@ 1 2 - 89600 + 89384 @@ -27897,7 +27927,7 @@ 1 2 - 89600 + 89384 @@ -28265,15 +28295,15 @@ unspecifiedtype - 8345603 + 8345729 type_id - 8345603 + 8345729 unspecified_type_id - 4799035 + 4799107 @@ -28287,7 +28317,7 @@ 1 2 - 8345603 + 8345729 @@ -28303,17 +28333,17 @@ 1 2 - 3198462 + 3198511 2 3 - 1309012 + 1309032 3 6271 - 291559 + 291564 @@ -29519,7 +29549,7 @@ decl_id - 98169 + 98040 location @@ -29718,12 +29748,12 @@ 1 2 - 60620 + 60362 2 3 - 7518 + 7647 3 @@ -29759,12 +29789,12 @@ 1 2 - 60620 + 60362 2 3 - 7518 + 7647 3 @@ -29800,7 +29830,7 @@ 1 2 - 97310 + 97181 2 @@ -29867,7 +29897,7 @@ 2 - 2132 + 2129 429 @@ -30125,11 +30155,11 @@ compgenerated - 10714334 + 10716063 id - 10714334 + 10716063 @@ -30441,7 +30471,7 @@ namespacembrs - 2025652 + 2025696 parentid @@ -30449,7 +30479,7 @@ memberid - 2025652 + 2025696 @@ -30539,7 +30569,7 @@ 1 2 - 2025652 + 2025696 @@ -32000,11 +32030,11 @@ valuetext - 6605626 + 6605580 id - 6605626 + 6605580 text @@ -32022,7 +32052,7 @@ 1 2 - 6605626 + 6605580 @@ -32116,11 +32146,11 @@ fieldoffsets - 1441778 + 1441833 id - 1441778 + 1441833 byteoffset @@ -32142,7 +32172,7 @@ 1 2 - 1441778 + 1441833 @@ -32158,7 +32188,7 @@ 1 2 - 1441778 + 1441833 @@ -32203,7 +32233,7 @@ 244 - 5638 + 5639 1092 @@ -32274,8 +32304,8 @@ 54 - 26131 - 26132 + 26132 + 26133 54 @@ -32317,11 +32347,11 @@ bitfield - 27375 + 27388 id - 27375 + 27388 bits @@ -32343,7 +32373,7 @@ 1 2 - 27375 + 27388 @@ -32359,7 +32389,7 @@ 1 2 - 27375 + 27388 @@ -32408,7 +32438,7 @@ 19 - 17 + 18 21 19 @@ -32419,7 +32449,7 @@ 36 - 78 + 79 19 @@ -32495,7 +32525,7 @@ 19 - 17 + 18 21 19 @@ -32506,7 +32536,7 @@ 36 - 78 + 79 19 @@ -33616,6 +33646,10 @@ position 32 + + is_designated + 2 + @@ -33771,6 +33805,27 @@ + + aggregate + is_designated + + + 12 + + + 1 + 2 + 1242986 + + + 2 + 3 + 82 + + + + + initializer aggregate @@ -33824,6 +33879,22 @@ + + initializer + is_designated + + + 12 + + + 1 + 2 + 5717202 + + + + + field aggregate @@ -33957,6 +34028,27 @@ + + field + is_designated + + + 12 + + + 1 + 2 + 3201 + + + 2 + 3 + 26 + + + + + position aggregate @@ -34170,6 +34262,111 @@ + + position + is_designated + + + 12 + + + 1 + 2 + 24 + + + 2 + 3 + 8 + + + + + + + is_designated + aggregate + + + 12 + + + 480 + 481 + 1 + + + 1242670 + 1242671 + 1 + + + + + + + is_designated + initializer + + + 12 + + + 710 + 711 + 1 + + + 5716492 + 5716493 + 1 + + + + + + + is_designated + field + + + 12 + + + 218 + 219 + 1 + + + 3035 + 3036 + 1 + + + + + + + is_designated + position + + + 12 + + + 8 + 9 + 1 + + + 32 + 33 + 1 + + + + + @@ -34192,6 +34389,10 @@ position 62922 + + is_designated + 2 + @@ -34347,6 +34548,22 @@ + + aggregate + is_designated + + + 12 + + + 1 + 2 + 152356 + + + + + initializer aggregate @@ -34395,6 +34612,22 @@ + + initializer + is_designated + + + 12 + + + 1 + 2 + 1349246 + + + + + element_index aggregate @@ -34498,6 +34731,27 @@ + + element_index + is_designated + + + 12 + + + 1 + 2 + 62914 + + + 2 + 3 + 8 + + + + + position aggregate @@ -34601,6 +34855,111 @@ + + position + is_designated + + + 12 + + + 1 + 2 + 62915 + + + 2 + 3 + 7 + + + + + + + is_designated + aggregate + + + 12 + + + 3 + 4 + 1 + + + 152353 + 152354 + 1 + + + + + + + is_designated + initializer + + + 12 + + + 16 + 17 + 1 + + + 1349230 + 1349231 + 1 + + + + + + + is_designated + element_index + + + 12 + + + 8 + 9 + 1 + + + 62922 + 62923 + 1 + + + + + + + is_designated + position + + + 12 + + + 7 + 8 + 1 + + + 62922 + 62923 + 1 + + + + + @@ -38063,22 +38422,22 @@ ishandler - 47475 + 47531 block - 47475 + 47531 stmt_decl_bind - 730761 + 730759 stmt - 690291 + 690289 num @@ -38086,7 +38445,7 @@ decl - 730692 + 730690 @@ -38100,7 +38459,7 @@ 1 2 - 668062 + 668061 2 @@ -38121,7 +38480,7 @@ 1 2 - 668062 + 668061 2 @@ -38186,7 +38545,7 @@ 5480 - 170178 + 170179 8 @@ -38247,7 +38606,7 @@ 5480 - 170161 + 170162 8 @@ -38264,7 +38623,7 @@ 1 2 - 730667 + 730666 2 @@ -38285,7 +38644,7 @@ 1 2 - 730692 + 730690 @@ -38295,11 +38654,11 @@ stmt_decl_entry_bind - 730761 + 730759 stmt - 690291 + 690289 num @@ -38307,7 +38666,7 @@ decl_entry - 730761 + 730759 @@ -38321,7 +38680,7 @@ 1 2 - 668062 + 668061 2 @@ -38342,7 +38701,7 @@ 1 2 - 668062 + 668061 2 @@ -38407,7 +38766,7 @@ 5480 - 170178 + 170179 8 @@ -38468,7 +38827,7 @@ 5480 - 170178 + 170179 8 @@ -38485,7 +38844,7 @@ 1 2 - 730761 + 730759 @@ -38501,7 +38860,7 @@ 1 2 - 730761 + 730759 @@ -39197,15 +39556,15 @@ includes - 408674 + 408680 id - 408674 + 408680 included - 75281 + 75282 @@ -39219,7 +39578,7 @@ 1 2 - 408674 + 408680 From ed2d06bcd7f37f4dc8fb14dc692a2c3b9b9a8201 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 17 Apr 2025 09:57:59 +0100 Subject: [PATCH 120/240] Rust: environment-source -> environment. --- rust/ql/lib/codeql/rust/Concepts.qll | 2 +- rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml | 8 ++++---- .../query-tests/security/CWE-020/RegexInjection.expected | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rust/ql/lib/codeql/rust/Concepts.qll b/rust/ql/lib/codeql/rust/Concepts.qll index 723cde6913a8..fb37cbac46ae 100644 --- a/rust/ql/lib/codeql/rust/Concepts.qll +++ b/rust/ql/lib/codeql/rust/Concepts.qll @@ -99,7 +99,7 @@ module EnvironmentSource { * An externally modeled source for data from the program's environment. */ class ModeledEnvironmentSource extends EnvironmentSource::Range { - ModeledEnvironmentSource() { sourceNode(this, "environment-source") } + ModeledEnvironmentSource() { sourceNode(this, "environment") } } /** diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml index 9e579c8c4dee..2906b0a064f0 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml @@ -8,7 +8,7 @@ extensions: - ["lang:std", "crate::env::current_dir", "ReturnValue.Field[crate::result::Result::Ok(0)]", "command-line-source", "manual"] - ["lang:std", "crate::env::current_exe", "ReturnValue.Field[crate::result::Result::Ok(0)]", "command-line-source", "manual"] - ["lang:std", "crate::env::home_dir", "ReturnValue.Field[crate::option::Option::Some(0)]", "command-line-source", "manual"] - - ["lang:std", "crate::env::var", "ReturnValue.Field[crate::result::Result::Ok(0)]", "environment-source", "manual"] - - ["lang:std", "crate::env::var_os", "ReturnValue.Field[crate::option::Option::Some(0)]", "environment-source", "manual"] - - ["lang:std", "crate::env::vars", "ReturnValue.Element", "environment-source", "manual"] - - ["lang:std", "crate::env::vars_os", "ReturnValue.Element", "environment-source", "manual"] + - ["lang:std", "crate::env::var", "ReturnValue.Field[crate::result::Result::Ok(0)]", "environment", "manual"] + - ["lang:std", "crate::env::var_os", "ReturnValue.Field[crate::option::Option::Some(0)]", "environment", "manual"] + - ["lang:std", "crate::env::vars", "ReturnValue.Element", "environment", "manual"] + - ["lang:std", "crate::env::vars_os", "ReturnValue.Element", "environment", "manual"] diff --git a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected index c86d5f444d67..01bcab8c1f80 100644 --- a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected @@ -13,7 +13,7 @@ edges | main.rs:5:25:5:44 | { ... } | main.rs:5:25:5:44 | ...::must_use(...) | provenance | MaD:4 | | main.rs:6:26:6:30 | regex | main.rs:6:25:6:30 | ®ex | provenance | | models -| 1 | Source: lang:std; crate::env::var; environment-source; ReturnValue.Field[crate::result::Result::Ok(0)] | +| 1 | Source: lang:std; crate::env::var; environment; ReturnValue.Field[crate::result::Result::Ok(0)] | | 2 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | | 3 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | | 4 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | From 43069f139d8ff66d140035de3da8bb7fa56db9f2 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 17 Apr 2025 10:05:07 +0100 Subject: [PATCH 121/240] Rust: command-line-source -> commandargs. --- rust/ql/lib/codeql/rust/Concepts.qll | 2 +- .../ql/lib/codeql/rust/frameworks/stdlib/env.model.yml | 10 +++++----- .../query-tests/security/CWE-089/SqlInjection.expected | 2 +- .../CWE-770/UncontrolledAllocationSize.expected | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rust/ql/lib/codeql/rust/Concepts.qll b/rust/ql/lib/codeql/rust/Concepts.qll index fb37cbac46ae..c2a8c08ca0ab 100644 --- a/rust/ql/lib/codeql/rust/Concepts.qll +++ b/rust/ql/lib/codeql/rust/Concepts.qll @@ -73,7 +73,7 @@ module CommandLineArgsSource { * An externally modeled source for command line arguments. */ class ModeledCommandLineArgsSource extends CommandLineArgsSource::Range { - ModeledCommandLineArgsSource() { sourceNode(this, "command-line-source") } + ModeledCommandLineArgsSource() { sourceNode(this, "commandargs") } } /** diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml index 2906b0a064f0..8ca01fdc4224 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml @@ -3,11 +3,11 @@ extensions: pack: codeql/rust-all extensible: sourceModel data: - - ["lang:std", "crate::env::args", "ReturnValue.Element", "command-line-source", "manual"] - - ["lang:std", "crate::env::args_os", "ReturnValue.Element", "command-line-source", "manual"] - - ["lang:std", "crate::env::current_dir", "ReturnValue.Field[crate::result::Result::Ok(0)]", "command-line-source", "manual"] - - ["lang:std", "crate::env::current_exe", "ReturnValue.Field[crate::result::Result::Ok(0)]", "command-line-source", "manual"] - - ["lang:std", "crate::env::home_dir", "ReturnValue.Field[crate::option::Option::Some(0)]", "command-line-source", "manual"] + - ["lang:std", "crate::env::args", "ReturnValue.Element", "commandargs", "manual"] + - ["lang:std", "crate::env::args_os", "ReturnValue.Element", "commandargs", "manual"] + - ["lang:std", "crate::env::current_dir", "ReturnValue.Field[crate::result::Result::Ok(0)]", "commandargs", "manual"] + - ["lang:std", "crate::env::current_exe", "ReturnValue.Field[crate::result::Result::Ok(0)]", "commandargs", "manual"] + - ["lang:std", "crate::env::home_dir", "ReturnValue.Field[crate::option::Option::Some(0)]", "commandargs", "manual"] - ["lang:std", "crate::env::var", "ReturnValue.Field[crate::result::Result::Ok(0)]", "environment", "manual"] - ["lang:std", "crate::env::var_os", "ReturnValue.Field[crate::option::Option::Some(0)]", "environment", "manual"] - ["lang:std", "crate::env::vars", "ReturnValue.Element", "environment", "manual"] diff --git a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected index f2b9d39fd162..fcc56a9c0776 100644 --- a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected @@ -51,7 +51,7 @@ edges | sqlx.rs:74:25:74:38 | unsafe_query_1 [&ref] | sqlx.rs:74:25:74:47 | unsafe_query_1.as_str() | provenance | MaD:3 | | sqlx.rs:76:29:76:42 | unsafe_query_2 [&ref] | sqlx.rs:76:29:76:51 | unsafe_query_2.as_str() | provenance | MaD:3 | models -| 1 | Source: lang:std; crate::env::args; command-line-source; ReturnValue.Element | +| 1 | Source: lang:std; crate::env::args; commandargs; ReturnValue.Element | | 2 | Source: repo:https://github.com/seanmonstar/reqwest:reqwest; crate::blocking::get; remote; ReturnValue.Field[crate::result::Result::Ok(0)] | | 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; taint | | 4 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 8fbaf7659394..0e9acca98d73 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -271,7 +271,7 @@ models | 13 | Sink: repo:https://github.com/rust-lang/libc:libc; ::calloc; alloc-size; Argument[0,1] | | 14 | Sink: repo:https://github.com/rust-lang/libc:libc; ::malloc; alloc-size; Argument[0] | | 15 | Sink: repo:https://github.com/rust-lang/libc:libc; ::realloc; alloc-size; Argument[1] | -| 16 | Source: lang:std; crate::env::args; command-line-source; ReturnValue.Element | +| 16 | Source: lang:std; crate::env::args; commandargs; ReturnValue.Element | | 17 | Summary: lang:core; ::align_to; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | | 18 | Summary: lang:core; ::array; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | | 19 | Summary: lang:core; ::extend; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | From 0bcee84117cbac52eb9dfbce063e4968a29a0191 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 17 Apr 2025 12:33:27 +0200 Subject: [PATCH 122/240] C++: Minor textual fixes --- .../upgrade.properties | 4 ++-- .../2025-04-15-field-array-designator.md | 2 +- cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll | 23 ++++++++----------- .../upgrade.properties | 4 ++-- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties index b7e78b39ee7a..42981491b823 100644 --- a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties @@ -1,4 +1,4 @@ -description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +description: add `hasDesignator` predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` compatibility: backwards aggregate_array_init.rel: run aggregate_array_init.qlo -aggregate_field_init.rel: run aggregate_field_init.qlo \ No newline at end of file +aggregate_field_init.rel: run aggregate_field_init.qlo diff --git a/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md index 8b4911abd44d..c621bb499e33 100644 --- a/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md +++ b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md @@ -1,4 +1,4 @@ --- category: feature --- -* Introduced `isDesignatorInit()` predicates to distinguish between designator-based and positional initializations for both struct/union fields and array elements. \ No newline at end of file +* Introduced `hasDesignator()` predicates to distinguish between designated and positional initializations for both struct/union fields and array elements. \ No newline at end of file diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll index fb79988c10f1..31e2b5135b42 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll @@ -218,20 +218,17 @@ class ClassAggregateLiteral extends AggregateLiteral { /** * Holds if the `position`-th initialization of `field` in this aggregate initializer - * uses a designator (e.g., `.x =`, `[42] =`) rather than a positional initializer. + * uses a designated (e.g., `.x = ...`) rather than a positional initializer. * - * This can be used to distinguish explicitly designated initializations from - * implicit positional ones. - * - * For example, in the initializer: + * For example, in: * ```c * struct S { int x, y; }; * struct S s = { .x = 1, 2 }; * ``` - * - `.x = 1` is a designator init, therefore `isDesignatorInit(x, 0)` holds. - * - `2` is a positional init for `.y`, therefore `isDesignatorInit(y, 1)` does **not** hold. + * - `.x = 1` is a designated initializer, therefore `hasDesignator(x, 0)` holds. + * - `2` is a positional initializer for `s.y`, therefore `hasDesignator(y, 1)` does not hold. */ - predicate isDesignatorInit(Field field, int position) { + predicate hasDesignator(Field field, int position) { field = classType.getAField() and aggregate_field_init(underlyingElement(this), _, unresolveElement(field), position, true) } @@ -330,17 +327,17 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral { /** * Holds if the `position`-th initialization of the array element at `elementIndex` - * in this aggregate initializer uses a designator (e.g., `[0] = ...`) rather than - * an implicit positional initializer. + * in this aggregate initializer uses a designated (e.g., `[0] = ...`) rather than + * a positional initializer. * * For example, in: * ```c * int x[] = { [0] = 1, 2 }; * ``` - * - `[0] = 1` is a designator init, therefore `isDesignatorInit(0, 0)` holds. - * - `2` is a positional init for `x[1]`, therefore `isDesignatorInit(1, 1)` does **not** hold. + * - `[0] = 1` is a designated initializer, therefore `hasDesignator(0, 0)` holds. + * - `2` is a positional initializer for `x[1]`, therefore `hasDesignator(1, 1)` does not hold. */ - predicate isDesignatorInit(int elementIndex, int position) { + predicate hasDesignator(int elementIndex, int position) { aggregate_array_init(underlyingElement(this), _, elementIndex, position, true) } diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties index b7e78b39ee7a..42981491b823 100644 --- a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties @@ -1,4 +1,4 @@ -description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +description: add `hasDesignator` predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` compatibility: backwards aggregate_array_init.rel: run aggregate_array_init.qlo -aggregate_field_init.rel: run aggregate_field_init.qlo \ No newline at end of file +aggregate_field_init.rel: run aggregate_field_init.qlo From 7f5b48d485e1dac0948b6c0aaae91572faaf97f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nora=20Dimitrijevi=C4=87?= Date: Wed, 16 Apr 2025 15:25:23 +0200 Subject: [PATCH 123/240] C#: Fix join order in ExternalFlow::interpretElement/6 (only affects RTJO mode) --- .../lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll index ccc0a333b9e7..87b28b76e99a 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll @@ -408,7 +408,8 @@ Declaration interpretBaseDeclaration(string namespace, string type, string name, ) } -pragma[inline] +bindingset[d, ext] +pragma[inline_late] private Declaration interpretExt(Declaration d, ExtPath ext) { ext = "" and result = d or From 3d48b234287c73144f09a0de26bf66a50b9ebcea Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 19:33:35 +0100 Subject: [PATCH 124/240] C++: Instantiate model generation library. --- .../modelgenerator/internal/CaptureModels.qll | 388 ++++++++++++++++++ 1 file changed, 388 insertions(+) create mode 100644 cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll new file mode 100644 index 000000000000..6439cd467492 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -0,0 +1,388 @@ +/** + * Provides predicates related to capturing summary models of the Standard or a 3rd party library. + */ + +private import cpp +private import semmle.code.cpp.dataflow.new.DataFlow +private import semmle.code.cpp.ir.IR +private import semmle.code.cpp.dataflow.ExternalFlow as ExternalFlow +private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplCommon as DataFlowImplCommon +private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplSpecific +private import semmle.code.cpp.ir.dataflow.internal.DataFlowPrivate as DataFlowPrivate +private import semmle.code.cpp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl +private import semmle.code.cpp.ir.dataflow.internal.TaintTrackingImplSpecific +private import semmle.code.cpp.dataflow.new.TaintTracking +private import codeql.mad.modelgenerator.internal.ModelGeneratorImpl + +module ModelGeneratorInput implements ModelGeneratorInputSig { + class Type = DataFlowPrivate::DataFlowType; + + // Note: This also includes `this` + class Parameter = DataFlow::ParameterNode; + + class Callable = Declaration; + + class NodeExtended extends DataFlow::Node { + Callable getAsExprEnclosingCallable() { result = this.asExpr().getEnclosingDeclaration() } + } + + Parameter asParameter(NodeExtended n) { result = n } + + Callable getEnclosingCallable(NodeExtended n) { + result = n.getEnclosingCallable().asSourceCallable() + } + + Callable getAsExprEnclosingCallable(NodeExtended n) { + result = n.asExpr().getEnclosingDeclaration() + } + + private predicate hasManualSummaryModel(Callable api) { + api = any(FlowSummaryImpl::Public::SummarizedCallable sc | sc.applyManualModel()) or + api = any(FlowSummaryImpl::Public::NeutralSummaryCallable sc | sc.hasManualModel()) + } + + private predicate hasManualSourceModel(Callable api) { + api = any(FlowSummaryImpl::Public::NeutralSourceCallable sc | sc.hasManualModel()) + } + + private predicate hasManualSinkModel(Callable api) { + api = any(FlowSummaryImpl::Public::NeutralSinkCallable sc | sc.hasManualModel()) + } + + private predicate relevant(Callable api) { api.fromSource() } + + class SummaryTargetApi extends Callable { + private Callable lift; + + SummaryTargetApi() { + lift = this and + not hasManualSummaryModel(lift) + } + + Callable lift() { result = lift } + + predicate isRelevant() { + relevant(this) and + not hasManualSummaryModel(this) + } + } + + class SourceOrSinkTargetApi extends Callable { + SourceOrSinkTargetApi() { relevant(this) } + } + + class SinkTargetApi extends SourceOrSinkTargetApi { + SinkTargetApi() { not hasManualSinkModel(this) } + } + + class SourceTargetApi extends SourceOrSinkTargetApi { + SourceTargetApi() { not hasManualSourceModel(this) } + } + + class InstanceParameterNode extends DataFlow::ParameterNode { + InstanceParameterNode() { + DataFlowPrivate::nodeHasInstruction(this, + any(InitializeParameterInstruction i | i.hasIndex(-1)), 1) + } + } + + /** + * Holds if the summary generated for `c` should also apply to overrides + * of `c`. + */ + private string isExtensible(Callable c) { + if c instanceof MemberFunction then result = "true" else result = "false" + } + + /** + * Gets the string representing the list of template parameters declared + * by `template`. + * + * `template` must either be: + * - An uninstantiated template, or + * - A declaration that is not from a template instantiation. + */ + private string templateParams(Declaration template) { + exists(string params | + params = + concat(int i | + | + template.getTemplateArgument(i).(TypeTemplateParameter).getName(), "," order by i + ) + | + if params = "" then result = "" else result = "<" + params + ">" + ) + } + + /** + * Gets the string representing the list of parameters declared + * by `functionTemplate`. + * + * `functionTemplate` must either be: + * - An uninstantiated template, or + * - A declaration that is not from a template instantiation. + */ + private string params(Function functionTemplate) { + exists(string params | + params = + concat(int i | + | + ExternalFlow::getParameterTypeWithoutTemplateArguments(functionTemplate, i, true), "," + order by + i + ) + | + if params = "" then result = "()" else result = "(" + params + ")" + ) + } + + /** + * Holds if the callable `c` is: + * - In the namespace represented by `namespace`, and + * - Has a declaring type represented by `type`, and + * - Has the name `name`, and + * - Has a list of parameters represented by `params` + * + * This is the predicate that computes the columns that it put into the MaD + * row for `callable`. + */ + private predicate qualifiedName( + Callable callable, string namespace, string type, string name, string params + ) { + exists( + Function functionTemplate, string typeWithoutTemplateArgs, string nameWithoutTemplateArgs + | + functionTemplate = ExternalFlow::getFullyTemplatedFunction(callable) and + functionTemplate.hasQualifiedName(namespace, typeWithoutTemplateArgs, nameWithoutTemplateArgs) and + nameWithoutTemplateArgs = functionTemplate.getName() and + name = nameWithoutTemplateArgs + templateParams(functionTemplate) and + params = params(functionTemplate) + | + exists(Class classTemplate | + classTemplate = functionTemplate.getDeclaringType() and + type = typeWithoutTemplateArgs + templateParams(classTemplate) + ) + or + not exists(functionTemplate.getDeclaringType()) and + type = "" + ) + } + + predicate isRelevantType(Type t) { any() } + + Type getUnderlyingContentType(DataFlow::ContentSet c) { + result = c.(DataFlow::FieldContent).getField().getUnspecifiedType() or + result = c.(DataFlow::UnionContent).getUnion().getUnspecifiedType() + } + + string qualifierString() { result = "Argument[-1]" } + + private predicate parameterContentAccessImpl(Parameter p, string argument) { + exists(int indirectionIndex, int argumentIndex, DataFlowPrivate::Position pos | + p.isSourceParameterOf(_, pos) and + pos.getArgumentIndex() = argumentIndex and + argumentIndex != -1 and // handled elsewhere + pos.getIndirectionIndex() = indirectionIndex + | + indirectionIndex = 0 and + argument = "Argument[" + argumentIndex + "]" + or + indirectionIndex > 0 and + argument = "Argument[" + DataFlow::repeatStars(indirectionIndex) + argumentIndex + "]" + ) + } + + string parameterAccess(Parameter p) { parameterContentAccessImpl(p, result) } + + string parameterContentAccess(Parameter p) { parameterContentAccessImpl(p, result) } + + bindingset[c] + string paramReturnNodeAsOutput(Callable c, DataFlowPrivate::Position pos) { + exists(Parameter p | + p.isSourceParameterOf(c, pos) and + result = parameterAccess(p) + ) + or + pos.getArgumentIndex() = -1 and + result = qualifierString() and + pos.getIndirectionIndex() = 1 + } + + bindingset[c] + string paramReturnNodeAsContentOutput(Callable c, DataFlowPrivate::ParameterPosition pos) { + result = paramReturnNodeAsOutput(c, pos) + } + + pragma[nomagic] + Callable returnNodeEnclosingCallable(DataFlow::Node ret) { + result = DataFlowImplCommon::getNodeEnclosingCallable(ret).asSourceCallable() + } + + /** Holds if this instance access is to an enclosing instance of type `t`. */ + pragma[nomagic] + private predicate isEnclosingInstanceAccess(DataFlowPrivate::ReturnNode n, Class t) { + n.getKind().isIndirectReturn(-1) and + t = n.getType().stripType() and + t != n.getEnclosingCallable().asSourceCallable().(Function).getDeclaringType() + } + + pragma[nomagic] + predicate isOwnInstanceAccessNode(DataFlowPrivate::ReturnNode node) { + node.getKind().isIndirectReturn(-1) and + not isEnclosingInstanceAccess(node, _) + } + + predicate sinkModelSanitizer(DataFlow::Node node) { none() } + + predicate apiSource(DataFlow::Node source) { + DataFlowPrivate::nodeHasOperand(source, any(DataFlow::FieldAddress fa), 1) + or + source instanceof DataFlow::ParameterNode + } + + string getInputArgument(DataFlow::Node source) { + exists(DataFlowPrivate::Position pos, int argumentIndex, int indirectionIndex | + source.(DataFlow::ParameterNode).isParameterOf(_, pos) and + argumentIndex = pos.getArgumentIndex() and + indirectionIndex = pos.getIndirectionIndex() and + result = "Argument[" + DataFlow::repeatStars(indirectionIndex) + argumentIndex + "]" + ) + or + DataFlowPrivate::nodeHasOperand(source, any(DataFlow::FieldAddress fa), 1) and + result = qualifierString() + } + + string getReturnValueString(DataFlowPrivate::ReturnKind k) { + k.isNormalReturn() and + exists(int indirectionIndex | indirectionIndex = k.getIndirectionIndex() | + indirectionIndex = 0 and + result = "ReturnValue" + or + indirectionIndex > 0 and + result = "ReturnValue[" + DataFlow::repeatStars(indirectionIndex) + "]" + ) + } + + predicate irrelevantSourceSinkApi(Callable source, SourceTargetApi api) { none() } + + bindingset[kind] + predicate isRelevantSourceKind(string kind) { any() } + + bindingset[kind] + predicate isRelevantSinkKind(string kind) { any() } + + predicate containerContent(DataFlow::ContentSet cs) { cs instanceof DataFlow::ElementContent } + + predicate isAdditionalContentFlowStep(DataFlow::Node node1, DataFlow::Node node2) { + TaintTracking::defaultAdditionalTaintStep(node1, node2, _) and + not exists(DataFlow::Content f | + DataFlowPrivate::readStep(node1, f, node2) and containerContent(f) + ) + } + + predicate isField(DataFlow::ContentSet cs) { + exists(DataFlow::Content c | cs.isSingleton(c) | + c instanceof DataFlow::FieldContent or + c instanceof DataFlow::UnionContent + ) + } + + predicate isCallback(DataFlow::ContentSet c) { none() } + + string getSyntheticName(DataFlow::ContentSet c) { + exists(Field f | + not f.isPublic() and + f = c.(DataFlow::FieldContent).getField() and + result = f.getName() + ) + } + + string printContent(DataFlow::ContentSet c) { + exists(int indirectionIndex, string name, string kind | + exists(DataFlow::UnionContent uc | + c.isSingleton(uc) and + name = uc.getUnion().getName() and + indirectionIndex = uc.getIndirectionIndex() and + // Note: We don't actually support the union string in MaD, but we should do that eventually + kind = "Union[" + ) + or + exists(DataFlow::FieldContent fc | + c.isSingleton(fc) and + name = fc.getField().getName() and + indirectionIndex = fc.getIndirectionIndex() and + kind = "Field[" + ) + | + result = kind + DataFlow::repeatStars(indirectionIndex) + name + "]" + ) + or + exists(DataFlow::ElementContent ec | + c.isSingleton(ec) and + result = "Element[" + ec.getIndirectionIndex() + "]" + ) + } + + /** + * Holds if `f` is a "private" function. + * + * A "private" function does not contribute any models as it is assumed + * to be an implementation detail of some other "public" function for which + * we will generate a summary. + */ + private predicate isPrivate(Function f) { + f.getNamespace().getParentNamespace*().isAnonymous() + or + f.(MemberFunction).isPrivate() + or + f.isStatic() + } + + predicate isUninterestingForDataFlowModels(Callable api) { + // Note: This also makes all global/static-local variables + // uninteresting (which is good!) + not api.(Function).hasDefinition() + or + isPrivate(api) + or + api instanceof Destructor + or + api = any(LambdaExpression lambda).getLambdaFunction() + or + api.isFromUninstantiatedTemplate(_) + } + + predicate isUninterestingForHeuristicDataFlowModels(Callable api) { + isUninterestingForDataFlowModels(api) + } + + string partialModelRow(Callable api, int i) { + i = 0 and qualifiedName(api, result, _, _, _) // namespace + or + i = 1 and qualifiedName(api, _, result, _, _) // type + or + i = 2 and result = isExtensible(api) // extensible + or + i = 3 and qualifiedName(api, _, _, result, _) // name + or + i = 4 and qualifiedName(api, _, _, _, result) // parameters + or + i = 5 and result = "" and exists(api) // ext + } + + string partialNeutralModelRow(Callable api, int i) { + i = 0 and qualifiedName(api, result, _, _, _) // namespace + or + i = 1 and qualifiedName(api, _, result, _, _) // type + or + i = 2 and qualifiedName(api, _, _, result, _) // name + or + i = 3 and qualifiedName(api, _, _, _, result) // parameters + } + + predicate sourceNode = ExternalFlow::sourceNode/2; + + predicate sinkNode = ExternalFlow::sinkNode/2; +} + +import MakeModelGenerator From f241e4b53740be97a5fd5977bacf5ed41a0e415e Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 19:34:09 +0100 Subject: [PATCH 125/240] C++: Add tests that will soon succeed. --- .../modelgenerator/dataflow/summaries.cpp | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp new file mode 100644 index 000000000000..3f4018128590 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp @@ -0,0 +1,130 @@ +using size_t = decltype(sizeof(int)); + +size_t strlen(const char* str); +char* strcpy(char* dest, const char* src); + +namespace Models { + struct BasicFlow { + int* tainted; + + //No model as destructors are excluded from model generation. + ~BasicFlow() = default; + + //summary=Models;BasicFlow;true;returnThis;(int *);;Argument[-1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnThis;(int *);;Argument[-1];ReturnValue[*];value;dfc-generated + BasicFlow* returnThis(int* input) { + return this; + } + + //summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[0];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[*0];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[0];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[*0];ReturnValue[*];value;dfc-generated + int* returnParam0(int* input0, int* input1) { + return input0; + } + + //summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[1];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[*1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[1];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[*1];ReturnValue[*];value;dfc-generated + int* returnParam1(int* input0, int* input1) { + return input1; + } + + //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[1];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*1];ReturnValue[*];taint;df-generated + //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[2];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*2];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[1];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*1];ReturnValue[*];value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[2];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*2];ReturnValue[*];value;dfc-generated + int* returnParamMultiple(bool b, int* input0, int* input1) { + return b ? input0 : input1; + } + + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];Argument[*1];taint;df-generated + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];ReturnValue[*];taint;df-generated + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];ReturnValue[*];taint;df-generated + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[1];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];Argument[*1];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];Argument[*1];taint;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];ReturnValue[*];taint;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];ReturnValue[*];value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[1];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];Argument[*1];value;dfc-generated + char* returnSubstring(const char* source, char* dest) { + return strcpy(dest, source + 1); + } + + //summary=Models;BasicFlow;true;setField;(int *);;Argument[0];Argument[-1];taint;df-generated + //summary=Models;BasicFlow;true;setField;(int *);;Argument[*0];Argument[-1];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;setField;(int *);;Argument[0];Argument[-1].Field[*tainted];value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;setField;(int *);;Argument[*0];Argument[-1].Field[**tainted];value;dfc-generated + void setField(int* s) { + tainted = s; + } + + //summary=Models;BasicFlow;true;returnField;();;Argument[-1];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnField;();;Argument[-1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnField;();;Argument[-1].Field[*tainted];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnField;();;Argument[-1].Field[**tainted];ReturnValue[*];value;dfc-generated + int* returnField() { + return tainted; + } + }; + + template + struct TemplatedFlow { + T tainted; + + //summary=Models;TemplatedFlow;true;template_returnThis;(T);;Argument[-1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;template_returnThis;(T);;Argument[-1];ReturnValue[*];value;dfc-generated + TemplatedFlow* template_returnThis(T input) { + return this; + } + + //summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[0];ReturnValue;taint;df-generated + //summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[*0];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[0];ReturnValue;value;dfc-generated + //contentbased-summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[*0];ReturnValue[*];value;dfc-generated + T* template_returnParam0(T* input0, T* input1) { + return input0; + } + + //summary=Models;TemplatedFlow;true;template_setField;(T);;Argument[0];Argument[-1];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;template_setField;(T);;Argument[0];Argument[-1].Field[*tainted];value;dfc-generated + void template_setField(T s) { + tainted = s; + } + + //summary=Models;TemplatedFlow;true;template_returnField;();;Argument[-1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;template_returnField;();;Argument[-1].Field[*tainted];ReturnValue[*];value;dfc-generated + T& template_returnField() { + return tainted; + } + + //summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[0];ReturnValue;taint;df-generated + //summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[*0];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[0];ReturnValue;value;dfc-generated + //contentbased-summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[*0];ReturnValue[*];value;dfc-generated + template + U* templated_function(U* u, T* t) { + return u; + } + }; + + void test_templated_flow() { + // Ensure that we have an instantiation of the templated class + TemplatedFlow intFlow; + intFlow.template_returnThis(0); + + intFlow.template_returnParam0(nullptr, nullptr); + + intFlow.template_setField(0); + intFlow.template_returnField(); + + intFlow.templated_function(nullptr, nullptr); + } +} \ No newline at end of file From 09ebd6e87dcf8f9f66f96b8854247f814d1d1be0 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 19:34:57 +0100 Subject: [PATCH 126/240] C++: Instantiate inline expectation test framework to test model generation. --- cpp/ql/lib/utils/test/InlineMadTest.qll | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 cpp/ql/lib/utils/test/InlineMadTest.qll diff --git a/cpp/ql/lib/utils/test/InlineMadTest.qll b/cpp/ql/lib/utils/test/InlineMadTest.qll new file mode 100644 index 000000000000..599dfec7d86a --- /dev/null +++ b/cpp/ql/lib/utils/test/InlineMadTest.qll @@ -0,0 +1,34 @@ +private import cpp +private import codeql.mad.test.InlineMadTest + +class MadRelevantFunction extends Function { + MadRelevantFunction() { not this.isFromUninstantiatedTemplate(_) } +} + +private module InlineMadTestLang implements InlineMadTestLangSig { + class Callable = MadRelevantFunction; + + /** + * Holds if `c` is the closest `Callable` that suceeds `comment` in the file. + */ + private predicate hasClosestCallable(CppStyleComment comment, Callable c) { + c = + min(Callable cand, int dist | + // This has no good join order, but should hopefully be good enough for tests. + cand.getFile() = comment.getFile() and + dist = cand.getLocation().getStartLine() - comment.getLocation().getStartLine() and + dist > 0 + | + cand order by dist + ) + } + + string getComment(Callable c) { + exists(CppStyleComment comment | + hasClosestCallable(comment, c) and + result = comment.getContents().suffix(2) + ) + } +} + +import InlineMadTestImpl From 1465058da0610015f43b4f9cd37bf9b0ac628a3a Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 19:36:36 +0100 Subject: [PATCH 127/240] C++: Add copy-pasted files from C#. --- .../modelgenerator/CaptureContentSummaryModels.ql | 13 +++++++++++++ .../modelgenerator/CaptureMixedNeutralModels.ql | 13 +++++++++++++ .../modelgenerator/CaptureMixedSummaryModels.ql | 13 +++++++++++++ .../utils/modelgenerator/CaptureNeutralModels.ql | 13 +++++++++++++ .../src/utils/modelgenerator/CaptureSinkModels.ql | 13 +++++++++++++ .../utils/modelgenerator/CaptureSourceModels.ql | 13 +++++++++++++ .../utils/modelgenerator/CaptureSummaryModels.ql | 13 +++++++++++++ .../src/utils/modelgenerator/GenerateFlowModel.py | 15 +++++++++++++++ .../internal/CaptureModelsPrinting.qll | 13 +++++++++++++ .../dataflow/CaptureContentSummaryModels.expected | 2 ++ .../dataflow/CaptureContentSummaryModels.ext.yml | 6 ++++++ .../dataflow/CaptureContentSummaryModels.ql | 11 +++++++++++ .../dataflow/CaptureSummaryModels.expected | 2 ++ .../dataflow/CaptureSummaryModels.ext.yml | 6 ++++++ .../dataflow/CaptureSummaryModels.ql | 11 +++++++++++ 15 files changed, 157 insertions(+) create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/GenerateFlowModel.py create mode 100644 cpp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.expected create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ext.yml create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql diff --git a/cpp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql new file mode 100644 index 000000000000..8dc0c3d7f6b1 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture content based summary models. + * @description Finds applicable content based summary models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/contentbased-summary-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string flow +where flow = ContentSensitive::captureFlow(api, _) +select flow order by flow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql new file mode 100644 index 000000000000..d03fa1b6030d --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture mixed neutral models. + * @description Finds neutral models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/mixed-neutral-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string noflow +where noflow = captureMixedNeutral(api) +select noflow order by noflow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql new file mode 100644 index 000000000000..dc289a07ab12 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture mixed summary models. + * @description Finds applicable summary models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/mixed-summary-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string flow +where flow = captureMixedFlow(api, _) +select flow order by flow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql new file mode 100644 index 000000000000..8a244cabe869 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture neutral models. + * @description Finds neutral models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/neutral-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string noflow +where noflow = captureNoFlow(api) +select noflow order by noflow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql new file mode 100644 index 000000000000..8cbcac192a27 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture sink models. + * @description Finds public methods that act as sinks as they flow into a known sink. + * @kind diagnostic + * @id cpp/utils/modelgenerator/sink-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSinkTargetApi api, string sink +where sink = captureSink(api) +select sink order by sink diff --git a/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql new file mode 100644 index 000000000000..b4614634ce6a --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture source models. + * @description Finds APIs that act as sources as they expose already known sources. + * @kind diagnostic + * @id cpp/utils/modelgenerator/source-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSourceTargetApi api, string source +where source = captureSource(api) +select source order by source diff --git a/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql new file mode 100644 index 000000000000..ba6921351725 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture summary models. + * @description Finds applicable summary models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/summary-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string flow +where flow = captureFlow(api) +select flow order by flow diff --git a/cpp/ql/src/utils/modelgenerator/GenerateFlowModel.py b/cpp/ql/src/utils/modelgenerator/GenerateFlowModel.py new file mode 100644 index 000000000000..38bbaad118bd --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/GenerateFlowModel.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +import sys +import os.path +import subprocess + +# Add Model as Data script directory to sys.path. +gitroot = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode("utf-8").strip() +madpath = os.path.join(gitroot, "misc/scripts/models-as-data/") +sys.path.append(madpath) + +import generate_flow_model as model + +language = "cpp" +model.Generator.make(language).run() diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll new file mode 100644 index 000000000000..7841f8ed1a44 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll @@ -0,0 +1,13 @@ +private import cpp as Cpp +private import codeql.mad.modelgenerator.internal.ModelPrinting +private import CaptureModels::ModelGeneratorInput as ModelGeneratorInput + +private module ModelPrintingLang implements ModelPrintingLangSig { + class Callable = Cpp::Declaration; + + predicate partialModelRow = ModelGeneratorInput::partialModelRow/2; + + predicate partialNeutralModelRow = ModelGeneratorInput::partialNeutralModelRow/2; +} + +import ModelPrintingImpl diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.expected b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.expected new file mode 100644 index 000000000000..cb6fc390349c --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.expected @@ -0,0 +1,2 @@ +unexpectedModel +expectedModel diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ext.yml b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ext.yml new file mode 100644 index 000000000000..10a8a069808c --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ext.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/cpp-all + extensible: summaryModel + data: + - [ "models", "ManuallyModelled", False, "hasSummary", "(void *)", "", "Argument[0]", "ReturnValue", "value", "manual"] diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql new file mode 100644 index 000000000000..22f1ba66b529 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql @@ -0,0 +1,11 @@ +import cpp +import utils.modelgenerator.internal.CaptureModels +import utils.test.InlineMadTest + +module InlineMadTestConfig implements InlineMadTestConfigSig { + string getCapturedModel(MadRelevantFunction c) { result = ContentSensitive::captureFlow(c, _) } + + string getKind() { result = "contentbased-summary" } +} + +import InlineMadTest diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected new file mode 100644 index 000000000000..cb6fc390349c --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected @@ -0,0 +1,2 @@ +unexpectedModel +expectedModel diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml new file mode 100644 index 000000000000..44d895bc7e01 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/cpp-all + extensible: summaryModel + data: + - [ "Models", "ManuallyModelled", False, "hasSummary", "(void *)", "", "Argument[0]", "ReturnValue", "value", "manual"] diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql new file mode 100644 index 000000000000..630acc295b3d --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql @@ -0,0 +1,11 @@ +import cpp +import utils.modelgenerator.internal.CaptureModels +import utils.test.InlineMadTest + +module InlineMadTestConfig implements InlineMadTestConfigSig { + string getCapturedModel(MadRelevantFunction c) { result = captureFlow(c) } + + string getKind() { result = "summary" } +} + +import InlineMadTest From 1f43e51be426caeb850bc80e4554bbb880f15e28 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 20:01:31 +0100 Subject: [PATCH 128/240] C++: Fix ql-for-ql findings. --- cpp/ql/lib/utils/test/InlineMadTest.qll | 2 +- cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/ql/lib/utils/test/InlineMadTest.qll b/cpp/ql/lib/utils/test/InlineMadTest.qll index 599dfec7d86a..4fbfa793fff0 100644 --- a/cpp/ql/lib/utils/test/InlineMadTest.qll +++ b/cpp/ql/lib/utils/test/InlineMadTest.qll @@ -9,7 +9,7 @@ private module InlineMadTestLang implements InlineMadTestLangSig { class Callable = MadRelevantFunction; /** - * Holds if `c` is the closest `Callable` that suceeds `comment` in the file. + * Holds if `c` is the closest `Callable` that succeeds `comment` in the file. */ private predicate hasClosestCallable(CppStyleComment comment, Callable c) { c = diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 6439cd467492..d33786b2b30c 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -3,7 +3,6 @@ */ private import cpp -private import semmle.code.cpp.dataflow.new.DataFlow private import semmle.code.cpp.ir.IR private import semmle.code.cpp.dataflow.ExternalFlow as ExternalFlow private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplCommon as DataFlowImplCommon From 5462dcdf75ffe214c3e5d20c617e80b861156c1d Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 14 Apr 2025 18:02:47 +0100 Subject: [PATCH 129/240] C++: Make final member functions not extensible. --- .../src/utils/modelgenerator/internal/CaptureModels.qll | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index d33786b2b30c..c8ddaf465e7f 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -85,12 +85,18 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Mon, 14 Apr 2025 18:03:13 +0100 Subject: [PATCH 130/240] Remove an unnecessary if. --- cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index c8ddaf465e7f..501da3f1d88c 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -135,9 +135,8 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Fri, 18 Apr 2025 15:55:28 +0100 Subject: [PATCH 131/240] C++: Add another entry to 'qlpack' for external models. --- cpp/ql/lib/qlpack.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index faa1d6c3d6a0..cc728434ef24 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -16,6 +16,7 @@ dependencies: codeql/xml: ${workspace} dataExtensions: - ext/*.model.yml + - ext/generated/*.model.yml - ext/deallocation/*.model.yml - ext/allocation/*.model.yml warnOnImplicitThis: true From e55f94c364febba8712e34cd2c4b3c362f3ad175 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 18 Apr 2025 16:08:07 +0100 Subject: [PATCH 132/240] C++: Move contents of 'isUninterestingForDataFlowModels' to 'relevant' --- .../modelgenerator/internal/CaptureModels.qll | 72 +++++++++++-------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 501da3f1d88c..ed2f1a322030 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -35,6 +35,9 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Fri, 18 Apr 2025 16:08:39 +0100 Subject: [PATCH 133/240] C++: Also make protected members irrelevant. --- cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index ed2f1a322030..e6bbfe1e5c9a 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -58,7 +58,7 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Fri, 18 Apr 2025 16:14:22 +0100 Subject: [PATCH 134/240] C++: Add more tests. --- .../modelgenerator/dataflow/summaries.cpp | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp index 3f4018128590..d72d417e49f5 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp @@ -127,4 +127,57 @@ namespace Models { intFlow.templated_function(nullptr, nullptr); } -} \ No newline at end of file +} + +//summary=;;true;toplevel_function;(int *);;Argument[0];ReturnValue;taint;df-generated +//summary=;;true;toplevel_function;(int *);;Argument[*0];ReturnValue;taint;df-generated +//contentbased-summary=;;true;toplevel_function;(int *);;Argument[0];ReturnValue;taint;dfc-generated +//contentbased-summary=;;true;toplevel_function;(int *);;Argument[*0];ReturnValue;value;dfc-generated +int toplevel_function(int* p) { + return *p; +} + +//No model as static functions are excluded from model generation. +static int static_toplevel_function(int* p) { + return *p; +} + +struct NonFinalStruct { + //summary=;NonFinalStruct;true;public_not_final_member_function;(int);;Argument[0];ReturnValue;taint;df-generated + //contentbased-summary=;NonFinalStruct;true;public_not_final_member_function;(int);;Argument[0];ReturnValue;value;dfc-generated + virtual int public_not_final_member_function(int x) { + return x; + } + + //summary=;NonFinalStruct;false;public_final_member_function;(int);;Argument[0];ReturnValue;taint;df-generated + //contentbased-summary=;NonFinalStruct;false;public_final_member_function;(int);;Argument[0];ReturnValue;value;dfc-generated + virtual int public_final_member_function(int x) final { + return x; + } + +private: + //No model as private members are excluded from model generation. + int private_member_function(int x) { + return x; + } + +protected: + //No model as protected members are excluded from model generation. + int protected_member_function(int x) { + return x; + } +}; + +struct FinalStruct final { + //summary=;FinalStruct;false;public_not_final_member_function_2;(int);;Argument[0];ReturnValue;taint;df-generated + //contentbased-summary=;FinalStruct;false;public_not_final_member_function_2;(int);;Argument[0];ReturnValue;value;dfc-generated + virtual int public_not_final_member_function_2(int x) { + return x; + } + + //summary=;FinalStruct;false;public_final_member_function_2;(int);;Argument[0];ReturnValue;taint;df-generated + //contentbased-summary=;FinalStruct;false;public_final_member_function_2;(int);;Argument[0];ReturnValue;value;dfc-generated + virtual int public_final_member_function_2(int x) final { + return x; + } +}; \ No newline at end of file From 3fd760c6325212ed234d1a64787684da1f22394c Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 18 Apr 2025 16:42:01 +0100 Subject: [PATCH 135/240] C++: Move 'InlineMadTest.qll' out of 'lib/utils/test' and into 'test' since C++ has no external packs depending on MaD testing. --- .../modelgenerator/dataflow/CaptureContentSummaryModels.ql | 2 +- .../dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql | 2 +- .../modelgenerator/dataflow/InlineModelsAsDataTest.qll} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename cpp/ql/{lib/utils/test/InlineMadTest.qll => test/library-tests/dataflow/modelgenerator/dataflow/InlineModelsAsDataTest.qll} (100%) diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql index 22f1ba66b529..0156eaaeb988 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql @@ -1,6 +1,6 @@ import cpp import utils.modelgenerator.internal.CaptureModels -import utils.test.InlineMadTest +import InlineModelsAsDataTest module InlineMadTestConfig implements InlineMadTestConfigSig { string getCapturedModel(MadRelevantFunction c) { result = ContentSensitive::captureFlow(c, _) } diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql index 630acc295b3d..65ec6060e87b 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql @@ -1,6 +1,6 @@ import cpp import utils.modelgenerator.internal.CaptureModels -import utils.test.InlineMadTest +import InlineModelsAsDataTest module InlineMadTestConfig implements InlineMadTestConfigSig { string getCapturedModel(MadRelevantFunction c) { result = captureFlow(c) } diff --git a/cpp/ql/lib/utils/test/InlineMadTest.qll b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/InlineModelsAsDataTest.qll similarity index 100% rename from cpp/ql/lib/utils/test/InlineMadTest.qll rename to cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/InlineModelsAsDataTest.qll From 2b9160526a7bccc904f5108a10a302aefbc4a119 Mon Sep 17 00:00:00 2001 From: Jami <57204504+jcogs33@users.noreply.github.com> Date: Sun, 20 Apr 2025 21:47:25 -0400 Subject: [PATCH 136/240] Apply docs review suggestion Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> --- .../Undesirable Calls/DoNotCallFinalize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index d6fd5cf76bd4..385cbfb5cfe2 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -1,6 +1,6 @@ ## Overview -Triggering garbage collection by directly calling `finalize()` may either have no effect or may trigger unnecessary garbage collection, leading to erratic behavior, performance issues, or deadlock. +Triggering garbage collection by directly calling `finalize()` may either have no effect or trigger unnecessary garbage collection, leading to erratic behavior, performance issues, or deadlock. ## Recommendation From 07a694e804af154191de208820a9d41a70ec66cf Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Mon, 21 Apr 2025 09:52:52 -0400 Subject: [PATCH 137/240] Java: add new query to java-code-quality.qls.expected --- .../java/query-suite/java-code-quality.qls.expected | 1 + 1 file changed, 1 insertion(+) diff --git a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected index 2cff4a3eaa62..835e2bd3ee99 100644 --- a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected +++ b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected @@ -5,6 +5,7 @@ ql/java/ql/src/Likely Bugs/Comparison/IncomparableEquals.ql ql/java/ql/src/Likely Bugs/Comparison/InconsistentEqualsHashCode.ql ql/java/ql/src/Likely Bugs/Comparison/MissingInstanceofInEquals.ql ql/java/ql/src/Likely Bugs/Comparison/RefEqBoxed.ql +ql/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql ql/java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql From 3aa6b49204d2acd38ba026de88afa9b202f91ee5 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Mon, 21 Apr 2025 10:02:08 -0400 Subject: [PATCH 138/240] Java: Add new query to java-code-quality.qls.expected --- .../java/query-suite/java-code-quality.qls.expected | 1 + 1 file changed, 1 insertion(+) diff --git a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected index 2cff4a3eaa62..bdd51d7eee69 100644 --- a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected +++ b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected @@ -10,3 +10,4 @@ ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql ql/java/ql/src/Likely Bugs/Resource Leaks/CloseWriter.ql ql/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql +ql/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql From ce5c48192ea33e167784deb132b1564fb20c05c6 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 10:41:12 +0200 Subject: [PATCH 139/240] Swift: Make file checking in tests more strict With Swift 6.1 the extractor will start to extract files outside of the test directory. These files and their elements we do not want to see in our tests. --- swift/ql/test/TestUtils.qll | 3 ++- swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql | 2 +- swift/ql/test/library-tests/elements/decl/function/function.ql | 2 +- .../library-tests/elements/type/nominaltype/nominaltype.ql | 2 +- .../library-tests/elements/type/nominaltype/nominaltypedecl.ql | 2 +- .../library-tests/elements/type/numerictype/numerictype.ql | 2 +- .../library-tests/elements/type/pointertypes/pointertypes.ql | 2 +- swift/ql/test/query-tests/Diagnostics/Info.ql | 1 + 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/swift/ql/test/TestUtils.qll b/swift/ql/test/TestUtils.qll index f1f47eda8087..9b5429f8ba92 100644 --- a/swift/ql/test/TestUtils.qll +++ b/swift/ql/test/TestUtils.qll @@ -6,7 +6,8 @@ import codeql.swift.elements.expr.internal.DotSyntaxCallExpr cached predicate toBeTested(Element e) { - e instanceof File + e instanceof File and + (exists(e.(File).getRelativePath()) or e instanceof UnknownFile) or e instanceof ParameterizedProtocolType or diff --git a/swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql b/swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql index dba88e6009d3..5e4c0c6035f2 100644 --- a/swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql +++ b/swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql @@ -21,5 +21,5 @@ string describe(Decl d) { } from Decl d -where d.getLocation().getFile().getName() != "" +where exists(d.getLocation().getFile().getRelativePath()) select d, strictconcat(describe(d), ", ") diff --git a/swift/ql/test/library-tests/elements/decl/function/function.ql b/swift/ql/test/library-tests/elements/decl/function/function.ql index 9468929d1942..fbd47a20f4bc 100644 --- a/swift/ql/test/library-tests/elements/decl/function/function.ql +++ b/swift/ql/test/library-tests/elements/decl/function/function.ql @@ -27,6 +27,6 @@ string describe(Function f) { from Function f where - not f.getFile() instanceof UnknownFile and + exists(f.getFile().getRelativePath()) and not f.getName().matches("%init%") select f, concat(describe(f), ", ") diff --git a/swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.ql b/swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.ql index 713e471d15fb..68a0184cdcdd 100644 --- a/swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.ql +++ b/swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.ql @@ -16,7 +16,7 @@ string describe(Type t) { from VarDecl v, Type t where - v.getLocation().getFile().getBaseName() != "" and + exists(v.getLocation().getFile().getRelativePath()) and not v.getName() = "self" and t = v.getType() select v, t.toString(), concat(describe(t), ", ") diff --git a/swift/ql/test/library-tests/elements/type/nominaltype/nominaltypedecl.ql b/swift/ql/test/library-tests/elements/type/nominaltype/nominaltypedecl.ql index 83fb434a7f7b..cec74fbf3927 100644 --- a/swift/ql/test/library-tests/elements/type/nominaltype/nominaltypedecl.ql +++ b/swift/ql/test/library-tests/elements/type/nominaltype/nominaltypedecl.ql @@ -14,7 +14,7 @@ string describe(TypeDecl td) { from VarDecl v, TypeDecl td where - v.getLocation().getFile().getBaseName() != "" and + exists(v.getLocation().getFile().getRelativePath()) and not v.getName() = "self" and ( td = v.getType().(NominalType).getDeclaration() or diff --git a/swift/ql/test/library-tests/elements/type/numerictype/numerictype.ql b/swift/ql/test/library-tests/elements/type/numerictype/numerictype.ql index 7f3fb4591f84..73f11673a5f5 100644 --- a/swift/ql/test/library-tests/elements/type/numerictype/numerictype.ql +++ b/swift/ql/test/library-tests/elements/type/numerictype/numerictype.ql @@ -14,6 +14,6 @@ string describe(Type t) { from VarDecl v, Type t where - v.getLocation().getFile().getBaseName() != "" and + exists(v.getLocation().getFile().getRelativePath()) and t = v.getType() select v, t.toString(), concat(describe(t), ", ") diff --git a/swift/ql/test/library-tests/elements/type/pointertypes/pointertypes.ql b/swift/ql/test/library-tests/elements/type/pointertypes/pointertypes.ql index fe0157fa6c74..9232b24167cc 100644 --- a/swift/ql/test/library-tests/elements/type/pointertypes/pointertypes.ql +++ b/swift/ql/test/library-tests/elements/type/pointertypes/pointertypes.ql @@ -22,6 +22,6 @@ string describe(Type t) { from VarDecl v, Type t where - v.getLocation().getFile().getBaseName() != "" and + exists(v.getLocation().getFile().getRelativePath()) and t = v.getType() select v, t.toString(), strictconcat(describe(t), ", ") diff --git a/swift/ql/test/query-tests/Diagnostics/Info.ql b/swift/ql/test/query-tests/Diagnostics/Info.ql index 765ee15c737c..dd7e316c8777 100644 --- a/swift/ql/test/query-tests/Diagnostics/Info.ql +++ b/swift/ql/test/query-tests/Diagnostics/Info.ql @@ -3,4 +3,5 @@ import swift string describe(File f) { (f.isSuccessfullyExtracted() and result = "isSuccessfullyExtracted") } from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f, concat(f.getRelativePath(), ", "), concat(describe(f), ", ") From ae5ac11387e33f2fa6f2744b7922574f5e067e29 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 22 Apr 2025 12:15:22 +0200 Subject: [PATCH 140/240] Shared: Fix join in `FileSystem.qll` Before ``` Evaluated relational algebra for predicate FileSystem::Folder::Append::appendStep/3#bed54f6d@d2a7eeoa on iteration 2 running pipeline standard with tuple counts: 120 ~2% {4} r1 = SCAN `FileSystem::Folder::Append::appendStep/3#bed54f6d#prev_delta` OUTPUT In.1, In.0, In.2, In.3 0 ~0% {6} r2 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs#1` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Lhs.1, Lhs.2, Lhs.3, _ {6} | REWRITE WITH Tmp.5 := 1, Out.5 := (InOut.1 - Tmp.5), TEST Out.5 = InOut.3 0 ~0% {4} | SCAN OUTPUT In.2, In.0, In.1, In.4 91 ~3% {6} r3 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Lhs.1, Lhs.2, Lhs.3, _ {6} | REWRITE WITH Tmp.5 := 1, Out.5 := (InOut.1 - Tmp.5), TEST Out.5 = InOut.3 81 ~0% {4} | SCAN OUTPUT In.4, In.0, In.1, In.2 81 ~3% {4} | JOIN WITH containerparent_10#join_rhs ON FIRST 1 OUTPUT Lhs.3, Lhs.1, Lhs.2, Rhs.1 269 ~0% {7} r4 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs#2` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Rhs.2, Lhs.1, Lhs.2, Lhs.3, _ {7} | REWRITE WITH Tmp.6 := 1, Out.6 := (InOut.1 - Tmp.6), TEST Out.6 = InOut.4 39 ~1% {5} | SCAN OUTPUT In.5, In.0, In.1, In.2, In.3 1295 ~0% {6} | JOIN WITH containerparent ON FIRST 1 OUTPUT Rhs.1, Lhs.3, _, Lhs.1, Lhs.2, Lhs.4 1295 ~0% {6} | REWRITE WITH Out.2 := 1 34 ~1% {4} | JOIN WITH `cached_FileSystem::Container.splitAbsolutePath/2#dispred#dc97b0cc` ON FIRST 3 OUTPUT Lhs.5, Lhs.3, Lhs.4, Lhs.0 115 ~0% {4} r5 = r2 UNION r3 UNION r4 115 ~0% {4} | AND NOT `FileSystem::Folder::Append::appendStep/3#bed54f6d#prev`(FIRST 4) return r5 ``` After ``` Evaluated relational algebra for predicate FileSystem::Folder::Append::appendStep/3#bed54f6d@4fb6e6v7 on iteration 2 running pipeline standard with tuple counts: 120 ~0% {4} r1 = SCAN `FileSystem::Folder::Append::appendStep/3#bed54f6d#prev_delta` OUTPUT In.1, In.0, In.2, In.3 0 ~0% {6} r2 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs#1` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Lhs.1, Lhs.2, Lhs.3, _ {6} | REWRITE WITH Tmp.5 := 1, Out.5 := (InOut.1 - Tmp.5), TEST Out.5 = InOut.3 0 ~0% {4} | SCAN OUTPUT In.2, In.0, In.1, In.4 91 ~0% {6} r3 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Lhs.1, Lhs.2, Lhs.3, _ {6} | REWRITE WITH Tmp.5 := 1, Out.5 := (InOut.1 - Tmp.5), TEST Out.5 = InOut.3 81 ~0% {4} | SCAN OUTPUT In.4, In.0, In.1, In.2 81 ~5% {4} | JOIN WITH containerparent_10#join_rhs ON FIRST 1 OUTPUT Lhs.3, Lhs.1, Lhs.2, Rhs.1 269 ~0% {7} r4 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs#2` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Rhs.2, Lhs.1, Lhs.2, Lhs.3, _ {7} | REWRITE WITH Tmp.6 := 1, Out.6 := (InOut.1 - Tmp.6), TEST Out.6 = InOut.4 39 ~3% {5} | SCAN OUTPUT In.5, In.2, In.0, In.1, In.3 34 ~0% {4} | JOIN WITH `FileSystem::Folder::Append::getAChildContainer/2#2e91feca` ON FIRST 2 OUTPUT Lhs.4, Lhs.2, Lhs.3, Rhs.2 115 ~2% {4} r5 = r2 UNION r3 UNION r4 115 ~2% {4} | AND NOT `FileSystem::Folder::Append::appendStep/3#bed54f6d#prev`(FIRST 4) return r5 ``` --- shared/util/codeql/util/FileSystem.qll | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/shared/util/codeql/util/FileSystem.qll b/shared/util/codeql/util/FileSystem.qll index ea58db929c51..8eb372e0c24a 100644 --- a/shared/util/codeql/util/FileSystem.qll +++ b/shared/util/codeql/util/FileSystem.qll @@ -239,6 +239,12 @@ module Make { result = 0 } + pragma[nomagic] + private Container getAChildContainer(Container c, string baseName) { + result = c.getAChildContainer() and + baseName = result.getBaseName() + } + pragma[nomagic] private Container appendStep(Folder f, string relativePath, int i) { i = -1 and @@ -253,10 +259,7 @@ module Make { else if comp = "." then result = mid - else ( - result = mid.getAChildContainer() and - result.getBaseName() = comp - ) + else result = getAChildContainer(mid, comp) ) } From a211998bc9b3940ac922d9f554c09515b3bdd8ff Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 13:52:15 +0200 Subject: [PATCH 141/240] Swift: Make file checking in integration tests more strict With Swift 6.1 the extractor will start to extract files outside of the test directory. These files and their elements we do not want to see in our tests. --- .../autobuilder/xcode-fails-spm-works/Files.ql | 1 + swift/ql/integration-tests/osx/canonical-case/Files.ql | 1 + swift/ql/integration-tests/osx/hello-ios/Files.ql | 1 + swift/ql/integration-tests/osx/hello-xcode/Files.ql | 1 + swift/ql/integration-tests/posix/cross-references/Classes.ql | 4 +++- .../posix/cross-references/Deinitializers.ql | 4 +++- swift/ql/integration-tests/posix/cross-references/Enums.ql | 4 +++- .../ql/integration-tests/posix/cross-references/Functions.ql | 4 +++- .../integration-tests/posix/cross-references/Initializers.ql | 4 +++- .../ql/integration-tests/posix/cross-references/Protocols.ql | 4 +++- swift/ql/integration-tests/posix/cross-references/Structs.ql | 4 +++- swift/ql/integration-tests/posix/cross-references/VarDecls.ql | 4 +++- .../ql/integration-tests/posix/frontend-invocations/Files.ql | 1 + swift/ql/integration-tests/posix/hello-world/test.ql | 1 + swift/ql/integration-tests/posix/symlinks/Files.ql | 1 + 15 files changed, 31 insertions(+), 8 deletions(-) diff --git a/swift/ql/integration-tests/autobuilder/xcode-fails-spm-works/Files.ql b/swift/ql/integration-tests/autobuilder/xcode-fails-spm-works/Files.ql index 9782ea4ce0bd..0ef878215647 100644 --- a/swift/ql/integration-tests/autobuilder/xcode-fails-spm-works/Files.ql +++ b/swift/ql/integration-tests/autobuilder/xcode-fails-spm-works/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/osx/canonical-case/Files.ql b/swift/ql/integration-tests/osx/canonical-case/Files.ql index 9782ea4ce0bd..0ef878215647 100644 --- a/swift/ql/integration-tests/osx/canonical-case/Files.ql +++ b/swift/ql/integration-tests/osx/canonical-case/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/osx/hello-ios/Files.ql b/swift/ql/integration-tests/osx/hello-ios/Files.ql index 9782ea4ce0bd..0ef878215647 100644 --- a/swift/ql/integration-tests/osx/hello-ios/Files.ql +++ b/swift/ql/integration-tests/osx/hello-ios/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/osx/hello-xcode/Files.ql b/swift/ql/integration-tests/osx/hello-xcode/Files.ql index 9782ea4ce0bd..0ef878215647 100644 --- a/swift/ql/integration-tests/osx/hello-xcode/Files.ql +++ b/swift/ql/integration-tests/osx/hello-xcode/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/posix/cross-references/Classes.ql b/swift/ql/integration-tests/posix/cross-references/Classes.ql index dbdbcb723b99..d3c0d759de6b 100644 --- a/swift/ql/integration-tests/posix/cross-references/Classes.ql +++ b/swift/ql/integration-tests/posix/cross-references/Classes.ql @@ -1,5 +1,7 @@ import swift from ClassDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Deinitializers.ql b/swift/ql/integration-tests/posix/cross-references/Deinitializers.ql index b92919487182..9180f63667f8 100644 --- a/swift/ql/integration-tests/posix/cross-references/Deinitializers.ql +++ b/swift/ql/integration-tests/posix/cross-references/Deinitializers.ql @@ -1,5 +1,7 @@ import swift from Deinitializer d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Enums.ql b/swift/ql/integration-tests/posix/cross-references/Enums.ql index 5417ec05610e..ebfcaafa0ef7 100644 --- a/swift/ql/integration-tests/posix/cross-references/Enums.ql +++ b/swift/ql/integration-tests/posix/cross-references/Enums.ql @@ -1,5 +1,7 @@ import swift from EnumDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Functions.ql b/swift/ql/integration-tests/posix/cross-references/Functions.ql index d166c2a51ecf..50b9393d9530 100644 --- a/swift/ql/integration-tests/posix/cross-references/Functions.ql +++ b/swift/ql/integration-tests/posix/cross-references/Functions.ql @@ -1,5 +1,7 @@ import codeql.swift.elements.decl.internal.AccessorOrNamedFunction from AccessorOrNamedFunction f -where f.getLocation().getFile().getBaseName() != "Package.swift" +where + f.getLocation().getFile().getBaseName() != "Package.swift" and + exists(f.getLocation().getFile().getRelativePath()) select f diff --git a/swift/ql/integration-tests/posix/cross-references/Initializers.ql b/swift/ql/integration-tests/posix/cross-references/Initializers.ql index 743988464177..c9b5a4e136b4 100644 --- a/swift/ql/integration-tests/posix/cross-references/Initializers.ql +++ b/swift/ql/integration-tests/posix/cross-references/Initializers.ql @@ -1,5 +1,7 @@ import swift from Initializer d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Protocols.ql b/swift/ql/integration-tests/posix/cross-references/Protocols.ql index 521dfeee7053..cde35a03d5f7 100644 --- a/swift/ql/integration-tests/posix/cross-references/Protocols.ql +++ b/swift/ql/integration-tests/posix/cross-references/Protocols.ql @@ -1,5 +1,7 @@ import swift from ProtocolDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Structs.ql b/swift/ql/integration-tests/posix/cross-references/Structs.ql index d746e92752ed..6b8dd3556bdb 100644 --- a/swift/ql/integration-tests/posix/cross-references/Structs.ql +++ b/swift/ql/integration-tests/posix/cross-references/Structs.ql @@ -1,5 +1,7 @@ import swift from StructDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/VarDecls.ql b/swift/ql/integration-tests/posix/cross-references/VarDecls.ql index 9d227acd4722..cdaa7d588981 100644 --- a/swift/ql/integration-tests/posix/cross-references/VarDecls.ql +++ b/swift/ql/integration-tests/posix/cross-references/VarDecls.ql @@ -1,5 +1,7 @@ import swift from VarDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/frontend-invocations/Files.ql b/swift/ql/integration-tests/posix/frontend-invocations/Files.ql index 9782ea4ce0bd..0ef878215647 100644 --- a/swift/ql/integration-tests/posix/frontend-invocations/Files.ql +++ b/swift/ql/integration-tests/posix/frontend-invocations/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/posix/hello-world/test.ql b/swift/ql/integration-tests/posix/hello-world/test.ql index 9782ea4ce0bd..0ef878215647 100644 --- a/swift/ql/integration-tests/posix/hello-world/test.ql +++ b/swift/ql/integration-tests/posix/hello-world/test.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/posix/symlinks/Files.ql b/swift/ql/integration-tests/posix/symlinks/Files.ql index 9782ea4ce0bd..0ef878215647 100644 --- a/swift/ql/integration-tests/posix/symlinks/Files.ql +++ b/swift/ql/integration-tests/posix/symlinks/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f From 40390d1adacda812a1a3f87b2a5fc727c4c1d8c1 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 22 Apr 2025 15:08:39 +0200 Subject: [PATCH 142/240] Address review comment --- ql/ql/src/codeql_ql/ast/Yaml.qll | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ql/ql/src/codeql_ql/ast/Yaml.qll b/ql/ql/src/codeql_ql/ast/Yaml.qll index 403640c1f841..e88f2a0c2aab 100644 --- a/ql/ql/src/codeql_ql/ast/Yaml.qll +++ b/ql/ql/src/codeql_ql/ast/Yaml.qll @@ -88,6 +88,16 @@ class QlPackDocument extends YamlDocument { } } +/** + * Holds if `qlref` is a `.qlref` YAML document referencing a query + * at relative path `relativePath`, and `f` is a candidate folder + * in which to lookup the referenced query. + * + * `f` is either: + * - the root of the QL pack containing `qlref`, + * - the root of a QL pack that is a dependency of the QL pack containing `qlref`, or + * - the folder containing `qlref`. + */ private predicate shouldAppend(QlRefDocument qlref, Folder f, string relativePath) { relativePath = qlref.getRelativeQueryPath() and ( From adb58e304d3267c98895e7688510cb10c122a481 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 16:51:36 +0200 Subject: [PATCH 143/240] Swift: Make file checking in tests more strict With Swift 6.1 the extractor will start to extract files outside of the test directory. These files and their elements we do not want to see in our tests. Test forgotten in https://github.com/github/codeql/pull/19344 --- swift/ql/test/library-tests/elements/location/location.ql | 1 + 1 file changed, 1 insertion(+) diff --git a/swift/ql/test/library-tests/elements/location/location.ql b/swift/ql/test/library-tests/elements/location/location.ql index 1d0b80f6bc10..0bb91d5748a5 100644 --- a/swift/ql/test/library-tests/elements/location/location.ql +++ b/swift/ql/test/library-tests/elements/location/location.ql @@ -1,4 +1,5 @@ import swift from Location l +where exists(l.getFile().getRelativePath()) or l instanceof UnknownLocation select l From 1cf10d8f9fb9d1fb04e0ad367f350ad1a5e884f8 Mon Sep 17 00:00:00 2001 From: Jon Janego Date: Tue, 22 Apr 2025 14:51:11 -0500 Subject: [PATCH 144/240] changedocs from 2.21.1 release --- .../codeql-changelog/codeql-cli-2.21.1.rst | 141 ++++++++++++++++++ .../codeql-changelog/index.rst | 1 + 2 files changed, 142 insertions(+) create mode 100644 docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst diff --git a/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst new file mode 100644 index 000000000000..1c28523b18f6 --- /dev/null +++ b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst @@ -0,0 +1,141 @@ +.. _codeql-cli-2.21.1: + +========================== +CodeQL 2.21.1 (2025-04-22) +========================== + +.. contents:: Contents + :depth: 2 + :local: + :backlinks: none + +This is an overview of changes in the CodeQL CLI and relevant CodeQL query and library packs. For additional updates on changes to the CodeQL code scanning experience, check out the `code scanning section on the GitHub blog `__, `relevant GitHub Changelog updates `__, `changes in the CodeQL extension for Visual Studio Code `__, and the `CodeQL Action changelog `__. + +Security Coverage +----------------- + +CodeQL 2.21.1 runs a total of 452 security queries when configured with the Default suite (covering 168 CWE). The Extended suite enables an additional 136 queries (covering 35 more CWE). + +CodeQL CLI +---------- + +Bug Fixes +~~~~~~~~~ + +* Fixed a bug in CodeQL analysis for GitHub Actions in the presence of a code scanning configuration file containing :code:`paths-ignore` exclusion patterns but not :code:`paths` inclusion patterns. + Previously, such a configuration incorrectly led to all YAML, HTML, + JSON, and JS source files being extracted, + except for those filtered by :code:`paths-ignore`. + This in turn led to performance issues on large codebases. + Now, only workflow and Action metadata YAML files relevant to the GitHub Actions analysis will be extracted, + except for those filtered by :code:`paths-ignore`. + This matches the default behavior when no configuration file is provided. + The handling of :code:`paths` inclusion patterns is unchanged: + if provided, only those paths will be considered, + except for those filtered by :code:`paths-ignore`. + +Query Packs +----------- + +Bug Fixes +~~~~~~~~~ + +JavaScript/TypeScript +""""""""""""""""""""" + +* Fixed a bug that would prevent extraction of :code:`tsconfig.json` files when it contained an array literal with a trailing comma. + +GitHub Actions +"""""""""""""" + +* Alerts produced by the query :code:`actions/missing-workflow-permissions` now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file. + +Major Analysis Improvements +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Ruby +"""" + +* The query :code:`rb/useless-assignment-to-local` now comes with query help and has been tweaked to produce fewer false positives. +* The query :code:`rb/uninitialized-local-variable` now only produces alerts when the variable is the receiver of a method call and should produce very few false positives. It also now comes with a help file. + +Minor Analysis Improvements +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +C# +"" + +* Enums and :code:`System.DateTimeOffset` are now treated as *simple* types, which means that they are considered to have a sanitizing effect. This impacts many queries, among others the :code:`cs/log-forging` query. +* The MaD models for the .NET 9 Runtime have been re-generated after a fix related to :code:`out`\ /\ :code:`ref` parameters. + +JavaScript/TypeScript +""""""""""""""""""""" + +* Data passed to the `Response `__ constructor is now treated as a sink for :code:`js/reflected-xss`. +* Slightly improved detection of DOM element references, leading to XSS results being detected in more cases. + +Python +"""""" + +* The :code:`py/mixed-tuple-returns` query no longer flags instances where the tuple is passed into the function as an argument, as this led to too many false positives. + +Language Libraries +------------------ + +Minor Analysis Improvements +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +C# +"" + +* The *alignment* and *format* clauses in string interpolation expressions are now extracted. That is, in :code:`$"Hello {name,align:format}"` *name*, *align* and *format* are extracted as children of the string interpolation *insert* :code:`{name,align:format}`. +* Blazor support can now better recognize when a property being set is specified with a string literal, rather than referenced in a :code:`nameof` expression. + +Golang +"""""" + +* Local source models for APIs reading from databases have been added for :code:`github.com/gogf/gf/database/gdb` and :code:`github.com/uptrace/bun`. + +Java/Kotlin +""""""""""" + +* Enum-typed values are now assumed to be safe by most queries. This means that queries may return fewer results where an enum value is used in a sensitive context, e.g. pasted into a query string. +* All existing modelling and support for :code:`javax.persistence` now applies to :code:`jakarta.persistence` as well. + +JavaScript/TypeScript +""""""""""""""""""""" + +* Data passed to the `NextResponse `__ constructor is now treated as a sink for :code:`js/reflected-xss`. +* Data received from `NextRequest `__ and `Request `__ is now treated as a remote user input :code:`source`. +* Added support for the :code:`make-dir` package. +* Added support for the :code:`open` package. +* Added taint propagation for :code:`Uint8Array`, :code:`ArrayBuffer`, :code:`SharedArrayBuffer` and :code:`TextDecoder.decode()`. +* Improved detection of :code:`WebSocket` and :code:`SockJS` usage. +* Added data received from :code:`WebSocket` clients as a remote flow source. +* Added support for additional :code:`mkdirp` methods as sinks in path-injection queries. +* Added support for additional :code:`rimraf` methods as sinks in path-injection queries. + +Ruby +"""" + +* Calls to :code:`super` without explict arguments now have their implicit arguments generated. For example, in :code:`def foo(x, y) { super } end` the call to :code:`super` becomes :code:`super(x, y)`. + +New Features +~~~~~~~~~~~~ + +C/C++ +""""" + +* Calling conventions explicitly specified on function declarations (:code:`__cdecl`, :code:`__stdcall`, :code:`__fastcall`, etc.) are now represented as specifiers of those declarations. +* A new class :code:`CallingConventionSpecifier` extending the :code:`Specifier` class was introduced, which represents explicitly specified calling conventions. + +Shared Libraries +---------------- + +Deprecated APIs +~~~~~~~~~~~~~~~ + +Static Single Assignment (SSA) +"""""""""""""""""""""""""""""" + +* All references to the :code:`DefinitionExt` and :code:`PhiReadNode` classes in the SSA library have been deprecated. The concept of phi-read nodes is now strictly an internal implementation detail. Their sole use-case is to improve the structure of the use-use flow relation for data flow, and this use-case remains supported by the :code:`DataFlowIntegration` module. diff --git a/docs/codeql/codeql-overview/codeql-changelog/index.rst b/docs/codeql/codeql-overview/codeql-changelog/index.rst index 08c8502ad1ad..137185c94db2 100644 --- a/docs/codeql/codeql-overview/codeql-changelog/index.rst +++ b/docs/codeql/codeql-overview/codeql-changelog/index.rst @@ -11,6 +11,7 @@ A list of queries for each suite and language `is available here Date: Wed, 23 Apr 2025 10:24:17 +0100 Subject: [PATCH 145/240] C++: Add an empty model to prevent a warning. --- cpp/ql/lib/ext/generated/empty.model.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cpp/ql/lib/ext/generated/empty.model.yml diff --git a/cpp/ql/lib/ext/generated/empty.model.yml b/cpp/ql/lib/ext/generated/empty.model.yml new file mode 100644 index 000000000000..078a8618ee3b --- /dev/null +++ b/cpp/ql/lib/ext/generated/empty.model.yml @@ -0,0 +1,5 @@ +extensions: + - addsTo: + pack: codeql/cpp-all + extensible: summaryModel + data: [] \ No newline at end of file From 9e9a580d02e7c7917280971c79e5b6d81d5b56da Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Wed, 23 Apr 2025 11:11:17 +0100 Subject: [PATCH 146/240] C++: Add MaD generation test with union content. --- .../modelgenerator/dataflow/summaries.cpp | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp index d72d417e49f5..8b6da3e8ac57 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp @@ -180,4 +180,22 @@ struct FinalStruct final { virtual int public_final_member_function_2(int x) final { return x; } -}; \ No newline at end of file +}; + +union U { + int x, y; +}; + +//summary=;;true;get_x_from_union;(U *);;Argument[0];ReturnValue;taint;df-generated +//summary=;;true;get_x_from_union;(U *);;Argument[*0];ReturnValue;taint;df-generated +//contentbased-summary=;;true;get_x_from_union;(U *);;Argument[0];ReturnValue;taint;dfc-generated +//contentbased-summary=;;true;get_x_from_union;(U *);;Argument[*0].Union[*U];ReturnValue;value;dfc-generated +int get_x_from_union(U* u) { + return u->x; +} + +//summary=;;true;set_x_in_union;(U *,int);;Argument[1];Argument[*0];taint;df-generated +//contentbased-summary=;;true;set_x_in_union;(U *,int);;Argument[1];Argument[*0].Union[*U];value;dfc-generated +void set_x_in_union(U* u, int x) { + u->x = x; +} \ No newline at end of file From d6f1bd97921bf95a2b018c550cf43aecf58893a0 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 23 Apr 2025 11:24:29 +0100 Subject: [PATCH 147/240] Rust: Remove unnecessary predicate. --- rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql index 396a4b7caa8f..29158454b2f7 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql @@ -2,10 +2,6 @@ import codeql.rust.dataflow.DataFlow import codeql.rust.dataflow.internal.DataFlowImpl import utils.test.TranslateModels -private predicate provenance(string model) { RustDataFlow::simpleLocalFlowStep(_, _, model) } - -private module Tm = TranslateModels; - query predicate localStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) { // Local flow steps that don't originate from a flow summary. RustDataFlow::simpleLocalFlowStep(nodeFrom, nodeTo, "") From 617f4729d8c0f410dd6e2991454f8632430b5aa7 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 23 Apr 2025 12:35:17 +0200 Subject: [PATCH 148/240] Shared: Match line information on Alert and Sink locations. --- shared/util/codeql/util/test/InlineExpectationsTest.qll | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/util/codeql/util/test/InlineExpectationsTest.qll b/shared/util/codeql/util/test/InlineExpectationsTest.qll index 5fe8932808c9..56ac6ea32279 100644 --- a/shared/util/codeql/util/test/InlineExpectationsTest.qll +++ b/shared/util/codeql/util/test/InlineExpectationsTest.qll @@ -774,8 +774,10 @@ module TestPostProcessing { */ private string getSinkTag(int row) { getQueryKind() = "path-problem" and - exists(string loc | queryResults(mainResultSet(), row, 4, loc) | - if queryResults(mainResultSet(), row, 0, loc) then result = "Alert" else result = "Sink" + exists(TestLocation sinkLoc, TestLocation selectLoc | + mainQueryResult(row, 0, selectLoc) and + mainQueryResult(row, 4, sinkLoc) and + if sameLineInfo(selectLoc, sinkLoc) then result = "Alert" else result = "Sink" ) } From 2e0ce44fde36cd871c6e6df3947ad202c9af9360 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 23 Apr 2025 15:41:20 +0200 Subject: [PATCH 149/240] Javascript: Update test files. --- .../CommandInjection/child_process-test.js | 6 +- .../CWE-078/CommandInjection/exec-sh.js | 2 +- .../CWE-078/CommandInjection/exec-sh2.js | 2 +- .../lib/isImported.js | 4 +- .../UnsafeShellCommandConstruction/lib/lib.js | 152 +++++++++--------- .../lib/lib2.js | 6 +- .../lib/subLib/amdSub.js | 4 +- .../lib/subLib/index.js | 6 +- .../lib/subLib2/compiled-file.ts | 2 +- .../lib/subLib2/special-file.js | 4 +- .../lib/subLib3/my-file.ts | 2 +- .../lib/subLib4/subsub.js | 2 +- .../Security/CWE-400/ReDoS/lib/closure.js | 4 +- .../Security/CWE-400/ReDoS/lib/indirect.js | 4 +- .../Security/CWE-400/ReDoS/lib/lib.js | 14 +- .../CWE-400/ReDoS/lib/moduleLib/moduleLib.js | 2 +- .../ReDoS/lib/otherLib/js/src/index.js | 2 +- .../Security/CWE-400/ReDoS/lib/snapdragon.js | 6 +- .../CWE-400/ReDoS/lib/subLib4/factory.js | 4 +- .../CWE-400/ReDoS/lib/subLib5/feature.js | 4 +- .../CWE-400/ReDoS/lib/subLib5/main.js | 2 +- .../CWE-400/ReDoS/lib/subLib5/subclass.js | 2 +- .../CWE-400/ReDoS/lib/subLib6/index.js | 4 +- .../CWE-400/ReDoS/lib/sublib/factory.js | 2 +- .../CWE-400/ReDoS/polynomial-redos.js | 146 ++++++++--------- .../Request/app/api/proxy/route.serverSide.ts | 2 +- .../app/api/proxy/route2.serverSide.ts | 2 +- .../Security/CWE-918/Request/middleware.ts | 5 +- .../Security/CWE-918/apollo.serverSide.ts | 4 +- .../Security/CWE-918/clientSide.js | 8 +- .../Security/CWE-918/serverSide.js | 46 +++--- 31 files changed, 227 insertions(+), 228 deletions(-) diff --git a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/child_process-test.js b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/child_process-test.js index d11d97fc1c35..5fea8a3e4d68 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/child_process-test.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/child_process-test.js @@ -36,7 +36,7 @@ var server = http.createServer(function(req, res) { sh = 'cmd.exe', flag = '/c'; else sh = '/bin/sh', flag = '-c'; - cp.spawn(sh, [ flag, cmd ]); // $ Alert Sink + cp.spawn(sh, [ flag, cmd ]); // $ Alert let args = []; args[0] = "-c"; @@ -53,8 +53,8 @@ var server = http.createServer(function(req, res) { args[1] = cmd; // $ Sink cp.execFile(`/bin` + "/bash", args); // $ Alert - cp.spawn('cmd.exe', ['/C', 'foo'].concat(["bar", cmd])); // $ Alert Sink - cp.spawn('cmd.exe', ['/C', 'foo'].concat(cmd)); // $ Alert Sink + cp.spawn('cmd.exe', ['/C', 'foo'].concat(["bar", cmd])); // $ Alert + cp.spawn('cmd.exe', ['/C', 'foo'].concat(cmd)); // $ Alert let myArgs = []; myArgs.push(`-` + "c"); diff --git a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh.js b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh.js index 9e59ff90b140..de7e60c6962b 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh.js @@ -12,7 +12,7 @@ function getShell() { function execSh(command, options) { var shell = getShell() - return cp.spawn(shell.cmd, [shell.arg, command], options) // $ Alert Sink + return cp.spawn(shell.cmd, [shell.arg, command], options) // $ Alert } http.createServer(function (req, res) { diff --git a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh2.js b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh2.js index 5b6d770a2653..c98653e7cb42 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh2.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh2.js @@ -7,7 +7,7 @@ function getShell() { } function execSh(command, options) { - return cp.spawn(getShell(), ["-c", command], options) // $ Alert Sink + return cp.spawn(getShell(), ["-c", command], options) // $ Alert }; http.createServer(function (req, res) { diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/isImported.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/isImported.js index b4f75df03ac4..fc91dddf873d 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/isImported.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/isImported.js @@ -3,5 +3,5 @@ const cp = require("child_process"); module.exports.thisMethodIsImported = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink -} \ No newline at end of file + cp.exec("rm -rf " + name); // $ Alert +} diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib.js index 85d0402a8ae8..e7911746d6eb 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib.js @@ -1,30 +1,30 @@ var cp = require("child_process") module.exports.blah = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert cp.execFile(name, [name]); cp.execFile(name, name); }; module.exports.foo = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } module.exports.foo.bar = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } function cla() { } cla.prototype.method = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } module.exports.cla = new cla(); function cla2() { } cla2.prototype.method = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } module.exports.bla = new cla2(); @@ -32,13 +32,13 @@ module.exports.lib2 = require("./lib2.js") class Cla3 { constructor(name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } static foo(name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } bar(name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert cp.exec("rm -rf " + notASource); } @@ -47,14 +47,14 @@ class Cla3 { module.exports.cla3 = Cla3; module.exports.mz = function (name) { // $ Source - require("mz/child_process").exec("rm -rf " + name); // $ Alert Sink + require("mz/child_process").exec("rm -rf " + name); // $ Alert } module.exports.flow = function (name) { // $ Source - var cmd1 = "rm -rf " + name; // $ Alert Sink + var cmd1 = "rm -rf " + name; // $ Alert cp.exec(cmd1); - var cmd2 = "rm -rf " + name; // $ Alert Sink + var cmd2 = "rm -rf " + name; // $ Alert function myExec(cmd) { cp.exec(cmd); } @@ -62,25 +62,25 @@ module.exports.flow = function (name) { // $ Source } module.exports.stringConcat = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert cp.exec(name); - cp.exec("for foo in (" + name + ") do bla end"); // $ Alert Sink + cp.exec("for foo in (" + name + ") do bla end"); // $ Alert - cp.exec("cat /foO/BAR/" + name) // $ Alert Sink + cp.exec("cat /foO/BAR/" + name) // $ Alert - cp.exec("cat \"" + name + "\"") // $ Alert Sink + cp.exec("cat \"" + name + "\"") // $ Alert - cp.exec("cat '" + name + "'") // $ Alert Sink + cp.exec("cat '" + name + "'") // $ Alert - cp.exec("cat '/foo/bar" + name + "'") // $ Alert Sink + cp.exec("cat '/foo/bar" + name + "'") // $ Alert cp.exec(name + " some file") } module.exports.arrays = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert var args1 = ["node"]; args1.push(name); // $ Alert @@ -109,7 +109,7 @@ module.exports.format = function (name) { // $ Source } module.exports.valid = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!isValidName(name)) { return; @@ -118,7 +118,7 @@ module.exports.valid = function (name) { // $ Source } module.exports.safe = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!isSafeName(name)) { return; @@ -128,7 +128,7 @@ module.exports.safe = function (name) { // $ Source class Cla4 { wha(name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } static bla(name) { @@ -146,7 +146,7 @@ function Cla5(name) { module.exports.cla5 = new Cla5(); module.exports.indirect = function (name) { // $ Source - let cmd = "rm -rf " + name; // $ Alert Sink + let cmd = "rm -rf " + name; // $ Alert let sh = "sh"; let args = ["-c", cmd]; cp.spawn(sh, args, cb); @@ -158,7 +158,7 @@ module.exports.indirect2 = function (name) { // $ Source let args = ["-c", cmd]; cp.spawn(sh, args, cb); - let cmd2 = "rm -rf " + name; // $ Alert Sink + let cmd2 = "rm -rf " + name; // $ Alert var args2 = [cmd2]; cp.spawn( 'cmd.exe', @@ -170,7 +170,7 @@ module.exports.indirect2 = function (name) { // $ Source module.exports.cmd = function (command, name) { // $ Source cp.exec("fo | " + command); - cp.exec("fo | " + name); // $ Alert Sink + cp.exec("fo | " + name); // $ Alert } @@ -178,54 +178,54 @@ module.exports.sanitizer = function (name) { // $ Source var sanitized = "'" + name.replace(/'/g, "'\\''") + "'" cp.exec("rm -rf " + sanitized); - var broken = "'" + name.replace(/'/g, "'\''") + "'" // $ Alert Sink - cp.exec("rm -rf " + broken); // $ Alert Sink + var broken = "'" + name.replace(/'/g, "'\''") + "'" // $ Alert + cp.exec("rm -rf " + broken); // $ Alert } var path = require("path"); module.exports.guard = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!path.exist(name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert return; } cp.exec("rm -rf " + name); } module.exports.blacklistOfChars = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (/[^A-Za-z0-9_\/:=-]/.test(name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } } module.exports.whitelistOfChars = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (/^[A-Za-z0-9_\/:=-]$/.test(name)) { cp.exec("rm -rf " + name); } else { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } } module.exports.blackList2 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!/^([a-zA-Z0-9]+))?$/.test(name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert process.exit(-1); } - cp.exec("rm -rf " + name); // $ Sink SPURIOUS: Alert - FP due to tracking flow through `process.exit()`. + cp.exec("rm -rf " + name); // $ SPURIOUS: Alert - FP due to tracking flow through `process.exit()`. } module.exports.accessSync = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert try { path.accessSync(name); @@ -233,7 +233,7 @@ module.exports.accessSync = function (name) { // $ Source return; } - cp.exec("rm -rf " + name); // $ Sink SPURIOUS: Alert - FP due to `path.accessSync` not being recognized as a sanitizer. + cp.exec("rm -rf " + name); // $ SPURIOUS: Alert - FP due to `path.accessSync` not being recognized as a sanitizer. } var cleanInput = function (s) { @@ -246,26 +246,26 @@ var cleanInput = function (s) { } module.exports.goodSanitizer = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert var cleaned = cleanInput(name); - cp.exec("rm -rf " + cleaned); // $ Sink SPURIOUS: Alert - SanitizingRegExpTest is not able to generate a barrier edge for an edge into a phi node. + cp.exec("rm -rf " + cleaned); // $ SPURIOUS: Alert - SanitizingRegExpTest is not able to generate a barrier edge for an edge into a phi node. } var fs = require("fs"); module.exports.guard2 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!fs.existsSync("prefix/" + name)) { - cp.exec("rm -rf prefix/" + name); // $ Alert Sink + cp.exec("rm -rf prefix/" + name); // $ Alert return; } cp.exec("rm -rf prefix/" + name); } module.exports.sanitizerProperty = function (obj) { // $ Source - cp.exec("rm -rf " + obj.version); // $ Alert Sink + cp.exec("rm -rf " + obj.version); // $ Alert obj.version = ""; @@ -274,11 +274,11 @@ module.exports.sanitizerProperty = function (obj) { // $ Source module.exports.Foo = class Foo { start(opts) { // $ Source - cp.exec("rm -rf " + opts.bla); // $ Alert Sink + cp.exec("rm -rf " + opts.bla); // $ Alert this.opts = {}; this.opts.bla = opts.bla - cp.exec("rm -rf " + this.opts.bla); // $ Alert Sink + cp.exec("rm -rf " + this.opts.bla); // $ Alert } } @@ -305,24 +305,24 @@ function sanitizeShellString(str) { } module.exports.sanitizer2 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert var sanitized = sanitizeShellString(name); cp.exec("rm -rf " + sanitized); } module.exports.typeofcheck = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (typeof name === "undefined") { cp.exec("rm -rf " + name); } else { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } } module.exports.typeofcheck = function (arg) { // $ Source - var cmd = "MyWindowCommand | findstr /i /c:" + arg; // $ Alert Sink + var cmd = "MyWindowCommand | findstr /i /c:" + arg; // $ Alert cp.exec(cmd); } @@ -337,7 +337,7 @@ module.exports.unproblematic = function() { }; module.exports.problematic = function(n) { // $ Source - cp.exec("rm -rf " + id(n)); // $ Alert Sink + cp.exec("rm -rf " + id(n)); // $ Alert }; module.exports.typeofNumber = function(n) { @@ -348,7 +348,7 @@ module.exports.typeofNumber = function(n) { function boundProblem(safe, unsafe) { // $ Source cp.exec("rm -rf " + safe); - cp.exec("rm -rf " + unsafe); // $ Alert Sink + cp.exec("rm -rf " + unsafe); // $ Alert } Object.defineProperty(module.exports, "boundProblem", { @@ -403,7 +403,7 @@ function yetAnohterSanitizer(str) { } module.exports.sanitizer3 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert var sanitized = yetAnohterSanitizer(name); cp.exec("rm -rf " + sanitized); @@ -412,7 +412,7 @@ module.exports.sanitizer3 = function (name) { // $ Source const cp = require("child_process"); const spawn = cp.spawn; module.exports.shellOption = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert cp.execFile("rm", ["-rf", name], {shell: true}, (err, out) => {}); // $ Alert cp.spawn("rm", ["-rf", name], {shell: true}); // $ Alert @@ -439,12 +439,12 @@ function build(first, last) { var asyncExec = require("async-execute"); module.exports.asyncStuff = function (name) { // $ Source - asyncExec("rm -rf " + name); // $ Alert Sink + asyncExec("rm -rf " + name); // $ Alert } const myFuncs = { myFunc: function (name) { // $ Source - asyncExec("rm -rf " + name); // $ Alert Sink + asyncExec("rm -rf " + name); // $ Alert } }; @@ -480,7 +480,7 @@ module.exports.check = function check(config) { // $ Source } module.exports.splitConcat = function (name) { // $ Source - let args = ' my name is ' + name; // $ Alert Sink + let args = ' my name is ' + name; // $ Alert let cmd = 'echo'; cp.exec(cmd + args); } @@ -496,7 +496,7 @@ module.exports.myCommand = function (myCommand) { }; module.exports.myIndirectThing = function (name) { // $ Source - MyThing.cp.exec("rm -rf " + name); // $ Alert Sink + MyThing.cp.exec("rm -rf " + name); // $ Alert } }); @@ -507,42 +507,42 @@ for (var name in imp){ } module.exports.sanitizer4 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (isNaN(name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(parseInt(name))) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(+name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(parseInt(name, 10))) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(name - 0)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(name | 0)) { // <- not a sanitizer - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } } @@ -557,26 +557,26 @@ module.exports.shellThing = function (name) { // $ Source module.exports.badSanitizer = function (name) { // $ Source if (!name.match(/^(.|\.){1,64}$/)) { // <- bad sanitizer - exec("rm -rf " + name); // $ Alert Sink + exec("rm -rf " + name); // $ Alert } else { - exec("rm -rf " + name); // $ Alert Sink + exec("rm -rf " + name); // $ Alert } if (!name.match(/^\w{1,64}$/)) { // <- good sanitizer - exec("rm -rf " + name); // $ Alert Sink + exec("rm -rf " + name); // $ Alert } else { exec("rm -rf " + name); } } module.exports.safeWithBool = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (isSafeName(name)) { cp.exec("rm -rf " + name); } - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (isSafeName(name) === true) { cp.exec("rm -rf " + name); @@ -587,10 +587,10 @@ module.exports.safeWithBool = function (name) { // $ Source } if (isSafeName(name) == false) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } function indirectThing(name) { @@ -606,7 +606,7 @@ function moreIndirect(name) { } module.exports.veryIndeirect = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (indirectThing(name)) { cp.exec("rm -rf " + name); @@ -623,15 +623,15 @@ module.exports.veryIndeirect = function (name) { // $ Source if (moreIndirect(name) !== false) { cp.exec("rm -rf " + name); } else { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } module.exports.sanitizer = function (name) { // $ Source - var sanitized = "'" + name.replace(new RegExp("\'"), "'\\''") + "'" // $ Alert Sink - cp.exec("rm -rf " + sanitized); // $ Alert Sink + var sanitized = "'" + name.replace(new RegExp("\'"), "'\\''") + "'" // $ Alert + cp.exec("rm -rf " + sanitized); // $ Alert var sanitized = "'" + name.replace(new RegExp("\'", 'g'), "'\\''") + "'" cp.exec("rm -rf " + sanitized); diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib2.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib2.js index 9c427622c770..2f0d80b60e09 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib2.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib2.js @@ -1,9 +1,9 @@ var cp = require("child_process") module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - is imported from main module. + cp.exec("rm -rf " + name); // $ Alert - is imported from main module. }; module.exports.foo = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - is imported from main module. -}; \ No newline at end of file + cp.exec("rm -rf " + name); // $ Alert - is imported from main module. +}; diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/amdSub.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/amdSub.js index e268f47c4e20..ab9be8e4eaf5 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/amdSub.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/amdSub.js @@ -1,5 +1,5 @@ const cp = require("child_process"); module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - this function is exported from `amd.js` -}; \ No newline at end of file + cp.exec("rm -rf " + name); // $ Alert - this function is exported from `amd.js` +}; diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/index.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/index.js index 0b1abc951286..d422ac9184ae 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/index.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/index.js @@ -1,15 +1,15 @@ var cp = require("child_process") module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - functions exported as part of a submodule are also flagged. + cp.exec("rm -rf " + name); // $ Alert - functions exported as part of a submodule are also flagged. }; module.exports.foo = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - this is being called explicitly from child_process-test.js + cp.exec("rm -rf " + name); // $ Alert - this is being called explicitly from child_process-test.js }; module.exports.amd = require("./amd.js"); module.exports.arrToShell = function (cmd, arr) { // $ Source cp.spawn("echo", arr, {shell: true}); // $ Alert -} \ No newline at end of file +} diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/compiled-file.ts b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/compiled-file.ts index e6b7a10bacf6..b10ee80481eb 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/compiled-file.ts +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/compiled-file.ts @@ -1,5 +1,5 @@ var cp = require("child_process") export default function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - the "files" directory points to this file. + cp.exec("rm -rf " + name); // $ Alert - the "files" directory points to this file. } diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/special-file.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/special-file.js index 853e144a0d62..b5740c3057ec 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/special-file.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/special-file.js @@ -1,5 +1,5 @@ var cp = require("child_process") module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - the "files" directory points to this file. -}; \ No newline at end of file + cp.exec("rm -rf " + name); // $ Alert - the "files" directory points to this file. +}; diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib3/my-file.ts b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib3/my-file.ts index f28c157a5ead..7320835f8ece 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib3/my-file.ts +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib3/my-file.ts @@ -1,5 +1,5 @@ var cp = require("child_process") module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - functions exported as part of a submodule are also flagged. + cp.exec("rm -rf " + name); // $ Alert - functions exported as part of a submodule are also flagged. }; diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib4/subsub.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib4/subsub.js index b8da58006c7c..bc9e51562033 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib4/subsub.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib4/subsub.js @@ -1,5 +1,5 @@ const cp = require("child_process") module.exports = function (name) { - cp.exec("rm -rf " + name); // $ Alert Sink - functions exported as part of a submodule are also flagged. + cp.exec("rm -rf " + name); // $ Alert - functions exported as part of a submodule are also flagged. }; diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/closure.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/closure.js index 19f928a015b4..45951253dd7a 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/closure.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/closure.js @@ -1,5 +1,5 @@ goog.module('x.y.z.closure2'); exports = function (x) { // $ Source[js/polynomial-redos] - /u*o/.test(x); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] -} \ No newline at end of file + /u*o/.test(x); // $ Alert[js/polynomial-redos] +} diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/indirect.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/indirect.js index 12577a4de312..a6c712ad7cb8 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/indirect.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/indirect.js @@ -1,3 +1,3 @@ module.exports.foo = function (x) { // $ Source[js/polynomial-redos] - /k*h/.test(x); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] -} \ No newline at end of file + /k*h/.test(x); // $ Alert[js/polynomial-redos] +} diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/lib.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/lib.js index 313d555f9f5a..b22ef792b935 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/lib.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/lib.js @@ -1,11 +1,11 @@ var regexp = /a*b/; module.exports = function (name) { // $ Source[js/polynomial-redos] - regexp.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + regexp.test(name); // $ Alert[js/polynomial-redos] }; function bar(reg, name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] } if (typeof define !== 'undefined' && define.amd) { // AMD @@ -33,16 +33,16 @@ module.exports.useArguments = function () { } function usedWithArguments(name) { - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] } module.exports.snapdragon = require("./snapdragon") module.exports.foo = function (name) { // $ Source[js/polynomial-redos] - var data1 = name.match(/f*g/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + var data1 = name.match(/f*g/); // $ Alert[js/polynomial-redos] name = name.substr(1); - var data2 = name.match(/f*g/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + var data2 = name.match(/f*g/); // $ Alert[js/polynomial-redos] } var indirectAssign = {}; @@ -50,6 +50,6 @@ module.exports.indirectAssign = indirectAssign; Object.assign(indirectAssign, { myThing: function (name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] }, -}); \ No newline at end of file +}); diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/moduleLib/moduleLib.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/moduleLib/moduleLib.js index 44c24db352e4..8d7f26935da4 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/moduleLib/moduleLib.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/moduleLib/moduleLib.js @@ -1,3 +1,3 @@ module.exports = function (name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /a*b/.test(name); // $ Alert[js/polynomial-redos] }; diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/otherLib/js/src/index.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/otherLib/js/src/index.js index 44c24db352e4..8d7f26935da4 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/otherLib/js/src/index.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/otherLib/js/src/index.js @@ -1,3 +1,3 @@ module.exports = function (name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /a*b/.test(name); // $ Alert[js/polynomial-redos] }; diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/snapdragon.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/snapdragon.js index ce6dae71ea85..3749edca43f9 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/snapdragon.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/snapdragon.js @@ -4,7 +4,7 @@ module.exports.test1 = function (input) { // $ Source[js/polynomial-redos] var snapdragon = new Snapdragon(); var ast = snapdragon.parser .set("foo", function () { - var m = this.match(/aa*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + var m = this.match(/aa*$/); // $ Alert[js/polynomial-redos] }) .parse(input, options); }; @@ -12,7 +12,7 @@ module.exports.test1 = function (input) { // $ Source[js/polynomial-redos] module.exports.test2 = function (input) { // $ Source[js/polynomial-redos] var snapdragon = new Snapdragon(); snapdragon.parser.set("foo", function () { - var m = this.match(/aa*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + var m = this.match(/aa*$/); // $ Alert[js/polynomial-redos] }); snapdragon.parse(input, options); }; @@ -20,7 +20,7 @@ module.exports.test2 = function (input) { // $ Source[js/polynomial-redos] module.exports.test3 = function (input) { // $ Source[js/polynomial-redos] var snapdragon = new Snapdragon(); snapdragon.compiler.set("foo", function (node) { - node.val.match(/aa*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + node.val.match(/aa*$/); // $ Alert[js/polynomial-redos] }); snapdragon.compile(input, options); }; diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib4/factory.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib4/factory.js index 088fe11e20a1..31c39e974ca8 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib4/factory.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib4/factory.js @@ -5,6 +5,6 @@ }(this, (function (exports) { 'use strict'; exports.foo = function (name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] } -}))); \ No newline at end of file +}))); diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/feature.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/feature.js index 44c24db352e4..5c73d32f7011 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/feature.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/feature.js @@ -1,3 +1,3 @@ module.exports = function (name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] -}; + /a*b/.test(name); // $ Alert[js/polynomial-redos] +} diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/main.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/main.js index daf462fea1cf..92463bf21b5f 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/main.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/main.js @@ -1,5 +1,5 @@ module.exports = function (name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /a*b/.test(name); // $ Alert[js/polynomial-redos] }; const SubClass = require('./subclass'); diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/subclass.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/subclass.js index 9786b49b0327..c09dc8ada30f 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/subclass.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/subclass.js @@ -2,7 +2,7 @@ class Subclass { constructor() {} define(name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /a*b/.test(name); // $ Alert[js/polynomial-redos] } } diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib6/index.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib6/index.js index dd5b0db354fe..9155913f76b7 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib6/index.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib6/index.js @@ -1,3 +1,3 @@ module.exports.foo = function (name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] -} \ No newline at end of file + /f*g/.test(name); // $ Alert[js/polynomial-redos] +} diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/sublib/factory.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/sublib/factory.js index 5ba28dca4217..3bcbe5aaf52e 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/sublib/factory.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/sublib/factory.js @@ -10,7 +10,7 @@ }(this, function () { function create() { return function (name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] } } return create() diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/polynomial-redos.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/polynomial-redos.js index be1f8d9577ac..5f2dee1c744f 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/polynomial-redos.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/polynomial-redos.js @@ -4,140 +4,140 @@ var app = express(); app.use(function(req, res) { let tainted = req.query.tainted; // $ Source[js/polynomial-redos] - tainted.replace(/^\s+|\s+$/g, ''); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.split(/ *, */); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.replace(/\s*\n\s*/g, ' '); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.replace(/^\s+|\s+$/g, ''); // $ Alert[js/polynomial-redos] + tainted.split(/ *, */); // $ Alert[js/polynomial-redos] + tainted.replace(/\s*\n\s*/g, ' '); // $ Alert[js/polynomial-redos] tainted.split('\n'); - tainted.replace(/.*[/\\]/, ''); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.replace(/.*\./, ''); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.replace(/.*[/\\]/, ''); // $ Alert[js/polynomial-redos] + tainted.replace(/.*\./, ''); // $ Alert[js/polynomial-redos] tainted.replace(/^.*[/\\]/, ''); tainted.replace(/^.*\./, ''); - tainted.replace(/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.replace(/^(`+)([\s\S]*?[^`])\1(?!`)/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - /^(.*,)+(.+)?$/.test(tainted); // $ Alert[js/polynomial-redos] Alert[js/redos] Sink[js/polynomial-redos] - tainted.match(/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - even though it is a proposed fix for the above - tainted.match(/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.replace(/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/); // $ Alert[js/polynomial-redos] + tainted.replace(/^(`+)([\s\S]*?[^`])\1(?!`)/); // $ Alert[js/polynomial-redos] + /^(.*,)+(.+)?$/.test(tainted); // $ Alert[js/polynomial-redos] Alert[js/redos] + tainted.match(/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i); // $ Alert[js/polynomial-redos] + tainted.match(/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i); // $ Alert[js/polynomial-redos] - even though it is a proposed fix for the above + tainted.match(/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/); // $ Alert[js/polynomial-redos] if (tainted.length < 7000) { tainted.match(/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/); // OK - but flagged } - tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/ \t\n]+[=]*)(.*)$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/ \t\n]+[=]*)(.*)$/); // $ Alert[js/polynomial-redos] tainted.match(/^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/); /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/.test(tainted); // $ MISSING: Alert[js/polynomial-redos] - not detected due to not supporting ranges /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/.test(tainted); - tainted.replace(/[?]+.*$/g, ""); // $ Sink[js/polynomial-redos] SPURIOUS: Alert[js/polynomial-redos] - can not fail once a match has started + tainted.replace(/[?]+.*$/g, ""); // $ SPURIOUS: Alert[js/polynomial-redos] - can not fail once a match has started tainted.replace(/\-\-+/g, "-").replace(/-+$/, ""); // OK - indirectly sanitized tainted.replace(/\n\n\n+/g, "\n").replace(/\n*$/g, ""); // OK - indirectly sanitized - tainted.match(/(.)*solve\/challenges\/server-side(.)*/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/(.)*solve\/challenges\/server-side(.)*/); // $ Alert[js/polynomial-redos] tainted.match(/(?![\s\S]*)/i); - tainted.match(/<.*class="([^"]+)".*>/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/<.*style="([^"]+)".*>/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/<.*href="([^"]+)".*>/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/<.*class="([^"]+)".*>/); // $ Alert[js/polynomial-redos] + tainted.match(/<.*style="([^"]+)".*>/); // $ Alert[js/polynomial-redos] + tainted.match(/<.*href="([^"]+)".*>/); // $ Alert[js/polynomial-redos] - tainted.match(/^([^-]+)-([A-Za-z0-9+/]+(?:=?=?))([?\x21-\x7E]*)$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([^-]+)-([A-Za-z0-9+/]+(?:=?=?))([?\x21-\x7E]*)$/); // $ Alert[js/polynomial-redos] tainted.match(/^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/); // $ Alert[js/redos] - it is a fix for the above, but it introduces exponential complexity elsewhere - tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([\n \t]+([^\n]+))?$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([\n \t]+([^\n]+))?$/); // $ Alert[js/polynomial-redos] tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/); tainted.match(/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/); // $ Alert[js/redos] tainted.match(/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/); - tainted.replaceAll(/\s*\n\s*/g, ' '); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - - /Y.*X/.test(tainted); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - /B?(YH|K)(YH|J)*X/.test(tainted) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/B?(YH|K).*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - /(B|Y)+(Y)*X/.test(tainted) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/(B|Y)+(.)*X/.test(tainted)) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/f(B|Y)+(Y)*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - /f(B|Y)+(Y)*X/.test(tainted) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/f(B|Y)+(Y|K)*X/.test(tainted)) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/f(B|Y)+.*X/.test(tainted)) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/f(B|Y)+(.)*X/.test(tainted)) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.replaceAll(/\s*\n\s*/g, ' '); // $ Alert[js/polynomial-redos] + + /Y.*X/.test(tainted); // $ Alert[js/polynomial-redos] + /B?(YH|K)(YH|J)*X/.test(tainted) // $ Alert[js/polynomial-redos] + (/B?(YH|K).*X/.test(tainted)); // $ Alert[js/polynomial-redos] + /(B|Y)+(Y)*X/.test(tainted) // $ Alert[js/polynomial-redos] + (/(B|Y)+(.)*X/.test(tainted)) // $ Alert[js/polynomial-redos] + (/f(B|Y)+(Y)*X/.test(tainted)); // $ Alert[js/polynomial-redos] + /f(B|Y)+(Y)*X/.test(tainted) // $ Alert[js/polynomial-redos] + (/f(B|Y)+(Y|K)*X/.test(tainted)) // $ Alert[js/polynomial-redos] + (/f(B|Y)+.*X/.test(tainted)) // $ Alert[js/polynomial-redos] + (/f(B|Y)+(.)*X/.test(tainted)) // $ Alert[js/polynomial-redos] (/^(.)*X/.test(tainted)); (/^Y(Y)*X/.test(tainted)); - (/^Y*Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/^(K|Y)+Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/^foo(K|Y)+Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/^foo(K|Y)+.*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/(K|Y).*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/[^Y].*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + (/^Y*Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/^(K|Y)+Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/^foo(K|Y)+Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/^foo(K|Y)+.*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/(K|Y).*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/[^Y].*X/.test(tainted)); // $ Alert[js/polynomial-redos] (/[^Y].*$/.test(req.url)); // OK - the input cannot contain newlines. - (/[^Y].*$/.test(req.body)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + (/[^Y].*$/.test(req.body)); // $ Alert[js/polynomial-redos] - tainted.match(/^([^-]+)-([A-Za-z0-9+/]+(?:=?=?))([?\x21-\x7E]*)$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([^-]+)-([A-Za-z0-9+/]+(?:=?=?))([?\x21-\x7E]*)$/); // $ Alert[js/polynomial-redos] - tainted.match(new RegExp("(MSIE) (\\d+)\\.(\\d+).*XBLWP7")); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(new RegExp("(MSIE) (\\d+)\\.(\\d+).*XBLWP7")); // $ Alert[js/polynomial-redos] - tainted.match(/<.*class="([^"]+)".*>/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/<.*class="([^"]+)".*>/); // $ Alert[js/polynomial-redos] - tainted.match(/Y.*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/Y.*X/); // $ Alert[js/polynomial-redos] tatined.match(/B?(YH|K)(YH|J)*X/); // $ MISSING: Alert[js/polynomial-redos] - tainted.match(/a*b/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - the initial repetition can start matching anywhere. - tainted.match(/cc*D/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/a*b/); // $ Alert[js/polynomial-redos] - the initial repetition can start matching anywhere. + tainted.match(/cc*D/); // $ Alert[js/polynomial-redos] tainted.match(/^ee*F/); tainted.match(/^g*g*/); tainted.match(/^h*i*/); - tainted.match(/^(ab)*ab(ab)*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^(ab)*ab(ab)*X/); // $ Alert[js/polynomial-redos] - tainted.match(/aa*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^a*a*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/\wa*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/aa*X/); // $ Alert[js/polynomial-redos] + tainted.match(/^a*a*X/); // $ Alert[js/polynomial-redos] + tainted.match(/\wa*X/); // $ Alert[js/polynomial-redos] tainted.match(/a*b*c*/); tainted.match(/a*a*a*a*/); - tainted.match(/^([3-7]|A)*([2-5]|B)*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^\d*([2-5]|B)*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^([3-7]|A)*\d*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([3-7]|A)*([2-5]|B)*X/); // $ Alert[js/polynomial-redos] + tainted.match(/^\d*([2-5]|B)*X/); // $ Alert[js/polynomial-redos] + tainted.match(/^([3-7]|A)*\d*X/); // $ Alert[js/polynomial-redos] - tainted.match(/^(ab)+ab(ab)+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^(ab)+ab(ab)+X/); // $ Alert[js/polynomial-redos] - tainted.match(/aa+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/a+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^a+a+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/\wa+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/a+b+c+/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/aa+X/); // $ Alert[js/polynomial-redos] + tainted.match(/a+X/); // $ Alert[js/polynomial-redos] + tainted.match(/^a+a+X/); // $ Alert[js/polynomial-redos] + tainted.match(/\wa+X/); // $ Alert[js/polynomial-redos] + tainted.match(/a+b+c+/); // $ Alert[js/polynomial-redos] tainted.match(/a+a+a+a+/); - tainted.match(/^([3-7]|A)+([2-5]|B)+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^\d+([2-5]|B)+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^([3-7]|A)+\d+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([3-7]|A)+([2-5]|B)+X/); // $ Alert[js/polynomial-redos] + tainted.match(/^\d+([2-5]|B)+X/); // $ Alert[js/polynomial-redos] + tainted.match(/^([3-7]|A)+\d+X/); // $ Alert[js/polynomial-redos] - tainted.match(/\s*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/\s+$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/\s*$/); // $ Alert[js/polynomial-redos] + tainted.match(/\s+$/); // $ Alert[js/polynomial-redos] - tainted.match(/^\d*5\w*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^\d*5\w*$/); // $ Alert[js/polynomial-redos] - tainted.match(/\/\*[\d\D]*?\*\//g); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/\/\*[\d\D]*?\*\//g); // $ Alert[js/polynomial-redos] - tainted.match(/(#\d+)+/); // $ Sink[js/polynomial-redos] SPURIOUS: Alert[js/polynomial-redos] - flagged due to insufficient suffix-checking. + tainted.match(/(#\d+)+/); // $ SPURIOUS: Alert[js/polynomial-redos] - flagged due to insufficient suffix-checking. (function foo() { var replaced = tainted.replace(/[^\w\s\-\.\_~]/g, ''); var result = "" result += replaced; - result = result.replace(/^\s+|\s+$/g, ''); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + result = result.replace(/^\s+|\s+$/g, ''); // $ Alert[js/polynomial-redos] })(); tainted.match(/(https?:\/\/[^\s]+)/gm); var modified = tainted.replace(/a/g, "b"); - modified.replace(/cc+D/g, "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + modified.replace(/cc+D/g, "b"); // $ Alert[js/polynomial-redos] var modified2 = tainted.replace(/a|b|c|\d/g, "e"); - modified2.replace(/ff+G/g, "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + modified2.replace(/ff+G/g, "b"); // $ Alert[js/polynomial-redos] var modified3 = tainted.replace(/\s+/g, ""); - modified3.replace(/hh+I/g, "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + modified3.replace(/hh+I/g, "b"); // $ Alert[js/polynomial-redos] - tainted.match(/(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)C.*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)C.*X/); // $ Alert[js/polynomial-redos] - modified3.replace(new RegExp("hh+I", "g"), "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - modified3.replace(new RegExp("hh+I", unknownFlags()), "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - modified3.replace(new RegExp("hh+I", ""), "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + modified3.replace(new RegExp("hh+I", "g"), "b"); // $ Alert[js/polynomial-redos] + modified3.replace(new RegExp("hh+I", unknownFlags()), "b"); // $ Alert[js/polynomial-redos] + modified3.replace(new RegExp("hh+I", ""), "b"); // $ Alert[js/polynomial-redos] }); diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts index f3d05b7e5aa2..b06ac98b9b36 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts @@ -1,5 +1,5 @@ export async function POST(req: Request) { const { url } = await req.json(); // $ Source[js/request-forgery] - const res = await fetch(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(url); // $ Alert[js/request-forgery] return new Response(res.body, { headers: res.headers }); } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts index 051ba67e401f..82cdcc509fcd 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts @@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from 'next/server'; export async function POST(req: NextRequest) { const { url } = await req.json(); // $ Source[js/request-forgery] - const res = await fetch(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(url); // $ Alert[js/request-forgery] const data = await res.text(); return new NextResponse(data, { headers: res.headers }); } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts index 3db3a4bae3b4..504448497806 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts @@ -4,15 +4,14 @@ export async function middleware(req: NextRequest) { const target = req.nextUrl // $ Source[js/request-forgery] const target2 = target.searchParams.get('target'); // $ Source[js/request-forgery] if (target) { - const res = await fetch(target) // $ Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(target) // $ Alert[js/request-forgery] const data = await res.text() return new NextResponse(data) } if (target2) { - const res = await fetch(target2); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(target2); // $ Alert[js/request-forgery] const data = await res.text(); return new NextResponse(data); } return NextResponse.next() } - \ No newline at end of file diff --git a/javascript/ql/test/query-tests/Security/CWE-918/apollo.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/apollo.serverSide.ts index 0f1c4afa554c..da4c5a9693d8 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/apollo.serverSide.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/apollo.serverSide.ts @@ -5,7 +5,7 @@ function createApolloServer(typeDefs) { const resolvers = { Mutation: { downloadFiles: async (_, { files }) => { // $ Source[js/request-forgery] - files.forEach((file) => { get(file.url, (res) => {}); }); // $ Alert[js/request-forgery] Sink[js/request-forgery] + files.forEach((file) => { get(file.url, (res) => {}); }); // $ Alert[js/request-forgery] return true; }, }, @@ -15,7 +15,7 @@ function createApolloServer(typeDefs) { const resolvers2 = { Mutation: { downloadFiles: async (_, { files }) => { // $ Source[js/request-forgery] - files.forEach((file) => { get(file.url, (res) => {}); }); // $ Alert[js/request-forgery] Sink[js/request-forgery] + files.forEach((file) => { get(file.url, (res) => {}); }); // $ Alert[js/request-forgery] return true; }, }, diff --git a/javascript/ql/test/query-tests/Security/CWE-918/clientSide.js b/javascript/ql/test/query-tests/Security/CWE-918/clientSide.js index d546d809a9dd..aa4174cd9ab7 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/clientSide.js +++ b/javascript/ql/test/query-tests/Security/CWE-918/clientSide.js @@ -9,16 +9,16 @@ export function MyComponent() { request(params.foo); // Possibly problematic, but not currently flagged. const query = window.location.search.substring(1); // $ Source[js/client-side-request-forgery] - request('https://example.com/api/' + query + '/id'); // $ Alert[js/client-side-request-forgery] Sink[js/client-side-request-forgery] + request('https://example.com/api/' + query + '/id'); // $ Alert[js/client-side-request-forgery] request('https://example.com/api?q=' + query); - request('https://example.com/api/' + window.location.search); // $ Alert[js/client-side-request-forgery] Sink[js/client-side-request-forgery] - likely OK - but currently flagged anyway + request('https://example.com/api/' + window.location.search); // $ Alert[js/client-side-request-forgery] - likely OK - but currently flagged anyway const fragment = window.location.hash.substring(1); // $ Source[js/client-side-request-forgery] - request('https://example.com/api/' + fragment + '/id'); // $ Alert[js/client-side-request-forgery] Sink[js/client-side-request-forgery] + request('https://example.com/api/' + fragment + '/id'); // $ Alert[js/client-side-request-forgery] request('https://example.com/api?q=' + fragment); const name = window.name; // $ Source[js/client-side-request-forgery] - request('https://example.com/api/' + name + '/id'); // $ Alert[js/client-side-request-forgery] Sink[js/client-side-request-forgery] + request('https://example.com/api/' + name + '/id'); // $ Alert[js/client-side-request-forgery] request('https://example.com/api?q=' + name); request(window.location.href + '?q=123'); diff --git a/javascript/ql/test/query-tests/Security/CWE-918/serverSide.js b/javascript/ql/test/query-tests/Security/CWE-918/serverSide.js index fce762084455..3f9392c5d992 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/serverSide.js +++ b/javascript/ql/test/query-tests/Security/CWE-918/serverSide.js @@ -15,34 +15,34 @@ var server = http.createServer(function(req, res) { request("example.com"); - request(tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request(tainted); // $ Alert[js/request-forgery] - request.get(tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request.get(tainted); // $ Alert[js/request-forgery] var options = {}; options.url = tainted; // $ Sink[js/request-forgery] request(options); // $ Alert[js/request-forgery] - request("http://" + tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request("http://" + tainted); // $ Alert[js/request-forgery] - request("http://example.com" + tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request("http://example.com" + tainted); // $ Alert[js/request-forgery] - request("http://example.com/" + tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request("http://example.com/" + tainted); // $ Alert[js/request-forgery] request("http://example.com/?" + tainted); - http.get(relativeUrl, {host: tainted}); // $ Alert[js/request-forgery] Sink[js/request-forgery] + http.get(relativeUrl, {host: tainted}); // $ Alert[js/request-forgery] - XhrIo.send(new Uri(tainted)); // $ Alert[js/request-forgery] Sink[js/request-forgery] - new XhrIo().send(new Uri(tainted)); // $ Alert[js/request-forgery] Sink[js/request-forgery] + XhrIo.send(new Uri(tainted)); // $ Alert[js/request-forgery] + new XhrIo().send(new Uri(tainted)); // $ Alert[js/request-forgery] let base = require('./config').base; - request(`http://example.com/${base}/${tainted}`); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request(`http://example.com/${base}/${tainted}`); // $ Alert[js/request-forgery] - request(`http://example.com/${base}/v1/${tainted}`); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request(`http://example.com/${base}/v1/${tainted}`); // $ Alert[js/request-forgery] - request('http://example.com/' + base + '/' + tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request('http://example.com/' + base + '/' + tainted); // $ Alert[js/request-forgery] request('http://example.com/' + base + ('/' + tainted)); // $ MISSING: Alert @@ -58,14 +58,14 @@ var server = http.createServer(async function(req, res) { var tainted = url.parse(req.url, true).query.url; // $ Source[js/request-forgery] var client = await CDP(options); - client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] Sink[js/request-forgery] + client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] CDP(options).catch((ignored) => {}).then((client) => { - client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] Sink[js/request-forgery] + client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] }) CDP(options, (client) => { - client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] Sink[js/request-forgery] + client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] }); }) @@ -73,7 +73,7 @@ import {JSDOM} from "jsdom"; var server = http.createServer(async function(req, res) { var tainted = url.parse(req.url, true).query.url; // $ Source[js/request-forgery] - JSDOM.fromURL(tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + JSDOM.fromURL(tainted); // $ Alert[js/request-forgery] }); var route = require('koa-route'); @@ -81,15 +81,15 @@ var Koa = require('koa'); var app = new Koa(); app.use(route.get('/pets', (context, param1, param2, param3) => { // $ Source[js/request-forgery] - JSDOM.fromURL(param1); // $ Alert[js/request-forgery] Sink[js/request-forgery] + JSDOM.fromURL(param1); // $ Alert[js/request-forgery] })); const router = require('koa-router')(); const app = new Koa(); router.get('/', async (ctx, next) => { - JSDOM.fromURL(ctx.params.foo); // $ Alert[js/request-forgery] Sink[js/request-forgery] + JSDOM.fromURL(ctx.params.foo); // $ Alert[js/request-forgery] }).post('/', async (ctx, next) => { - JSDOM.fromURL(ctx.params.foo); // $ Alert[js/request-forgery] Sink[js/request-forgery] + JSDOM.fromURL(ctx.params.foo); // $ Alert[js/request-forgery] }); app.use(router.routes()); @@ -97,7 +97,7 @@ import {JSDOM} from "jsdom"; var server = http.createServer(async function(req, res) { var tainted = url.parse(req.url, true).query.url; // $ Source[js/request-forgery] - new WebSocket(tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + new WebSocket(tainted); // $ Alert[js/request-forgery] }); @@ -106,7 +106,7 @@ import * as ws from 'ws'; new ws.Server({ port: 8080 }).on('connection', function(socket, request) { socket.on('message', function(message) { const url = request.url; // $ Source[js/request-forgery] - const socket = new ws(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const socket = new ws(url); // $ Alert[js/request-forgery] }); }); @@ -114,7 +114,7 @@ new ws.Server({ port: 8080 }).on('connection', function (socket, request) { socket.on('message', function (message) { const url = new URL(request.url, base); // $ Source[js/request-forgery] const target = new URL(url.pathname, base); - const socket = new ws(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const socket = new ws(url); // $ Alert[js/request-forgery] }); }); @@ -128,8 +128,8 @@ var server2 = http.createServer(function(req, res) { }) // $ Alert[js/request-forgery] var myUrl = `${something}/bla/${tainted}`; - axios.get(myUrl); // $ Alert[js/request-forgery] Sink[js/request-forgery] + axios.get(myUrl); // $ Alert[js/request-forgery] var myEncodedUrl = `${something}/bla/${encodeURIComponent(tainted)}`; axios.get(myEncodedUrl); -}) \ No newline at end of file +}) From df3282c204c90da970254ad29782c54a09207746 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 11 Apr 2025 14:50:14 +0200 Subject: [PATCH 150/240] C++: Support C23 `typeof` and `typeof_unqual` --- cpp/ql/lib/semmle/code/cpp/Print.qll | 24 ++ cpp/ql/lib/semmle/code/cpp/Type.qll | 228 +++++++++++++++++- cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll | 2 + .../raw/internal/SideEffects.qll | 8 + cpp/ql/lib/semmlecode.cpp.dbscheme | 51 +++- .../SuspiciousCallToMemset.ql | 6 + 6 files changed, 307 insertions(+), 12 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/Print.qll b/cpp/ql/lib/semmle/code/cpp/Print.qll index 5aafe1c2b65b..90be4fb8339c 100644 --- a/cpp/ql/lib/semmle/code/cpp/Print.qll +++ b/cpp/ql/lib/semmle/code/cpp/Print.qll @@ -176,6 +176,30 @@ private class DecltypeDumpType extends DumpType, Decltype { } } +private class TypeofDumpType extends DumpType, TypeofType { + override string getTypeSpecifier() { result = this.getBaseType().(DumpType).getTypeSpecifier() } + + override string getDeclaratorPrefix() { + result = this.getBaseType().(DumpType).getDeclaratorPrefix() + } + + override string getDeclaratorSuffix() { + result = this.getBaseType().(DumpType).getDeclaratorSuffix() + } +} + +private class IntrinsicTransformedDumpType extends DumpType, IntrinsicTransformedType { + override string getTypeSpecifier() { result = this.getBaseType().(DumpType).getTypeSpecifier() } + + override string getDeclaratorPrefix() { + result = this.getBaseType().(DumpType).getDeclaratorPrefix() + } + + override string getDeclaratorSuffix() { + result = this.getBaseType().(DumpType).getDeclaratorSuffix() + } +} + private class PointerIshDumpType extends DerivedDumpType { PointerIshDumpType() { this instanceof PointerType or diff --git a/cpp/ql/lib/semmle/code/cpp/Type.qll b/cpp/ql/lib/semmle/code/cpp/Type.qll index fbc894a7e075..aa3fa54835cd 100644 --- a/cpp/ql/lib/semmle/code/cpp/Type.qll +++ b/cpp/ql/lib/semmle/code/cpp/Type.qll @@ -92,8 +92,9 @@ class Type extends Locatable, @type { /** * Gets this type after typedefs have been resolved. * - * The result of this predicate will be the type itself, except in the case of a TypedefType or a Decltype, - * in which case the result will be type which results from (possibly recursively) resolving typedefs. + * The result of this predicate will be the type itself, except in the case of a TypedefType, a Decltype, + * or a TypeofType, in which case the result will be type which results from (possibly recursively) + * resolving typedefs. */ pragma[nomagic] Type getUnderlyingType() { result = this } @@ -1117,18 +1118,20 @@ class DerivedType extends Type, @derivedtype { * decltype(a) b; * ``` */ -class Decltype extends Type, @decltype { +class Decltype extends Type { + Decltype() { decltypes(underlyingElement(this), _, 0, _, _) } + override string getAPrimaryQlClass() { result = "Decltype" } /** - * The expression whose type is being obtained by this decltype. + * Gets the expression whose type is being obtained by this decltype. */ - Expr getExpr() { decltypes(underlyingElement(this), unresolveElement(result), _, _) } + Expr getExpr() { decltypes(underlyingElement(this), unresolveElement(result), _, _, _) } /** - * The type immediately yielded by this decltype. + * Gets the type immediately yielded by this decltype. */ - Type getBaseType() { decltypes(underlyingElement(this), _, unresolveElement(result), _) } + Type getBaseType() { decltypes(underlyingElement(this), _, _, unresolveElement(result), _) } /** * Whether an extra pair of parentheses around the expression would change the semantics of this decltype. @@ -1142,7 +1145,7 @@ class Decltype extends Type, @decltype { * ``` * Please consult the C++11 standard for more details. */ - predicate parenthesesWouldChangeMeaning() { decltypes(underlyingElement(this), _, _, true) } + predicate parenthesesWouldChangeMeaning() { decltypes(underlyingElement(this), _, _, _, true) } override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() } @@ -1183,6 +1186,215 @@ class Decltype extends Type, @decltype { } } +/** + * An instance of the C23 `typeof` or `typeof_unqual` operator. For example: + * ``` + * int a; + * typeof(a) b; + * typeof_unqual(const int) b; + * ``` + */ +class TypeofType extends Type { + TypeofType() { + decltypes(underlyingElement(this), _, 1, _, _) or + type_operators(underlyingElement(this), _, 0, _) + } + + /** + * Gets the type immediately yielded by this typeof. + */ + Type getBaseType() { + decltypes(underlyingElement(this), _, _, unresolveElement(result), _) + or + type_operators(underlyingElement(this), _, _, unresolveElement(result)) + } + + override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() } + + override Type stripTopLevelSpecifiers() { result = this.getBaseType().stripTopLevelSpecifiers() } + + override Type stripType() { result = this.getBaseType().stripType() } + + override Type resolveTypedefs() { result = this.getBaseType().resolveTypedefs() } + + override string toString() { result = "typeof(...)" } + + override string getName() { none() } + + override int getSize() { result = this.getBaseType().getSize() } + + override int getAlignment() { result = this.getBaseType().getAlignment() } + + override int getPointerIndirectionLevel() { + result = this.getBaseType().getPointerIndirectionLevel() + } + + override string explain() { + result = "typeof resulting in {" + this.getBaseType().explain() + "}" + } + + override predicate involvesReference() { this.getBaseType().involvesReference() } + + override predicate involvesTemplateParameter() { this.getBaseType().involvesTemplateParameter() } + + override predicate isDeeplyConst() { this.getBaseType().isDeeplyConst() } + + override predicate isDeeplyConstBelow() { this.getBaseType().isDeeplyConstBelow() } + + override Specifier internal_getAnAdditionalSpecifier() { + result = this.getBaseType().getASpecifier() + } +} + +/** + * An instance of the C23 `typeof` or `typeof_unqual` operator taking an expression + * as its argument. For example: + * ``` + * int a; + * typeof(a) b; + * ``` + */ +class TypeofExprType extends TypeofType { + TypeofExprType() { decltypes(underlyingElement(this), _, 1, _, _) } + + override string getAPrimaryQlClass() { result = "TypeofExprType" } + + /** + * Gets the expression whose type is being obtained by this typeof. + */ + Expr getExpr() { decltypes(underlyingElement(this), unresolveElement(result), _, _, _) } + + override Location getLocation() { result = this.getExpr().getLocation() } +} + +/** + * A type obtained by C23 `typeof` or `typeof_unqual` operator taking a type as its + * argument. For example: + * ``` + * typeof_unqual(const int) b; + * ``` + */ +class TypeofTypeType extends TypeofType { + TypeofTypeType() { type_operators(underlyingElement(this), _, 0, _) } + + /** + * Gets the expression whose type is being obtained by this typeof. + */ + Type getType() { type_operators(underlyingElement(this), unresolveElement(result), _, _) } + + override string getAPrimaryQlClass() { result = "TypeofTypeType" } + + override string toString() { result = "typeof(...)" } +} + +/** + * A type obtained by applying a type transforming intrinsic. For example: + * ``` + * __make_unsigned(int) x; + * ``` + */ +class IntrinsicTransformedType extends Type { + int intrinsic; + + IntrinsicTransformedType() { + type_operators(underlyingElement(this), _, intrinsic, _) and + intrinsic in [1 .. 19] + } + + override string getAPrimaryQlClass() { result = "IntrinsicTransformedType" } + + override string toString() { result = this.getIntrinsicName() + "(...)" } + + /** + * Gets the type immediately yielded by this transformation. + */ + Type getBaseType() { type_operators(underlyingElement(this), _, _, unresolveElement(result)) } + + /** + * Gets the type that is transformed. + */ + Type getType() { type_operators(underlyingElement(this), unresolveElement(result), _, _) } + + /** + * Gets the name of the intrinsic used to transform the type. + */ + string getIntrinsicName() { + intrinsic = 1 and result = "__underlying_type" + or + intrinsic = 2 and result = "__bases" + or + intrinsic = 3 and result = "__direct_bases" + or + intrinsic = 4 and result = "__add_lvalue_reference" + or + intrinsic = 5 and result = "__add_pointer" + or + intrinsic = 6 and result = "__add_rvalue_reference" + or + intrinsic = 7 and result = "__decay" + or + intrinsic = 8 and result = "__make_signed" + or + intrinsic = 9 and result = "__make_unsigned" + or + intrinsic = 10 and result = "__remove_all_extents" + or + intrinsic = 11 and result = "__remove_const" + or + intrinsic = 12 and result = "__remove_cv" + or + intrinsic = 13 and result = "__remove_cvref" + or + intrinsic = 14 and result = "__remove_extent" + or + intrinsic = 15 and result = "__remove_pointer" + or + intrinsic = 16 and result = "__remove_reference_t" + or + intrinsic = 17 and result = "__remove_restrict" + or + intrinsic = 18 and result = "__remove_volatile" + or + intrinsic = 19 and result = "__remove_reference" + } + + override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() } + + override Type stripTopLevelSpecifiers() { result = this.getBaseType().stripTopLevelSpecifiers() } + + override Type stripType() { result = this.getBaseType().stripType() } + + override Type resolveTypedefs() { result = this.getBaseType().resolveTypedefs() } + + override string getName() { none() } + + override int getSize() { result = this.getBaseType().getSize() } + + override int getAlignment() { result = this.getBaseType().getAlignment() } + + override int getPointerIndirectionLevel() { + result = this.getBaseType().getPointerIndirectionLevel() + } + + override string explain() { + result = + "application of " + this.getIntrinsicName() + " resulting in {" + this.getBaseType().explain() + + "}" + } + + override predicate involvesReference() { this.getBaseType().involvesReference() } + + override predicate involvesTemplateParameter() { this.getBaseType().involvesTemplateParameter() } + + override predicate isDeeplyConst() { this.getBaseType().isDeeplyConst() } + + override predicate isDeeplyConstBelow() { this.getBaseType().isDeeplyConstBelow() } + + override Specifier internal_getAnAdditionalSpecifier() { + result = this.getBaseType().getASpecifier() + } +} + /** * A C/C++ pointer type. See 4.9.1. * ``` diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll index 8ae182394186..2b9fb2649d51 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll @@ -310,6 +310,8 @@ class Expr extends StmtParent, @expr { or exists(Decltype d | d.getExpr() = this.getParentWithConversions*()) or + exists(TypeofExprType t | t.getExpr() = this.getParentWithConversions*()) + or exists(ConstexprIfStmt constIf | constIf.getControllingExpr() = this.getParentWithConversions*() ) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll index 187cde6e700e..1b63322610a1 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll @@ -16,6 +16,10 @@ private predicate isDeeplyConst(Type t) { or isDeeplyConst(t.(Decltype).getBaseType()) or + isDeeplyConst(t.(TypeofType).getBaseType()) + or + isDeeplyConst(t.(IntrinsicTransformedType).getBaseType()) + or isDeeplyConst(t.(ReferenceType).getBaseType()) or exists(SpecifiedType specType | specType = t | @@ -36,6 +40,10 @@ private predicate isDeeplyConstBelow(Type t) { or isDeeplyConstBelow(t.(Decltype).getBaseType()) or + isDeeplyConstBelow(t.(TypeofType).getBaseType()) + or + isDeeplyConstBelow(t.(IntrinsicTransformedType).getBaseType()) + or isDeeplyConst(t.(PointerType).getBaseType()) or isDeeplyConst(t.(ReferenceType).getBaseType()) diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme b/cpp/ql/lib/semmlecode.cpp.dbscheme index 2e2d805ef93d..9a7c3c14c107 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme @@ -743,15 +743,17 @@ typedefbase( ); /** - * An instance of the C++11 `decltype` operator. For example: + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: * ``` * int a; * decltype(1+a) b; + * typeof(1+a) c; * ``` * Here `expr` is `1+a`. * * Sometimes an additional pair of parentheses around the expression - * would change the semantics of this decltype, e.g. + * changes the semantics of the decltype, e.g. * ``` * struct A { double x; }; * const A* a = new A(); @@ -761,14 +763,55 @@ typedefbase( * (Please consult the C++11 standard for more details). * `parentheses_would_change_meaning` is `true` iff that is the case. */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + #keyset[id, expr] decltypes( int id: @decltype, int expr: @expr ref, + int kind: int ref, int base_type: @type ref, boolean parentheses_would_change_meaning: boolean ref ); +/* +case @type_operator.kind of +| 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; +*/ + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type ref +) + /* case @usertype.kind of | 0 = @unknown_usertype @@ -1103,10 +1146,10 @@ stmtattributes( @type = @builtintype | @derivedtype | @usertype - /* TODO | @fixedpointtype */ | @routinetype | @ptrtomember - | @decltype; + | @decltype + | @type_operator; unspecifiedtype( unique int type_id: @type ref, diff --git a/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql b/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql index cb495f939fba..d485666ea4cf 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql @@ -47,11 +47,17 @@ Type stripType(Type t) { or result = stripType(t.(Decltype).getBaseType()) or + result = stripType(t.(TypeofType).getBaseType()) + or + result = stripType(t.(IntrinsicTransformedType).getBaseType()) + or not t instanceof TypedefType and not t instanceof ArrayType and not t instanceof ReferenceType and not t instanceof SpecifiedType and not t instanceof Decltype and + not t instanceof TypeofType and + not t instanceof IntrinsicTransformedType and result = t } From e97f9495d086e37eea4685430dc6444754baaac5 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 11 Apr 2025 15:55:37 +0200 Subject: [PATCH 151/240] C++: Update expected test results --- cpp/ql/test/library-tests/declstmt/getDeclaration.expected | 2 ++ .../test/library-tests/declstmt/getDeclarationEntry.expected | 1 + cpp/ql/test/library-tests/enums/typedefs/exprs.expected | 3 ++- .../library-tests/syntax-zoo/dataflow-consistency.expected | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp/ql/test/library-tests/declstmt/getDeclaration.expected b/cpp/ql/test/library-tests/declstmt/getDeclaration.expected index 995816ef6775..4cfe46b88396 100644 --- a/cpp/ql/test/library-tests/declstmt/getDeclaration.expected +++ b/cpp/ql/test/library-tests/declstmt/getDeclaration.expected @@ -1,5 +1,7 @@ | cpp.cpp:3:5:3:51 | declaration | 0 | cpp.cpp:3:19:3:24 | twisty | | cpp.cpp:3:5:3:51 | declaration | 0 | cpp.cpp:3:43:3:48 | twisty | +| cpp.cpp:3:15:3:27 | declaration | 0 | cpp.cpp:3:19:3:24 | twisty | +| cpp.cpp:3:15:3:27 | declaration | 0 | cpp.cpp:3:43:3:48 | twisty | | cpp.cpp:5:5:5:62 | declaration | 0 | cpp.cpp:5:61:5:61 | i | | cpp.cpp:5:38:5:51 | declaration | 0 | cpp.cpp:5:44:5:44 | t | | declstmt.c:7:5:7:19 | declaration | 0 | declstmt.c:7:9:7:12 | fun1 | diff --git a/cpp/ql/test/library-tests/declstmt/getDeclarationEntry.expected b/cpp/ql/test/library-tests/declstmt/getDeclarationEntry.expected index 198e8ccf9fe4..ce2b3d3576e6 100644 --- a/cpp/ql/test/library-tests/declstmt/getDeclarationEntry.expected +++ b/cpp/ql/test/library-tests/declstmt/getDeclarationEntry.expected @@ -1,4 +1,5 @@ | cpp.cpp:3:5:3:51 | declaration | 0 | cpp.cpp:3:43:3:48 | declaration of twisty | +| cpp.cpp:3:15:3:27 | declaration | 0 | cpp.cpp:3:19:3:24 | declaration of twisty | | cpp.cpp:5:5:5:62 | declaration | 0 | cpp.cpp:5:61:5:61 | definition of i | | cpp.cpp:5:38:5:51 | declaration | 0 | cpp.cpp:5:44:5:44 | declaration of t | | declstmt.c:7:5:7:19 | declaration | 0 | declstmt.c:7:9:7:12 | definition of fun1 | diff --git a/cpp/ql/test/library-tests/enums/typedefs/exprs.expected b/cpp/ql/test/library-tests/enums/typedefs/exprs.expected index 7a9ce45b403e..0613d9e4c2f4 100644 --- a/cpp/ql/test/library-tests/enums/typedefs/exprs.expected +++ b/cpp/ql/test/library-tests/enums/typedefs/exprs.expected @@ -1,2 +1,3 @@ | file://:0:0:0:0 | 0 | file://:0:0:0:0 | int | -| test.c:7:20:7:21 | E | file://:0:0:0:0 | int | +| test.c:7:14:7:14 | E | file://:0:0:0:0 | int | +| test.c:7:20:7:21 | E | test.c:7:14:7:14 | typeof(...) | diff --git a/cpp/ql/test/library-tests/syntax-zoo/dataflow-consistency.expected b/cpp/ql/test/library-tests/syntax-zoo/dataflow-consistency.expected index 9fbef1167a4f..064c4e01e2bc 100644 --- a/cpp/ql/test/library-tests/syntax-zoo/dataflow-consistency.expected +++ b/cpp/ql/test/library-tests/syntax-zoo/dataflow-consistency.expected @@ -8,7 +8,10 @@ uniqueEnclosingCallable | misc.c:210:24:210:24 | 0 | Node should have one enclosing callable but has 0. | | misc.c:210:24:210:28 | ... + ... | Node should have one enclosing callable but has 0. | | misc.c:210:28:210:28 | 1 | Node should have one enclosing callable but has 0. | +| stmt_in_type.cpp:3:12:3:40 | (statement expression) | Node should have one enclosing callable but has 0. | +| stmt_in_type.cpp:3:29:3:34 | call to twisty | Node should have one enclosing callable but has 0. | uniqueCallEnclosingCallable +| stmt_in_type.cpp:3:29:3:34 | call to twisty | Call should have one enclosing callable but has 0. | uniqueType uniqueNodeLocation | file://:0:0:0:0 | (unnamed parameter 2) | Node should have one location but has 0. | From a3e0c15c10126e93bde706b3169c87c3bafba7a1 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 17 Apr 2025 13:26:12 +0200 Subject: [PATCH 152/240] C++: Add upgrade and downgrade scripts --- .../decltypes.ql | 11 + .../derivedtypes.ql | 19 + .../old.dbscheme | 2491 +++++++++++++++++ .../semmlecode.cpp.dbscheme | 2448 ++++++++++++++++ .../upgrade.properties | 5 + .../decltypes.ql | 11 + .../old.dbscheme | 2448 ++++++++++++++++ .../semmlecode.cpp.dbscheme | 2491 +++++++++++++++++ .../upgrade.properties | 3 + 9 files changed, 9927 insertions(+) create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/decltypes.ql create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/derivedtypes.ql create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/old.dbscheme create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/semmlecode.cpp.dbscheme create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/upgrade.properties create mode 100644 cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/decltypes.ql create mode 100644 cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme create mode 100644 cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme create mode 100644 cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/decltypes.ql b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/decltypes.ql new file mode 100644 index 000000000000..483f3b181901 --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/decltypes.ql @@ -0,0 +1,11 @@ +class Type extends @type { + string toString() { none() } +} + +class Expr extends @expr { + string toString() { none() } +} + +from Type decltype, Expr expr, Type basetype, boolean parentheses +where decltypes(decltype, expr, _, basetype, parentheses) +select decltype, expr, basetype, parentheses diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/derivedtypes.ql b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/derivedtypes.ql new file mode 100644 index 000000000000..8ab6ba525576 --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/derivedtypes.ql @@ -0,0 +1,19 @@ +class Type extends @type { + string toString() { none() } +} + +predicate derivedType(Type type, string name, int kind, Type type_id) { + derivedtypes(type, name, kind, type_id) +} + +predicate typeTransformation(Type type, string name, int kind, Type type_id) { + type_operators(type, _, _, type_id) and + name = "" and + kind = 3 // @type_with_specifiers +} + +from Type type, string name, int kind, Type type_id +where + derivedType(type, name, kind, type_id) or + typeTransformation(type, name, kind, type_id) +select type, name, kind, type_id diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/old.dbscheme b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/old.dbscheme new file mode 100644 index 000000000000..9a7c3c14c107 --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/old.dbscheme @@ -0,0 +1,2491 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: + * ``` + * int a; + * decltype(1+a) b; + * typeof(1+a) c; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * changes the semantics of the decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int kind: int ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @type_operator.kind of +| 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; +*/ + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type ref +) + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + | @routinetype + | @ptrtomember + | @decltype + | @type_operator; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/semmlecode.cpp.dbscheme b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..2e2d805ef93d --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/semmlecode.cpp.dbscheme @@ -0,0 +1,2448 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/upgrade.properties b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/upgrade.properties new file mode 100644 index 000000000000..48949a6e6e6f --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/upgrade.properties @@ -0,0 +1,5 @@ +description: Support C23 typeof and typeof_unqual +compatibility: backwards +decltypes.rel: run decltypes.qlo +derivedtypes.rel: run derivedtypes.qlo +type_operators.rel: delete diff --git a/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/decltypes.ql b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/decltypes.ql new file mode 100644 index 000000000000..6ca3c7e89362 --- /dev/null +++ b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/decltypes.ql @@ -0,0 +1,11 @@ +class Type extends @type { + string toString() { none() } +} + +class Expr extends @expr { + string toString() { none() } +} + +from Type decltype, Expr expr, Type basetype, boolean parentheses +where decltypes(decltype, expr, basetype, parentheses) +select decltype, expr, 0, basetype, parentheses diff --git a/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme new file mode 100644 index 000000000000..2e2d805ef93d --- /dev/null +++ b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme @@ -0,0 +1,2448 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..9a7c3c14c107 --- /dev/null +++ b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme @@ -0,0 +1,2491 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: + * ``` + * int a; + * decltype(1+a) b; + * typeof(1+a) c; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * changes the semantics of the decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int kind: int ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @type_operator.kind of +| 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; +*/ + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type ref +) + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + | @routinetype + | @ptrtomember + | @decltype + | @type_operator; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties new file mode 100644 index 000000000000..9f42c57a59bb --- /dev/null +++ b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties @@ -0,0 +1,3 @@ +description: Support C23 typeof and typeof_unqual +compatibility: partial +decltypes.rel: run decltypes.qlo From 0c313463b4f9a393e60c60fc6ee0c0b9bf766536 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 15:30:35 +0200 Subject: [PATCH 153/240] C++: Update stats file --- cpp/ql/lib/semmlecode.cpp.dbscheme.stats | 5827 ++++++++++++---------- 1 file changed, 3112 insertions(+), 2715 deletions(-) diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats index 1a4c6b8c5c97..201725ec5d17 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats @@ -2,7 +2,7 @@ @compilation - 16216 + 16209 @externalDataElement @@ -18,63 +18,63 @@ @location_default - 31650363 + 31651328 @location_stmt - 5202903 + 5201796 @location_expr - 17958919 + 17955097 @diagnostic - 1591 + 1590 @file - 83640 + 83605 @folder - 15890 + 15884 @macro_expansion - 40299816 + 40282895 @other_macro_reference - 314184 + 313754 @function - 3356874 + 3352272 @fun_decl - 3388838 + 3384193 @var_decl - 6733822 + 6734162 @type_decl - 1890806 + 1889998 @namespace_decl - 425650 + 425663 @using_declaration - 333262 + 333109 @using_directive - 8162 + 8151 @using_enum_declaration @@ -82,15 +82,15 @@ @static_assert - 183983 + 183988 @parameter - 4798867 + 4792289 @membervariable - 1441833 + 1441877 @globalvariable @@ -98,11 +98,11 @@ @localvariable - 735322 + 735182 @enumconstant - 330365 + 330375 @errortype @@ -330,71 +330,75 @@ @pointer - 472799 + 472813 @type_with_specifiers - 725882 + 725904 @array - 95663 + 95666 @routineptr - 862686 + 861504 @reference - 1024846 + 1024877 @gnu_vector - 867 + 866 @routinereference - 472 + 471 @rvalue_reference - 292102 + 292111 @block 10 + + @type_operator + 8530 + @decltype - 22068 + 102046 @usertype - 4987509 + 4985429 @mangledname - 5807194 + 5807372 @type_mention - 5507858 + 5508026 @concept_template - 3874 + 3873 @routinetype - 762068 + 761024 @ptrtomember - 12084 + 12079 @specifier - 8341 + 8342 @gnuattribute @@ -402,11 +406,11 @@ @stdattribute - 346324 + 346335 @declspec - 326924 + 326934 @msattribute @@ -418,11 +422,11 @@ @attribute_arg_token - 21051 + 21022 @attribute_arg_constant_expr - 89384 + 89401 @attribute_arg_expr @@ -442,19 +446,19 @@ @derivation - 599885 + 599063 @frienddecl - 883308 + 881497 @comment - 11290131 + 11290475 @namespace - 11095 + 11090 @specialnamequalifyingelement @@ -462,147 +466,147 @@ @namequalifier - 3258067 + 3257060 @value - 14099248 + 13198553 @initialiser - 2336670 + 2336741 @address_of - 595215 + 595216 @indirect - 399727 + 402982 @array_to_pointer - 1951447 + 1948138 @parexpr - 4895377 + 4901077 @arithnegexpr - 585842 + 584849 @unaryplusexpr - 4125 + 4124 @complementexpr - 38095 + 38088 @notexpr - 381104 + 357988 @postincrexpr - 84816 + 84819 @postdecrexpr - 57327 + 57229 @preincrexpr - 96450 + 96430 @predecrexpr - 35723 + 35715 @conditionalexpr - 896444 + 895300 @addexpr - 636624 + 569732 @subexpr - 466248 + 465458 @mulexpr - 487054 + 434352 @divexpr - 60353 + 60327 @remexpr - 19891 + 19864 @paddexpr - 118343 + 118322 @psubexpr - 68214 + 68216 @pdiffexpr - 46015 + 46016 @lshiftexpr - 610848 + 550128 @rshiftexpr - 223512 + 199984 @andexpr - 536665 + 479850 @orexpr - 218106 + 193504 @xorexpr - 74057 + 74060 @eqexpr - 641621 + 641484 @neexpr - 411384 + 410687 @gtexpr - 110846 + 110823 @ltexpr - 139049 + 139020 @geexpr - 80993 + 80996 @leexpr - 291234 + 291182 @assignexpr - 1277658 + 1277386 @assignaddexpr @@ -610,15 +614,15 @@ @assignsubexpr - 15266 + 15262 @assignmulexpr - 14129 + 14123 @assigndivexpr - 6826 + 6827 @assignremexpr @@ -634,19 +638,19 @@ @assignandexpr - 6661 + 6509 @assignorexpr - 21379 + 19572 @assignxorexpr - 29827 + 29822 @assignpaddexpr - 18577 + 18573 @assignpsubexpr @@ -654,23 +658,23 @@ @andlogicalexpr - 345646 + 345572 @orlogicalexpr - 1203317 + 1101612 @commaexpr - 167780 + 167785 @subscriptexpr - 433958 + 433866 @callexpr - 302370 + 301955 @vastartexpr @@ -678,7 +682,7 @@ @vaargexpr - 1300 + 1299 @vaendexpr @@ -690,39 +694,39 @@ @varaccess - 8226107 + 8230416 @runtime_sizeof - 397855 + 400615 @runtime_alignof - 61479 + 61395 @expr_stmt - 159816 + 147937 @routineexpr - 6144489 + 6142593 @type_operand - 1532453 + 1402930 @offsetofexpr - 167297 + 148600 @typescompexpr - 765411 + 700718 @literal - 6101411 + 6101426 @aggregateliteral @@ -730,27 +734,27 @@ @c_style_cast - 6024778 + 6024780 @temp_init - 1076142 + 1076374 @errorexpr - 57612 + 57533 @reference_to - 2194481 + 2191473 @ref_indirect - 2657402 + 2653759 @vacuous_destructor_call - 9881 + 9867 @assume @@ -806,35 +810,35 @@ @thisaccess - 1525359 + 1525406 @new_expr - 58257 + 58177 @delete_expr - 14478 + 14458 @throw_expr - 26260 + 26147 @condition_decl - 438294 + 438155 @braced_init_list - 2335 + 2334 @type_id - 60405 + 60322 @sizeof_pack - 2191 + 2188 @hasassignexpr @@ -918,15 +922,15 @@ @hastrivialdestructor - 558 + 557 @uuidof - 27727 + 27728 @delete_array_expr - 1598 + 1597 @new_array_expr @@ -934,19 +938,19 @@ @foldexpr - 1374 + 1372 @ctordirectinit - 142248 + 142053 @ctorvirtualinit - 5069 + 5062 @ctorfieldinit - 259364 + 259009 @ctordelegatinginit @@ -954,39 +958,39 @@ @dtordirectdestruct - 49707 + 49639 @dtorvirtualdestruct - 5026 + 5019 @dtorfielddestruct - 50223 + 50154 @static_cast - 335484 + 335397 @reinterpret_cast - 43189 + 43190 @const_cast - 47226 + 47227 @dynamic_cast - 1016 + 1015 @lambdaexpr - 17829 + 17804 @param_ref - 177994 + 177909 @noopexpr @@ -1014,11 +1018,11 @@ @isnothrowassignableexpr - 5381 + 5382 @istrivialexpr - 830 + 829 @isstandardlayoutexpr @@ -1050,7 +1054,7 @@ @isnothrowconstructibleexpr - 18567 + 18568 @hasfinalizerexpr @@ -1086,11 +1090,11 @@ @isfinalexpr - 1718 + 1716 @noexceptexpr - 30772 + 30758 @builtinshufflevector @@ -1098,7 +1102,7 @@ @builtinchooseexpr - 9758 + 20636 @builtinaddressof @@ -1142,7 +1146,7 @@ @builtinbitcast - 149 + 148 @builtinshuffle @@ -1154,7 +1158,7 @@ @issame - 4866 + 4864 @isfunction @@ -1262,7 +1266,7 @@ @reuseexpr - 907883 + 907596 @istriviallycopyassignable @@ -1358,11 +1362,11 @@ @c11_generic - 2901 + 30031 @requires_expr - 17688 + 17682 @nested_requirement @@ -1370,11 +1374,11 @@ @compound_requirement - 11738 + 11734 @concept_id - 96929 + 96899 @lambdacapture @@ -1382,71 +1386,71 @@ @stmt_expr - 2026085 + 2025654 @stmt_if - 987520 + 987309 @stmt_while - 39540 + 39531 @stmt_goto - 151171 + 151145 @stmt_label - 72506 + 72493 @stmt_return - 1515845 + 1513767 @stmt_block - 1897789 + 1897847 @stmt_end_test_while - 258278 + 232977 @stmt_for - 84159 + 84141 @stmt_switch_case - 896214 + 895930 @stmt_switch - 441453 + 441314 @stmt_asm - 72114 + 64016 @stmt_decl - 770907 + 770583 @stmt_empty - 460249 + 460103 @stmt_continue - 30631 + 28042 @stmt_break - 140998 + 141003 @stmt_try_block - 29068 + 28960 @stmt_microsoft_try @@ -1462,19 +1466,19 @@ @stmt_assigned_goto - 12392 + 12390 @stmt_range_based_for - 7432 + 7422 @stmt_handler - 47531 + 47453 @stmt_constexpr_if - 72386 + 72388 @stmt_co_return @@ -1490,43 +1494,43 @@ @ppd_if - 511548 + 511564 @ppd_ifdef - 227250 + 227257 @ppd_ifndef - 154177 + 154182 @ppd_elif - 28110 + 28098 @ppd_else - 241108 + 241116 @ppd_endif - 846302 + 846328 @ppd_plain_include - 408585 + 408414 @ppd_define - 3130376 + 3130472 @ppd_undef - 93375 + 93378 @ppd_pragma - 405256 + 405268 @ppd_include_next @@ -1534,7 +1538,7 @@ @ppd_line - 19068 + 19065 @ppd_error @@ -1562,7 +1566,7 @@ @link_target - 948 + 947 @xmldtd @@ -1592,11 +1596,11 @@ compilations - 16216 + 16209 id - 16216 + 16209 cwd @@ -1614,7 +1618,7 @@ 1 2 - 16216 + 16209 @@ -1640,19 +1644,19 @@ compilation_args - 1298248 + 1297703 id - 16216 + 16209 num - 1883 + 1882 arg - 37539 + 37523 @@ -1676,22 +1680,22 @@ 43 44 - 921 + 920 44 45 - 650 + 649 45 51 - 1219 + 1218 51 70 - 623 + 622 71 @@ -1711,7 +1715,7 @@ 98 99 - 1720 + 1719 100 @@ -1721,17 +1725,17 @@ 103 104 - 2560 + 2559 104 119 - 1368 + 1367 120 138 - 1192 + 1191 139 @@ -1757,7 +1761,7 @@ 38 39 - 1923 + 1922 39 @@ -1767,12 +1771,12 @@ 40 42 - 1395 + 1394 42 53 - 772 + 771 53 @@ -1797,7 +1801,7 @@ 68 70 - 1246 + 1245 70 @@ -1807,12 +1811,12 @@ 73 79 - 1219 + 1218 79 89 - 1449 + 1448 89 @@ -1838,7 +1842,7 @@ 90 108 - 149 + 148 108 @@ -1848,7 +1852,7 @@ 198 422 - 149 + 148 422 @@ -1863,17 +1867,17 @@ 605 749 - 149 + 148 750 778 - 149 + 148 781 883 - 149 + 148 930 @@ -1904,7 +1908,7 @@ 5 7 - 149 + 148 9 @@ -1914,7 +1918,7 @@ 12 15 - 149 + 148 15 @@ -1924,7 +1928,7 @@ 18 22 - 149 + 148 22 @@ -1939,7 +1943,7 @@ 29 34 - 149 + 148 34 @@ -1949,17 +1953,17 @@ 45 63 - 149 + 148 67 94 - 149 + 148 94 164 - 149 + 148 171 @@ -1980,17 +1984,17 @@ 1 2 - 17191 + 17184 2 3 - 16270 + 16263 3 103 - 2817 + 2816 104 @@ -2011,17 +2015,17 @@ 1 2 - 24859 + 24848 2 3 - 11190 + 11185 3 62 - 1490 + 1489 @@ -2031,11 +2035,11 @@ compilation_build_mode - 16216 + 16209 id - 16216 + 16209 mode @@ -2053,7 +2057,7 @@ 1 2 - 16216 + 16209 @@ -2079,11 +2083,11 @@ compilation_compiling_files - 16216 + 16209 id - 16216 + 16209 num @@ -2091,7 +2095,7 @@ file - 7423 + 7420 @@ -2105,7 +2109,7 @@ 1 2 - 16216 + 16209 @@ -2121,7 +2125,7 @@ 1 2 - 16216 + 16209 @@ -2174,7 +2178,7 @@ 2 3 - 7220 + 7217 28 @@ -2195,7 +2199,7 @@ 1 2 - 7423 + 7420 @@ -2205,11 +2209,11 @@ compilation_time - 64593 + 64566 id - 16148 + 16141 num @@ -2221,7 +2225,7 @@ seconds - 17652 + 17604 @@ -2235,7 +2239,7 @@ 1 2 - 16148 + 16141 @@ -2251,7 +2255,7 @@ 4 5 - 16148 + 16141 @@ -2267,17 +2271,17 @@ 2 3 - 203 + 189 3 4 - 8250 + 8179 4 5 - 7694 + 7772 @@ -2323,8 +2327,8 @@ 12 - 1303 - 1304 + 1300 + 1301 13 @@ -2371,23 +2375,23 @@ 12 - 8 - 9 + 9 + 10 13 - 10 - 11 + 11 + 12 13 - 710 - 711 + 716 + 717 13 - 769 - 770 + 775 + 776 13 @@ -2404,27 +2408,27 @@ 1 2 - 11162 + 11293 2 3 - 3508 + 3493 3 4 - 1598 + 1340 4 - 55 + 20 1327 - 77 - 700 - 54 + 21 + 699 + 148 @@ -2440,7 +2444,7 @@ 1 2 - 17652 + 17604 @@ -2456,16 +2460,16 @@ 1 2 - 15051 + 14760 2 3 - 2587 + 2830 - 4 - 5 + 3 + 4 13 @@ -2476,11 +2480,11 @@ diagnostic_for - 4450 + 4449 diagnostic - 1591 + 1590 compilation @@ -2506,7 +2510,7 @@ 1 2 - 1545 + 1544 63 @@ -2527,7 +2531,7 @@ 1 2 - 1591 + 1590 @@ -2543,7 +2547,7 @@ 1 2 - 1591 + 1590 @@ -2722,15 +2726,15 @@ compilation_finished - 16216 + 16209 id - 16216 + 16209 cpu_seconds - 12165 + 11821 elapsed_seconds @@ -2748,7 +2752,7 @@ 1 2 - 16216 + 16209 @@ -2764,7 +2768,7 @@ 1 2 - 16216 + 16209 @@ -2780,17 +2784,17 @@ 1 2 - 10241 + 9736 2 3 - 1408 + 1530 3 - 38 - 514 + 36 + 555 @@ -2806,7 +2810,7 @@ 1 2 - 11311 + 10968 2 @@ -2832,16 +2836,16 @@ 2 3 - 13 + 27 - 3 - 4 + 5 + 6 13 - 4 - 5 + 7 + 8 13 @@ -2855,23 +2859,18 @@ 13 - 10 - 11 - 27 - - - 13 - 14 + 11 + 12 13 19 20 - 13 + 27 - 28 - 29 + 23 + 24 13 @@ -2880,23 +2879,23 @@ 13 - 142 - 143 + 136 + 137 13 - 272 - 273 + 269 + 270 13 - 296 - 297 + 314 + 315 13 - 336 - 337 + 328 + 329 13 @@ -2918,16 +2917,16 @@ 2 3 - 13 + 27 - 3 - 4 + 5 + 6 13 - 4 - 5 + 7 + 8 13 @@ -2941,48 +2940,43 @@ 13 - 10 - 11 - 27 - - - 13 - 14 + 11 + 12 13 19 20 - 13 + 27 - 28 - 29 + 23 + 24 13 - 42 - 43 + 40 + 41 13 - 136 - 137 + 127 + 128 13 - 183 - 184 + 156 + 157 13 - 245 - 246 + 240 + 241 13 - 246 - 247 + 265 + 266 13 @@ -4755,31 +4749,31 @@ locations_default - 31650363 + 31651328 id - 31650363 + 31651328 container - 41844 + 41845 startLine - 7709289 + 7709525 startColumn - 22469 + 22470 endLine - 7708617 + 7708852 endColumn - 56240 + 56242 @@ -4793,7 +4787,7 @@ 1 2 - 31650363 + 31651328 @@ -4809,7 +4803,7 @@ 1 2 - 31650363 + 31651328 @@ -4825,7 +4819,7 @@ 1 2 - 31650363 + 31651328 @@ -4841,7 +4835,7 @@ 1 2 - 31650363 + 31651328 @@ -4857,7 +4851,7 @@ 1 2 - 31650363 + 31651328 @@ -4933,7 +4927,7 @@ 2212 55160 - 2690 + 2691 @@ -5258,27 +5252,27 @@ 1 2 - 5187066 + 5187224 2 3 - 787639 + 787663 3 4 - 633852 + 633871 4 10 - 618379 + 618398 10 414 - 482351 + 482366 @@ -5294,27 +5288,27 @@ 1 2 - 5247612 + 5247772 2 3 - 1198816 + 1198852 3 5 - 636004 + 636024 5 54 - 579764 + 579781 54 312 - 47091 + 47092 @@ -5330,27 +5324,27 @@ 1 2 - 5929498 + 5929679 2 3 - 579495 + 579512 3 5 - 581378 + 581396 5 42 - 579495 + 579512 42 71 - 39422 + 39423 @@ -5366,12 +5360,12 @@ 1 2 - 7558596 + 7558827 2 82 - 150692 + 150697 @@ -5387,27 +5381,27 @@ 1 2 - 5256089 + 5256249 2 3 - 764363 + 764386 3 4 - 626990 + 627009 4 10 - 600619 + 600637 10 225 - 461228 + 461242 @@ -5803,27 +5797,27 @@ 1 2 - 5183433 + 5183591 2 3 - 792752 + 792776 3 4 - 630892 + 630911 4 9 - 579495 + 579512 9 412 - 522043 + 522059 @@ -5839,27 +5833,27 @@ 1 2 - 5242903 + 5243063 2 3 - 1200968 + 1201005 3 5 - 638830 + 638849 5 54 - 579629 + 579647 54 312 - 46284 + 46285 @@ -5875,12 +5869,12 @@ 1 2 - 7545276 + 7545506 2 7 - 163340 + 163345 @@ -5896,27 +5890,27 @@ 1 2 - 5929632 + 5929813 2 3 - 578956 + 578974 3 5 - 581513 + 581531 5 42 - 578956 + 578974 42 71 - 39556 + 39558 @@ -5932,27 +5926,27 @@ 1 2 - 5253129 + 5253289 2 3 - 768803 + 768826 3 4 - 624030 + 624049 4 10 - 600484 + 600502 10 225 - 462169 + 462183 @@ -5968,7 +5962,7 @@ 1 2 - 15203 + 15204 2 @@ -6034,7 +6028,7 @@ 1 2 - 17356 + 17357 2 @@ -6054,7 +6048,7 @@ 6 8 - 4170 + 4171 8 @@ -6206,7 +6200,7 @@ 60 69 - 4170 + 4171 @@ -6282,19 +6276,19 @@ locations_stmt - 5202903 + 5201796 id - 5202903 + 5201796 container - 4153 + 4152 startLine - 272851 + 272793 startColumn @@ -6302,11 +6296,11 @@ endLine - 265022 + 264966 endColumn - 3227 + 3226 @@ -6320,7 +6314,7 @@ 1 2 - 5202903 + 5201796 @@ -6336,7 +6330,7 @@ 1 2 - 5202903 + 5201796 @@ -6352,7 +6346,7 @@ 1 2 - 5202903 + 5201796 @@ -6368,7 +6362,7 @@ 1 2 - 5202903 + 5201796 @@ -6384,7 +6378,7 @@ 1 2 - 5202903 + 5201796 @@ -6785,67 +6779,67 @@ 1 2 - 29409 + 29403 2 3 - 20878 + 20874 3 4 - 17033 + 17030 4 6 - 19727 + 19723 6 8 - 17090 + 17086 8 11 - 22814 + 22809 11 16 - 23572 + 23567 16 22 - 20934 + 20930 22 29 - 23235 + 23230 29 37 - 23684 + 23679 37 45 - 20625 + 20621 45 56 - 22141 + 22136 56 73 - 11702 + 11699 @@ -6861,67 +6855,67 @@ 1 2 - 30447 + 30441 2 3 - 21467 + 21463 3 4 - 17314 + 17310 4 6 - 19643 + 19639 6 8 - 17370 + 17367 8 11 - 23993 + 23988 11 16 - 22337 + 22333 16 22 - 22141 + 22136 22 29 - 23151 + 23146 29 36 - 21860 + 21856 36 44 - 22309 + 22304 44 54 - 21664 + 21659 54 68 - 9148 + 9146 @@ -6937,57 +6931,57 @@ 1 2 - 36621 + 36613 2 3 - 28455 + 28449 3 4 - 22955 + 22950 4 5 - 21972 + 21968 5 6 - 23797 + 23791 6 7 - 27108 + 27102 7 8 - 31065 + 31058 8 9 - 27894 + 27888 9 10 - 20429 + 20425 10 12 - 22702 + 22697 12 18 - 9849 + 9847 @@ -7003,67 +6997,67 @@ 1 2 - 47229 + 47219 2 3 - 35218 + 35210 3 4 - 25172 + 25166 4 5 - 22113 + 22108 5 6 - 17454 + 17451 6 7 - 16472 + 16469 7 8 - 13919 + 13916 8 9 - 15069 + 15066 9 10 - 14732 + 14729 10 11 - 14396 + 14393 11 12 - 13862 + 13859 12 14 - 21580 + 21575 14 24 - 15630 + 15627 @@ -7079,62 +7073,62 @@ 1 2 - 30223 + 30216 2 3 - 22113 + 22108 3 4 - 17679 + 17675 4 6 - 21944 + 21940 6 8 - 20064 + 20060 8 10 - 18016 + 18012 10 14 - 24947 + 24942 14 18 - 23235 + 23230 18 22 - 24077 + 24072 22 26 - 25228 + 25222 26 30 - 22534 + 22529 30 36 - 20682 + 20677 36 @@ -7525,67 +7519,67 @@ 1 2 - 23768 + 23763 2 3 - 19671 + 19667 3 4 - 15686 + 15683 4 6 - 21299 + 21294 6 8 - 17062 + 17058 8 11 - 21103 + 21098 11 15 - 20008 + 20004 15 21 - 21944 + 21940 21 27 - 21074 + 21070 27 34 - 20373 + 20369 34 42 - 21552 + 21547 42 51 - 19924 + 19920 51 68 - 20261 + 20256 68 @@ -7606,62 +7600,62 @@ 1 2 - 34067 + 34060 2 3 - 22029 + 22024 3 4 - 17426 + 17423 4 6 - 21383 + 21379 6 8 - 20485 + 20481 8 11 - 21692 + 21687 11 16 - 23797 + 23791 16 20 - 19924 + 19920 20 26 - 23432 + 23427 26 32 - 22225 + 22220 32 39 - 20457 + 20453 39 58 - 18100 + 18096 @@ -7677,62 +7671,62 @@ 1 2 - 44338 + 44329 2 3 - 32412 + 32405 3 4 - 25200 + 25194 4 5 - 20794 + 20789 5 6 - 18858 + 18854 6 7 - 15855 + 15851 7 8 - 16248 + 16244 8 9 - 14929 + 14926 9 10 - 13919 + 13916 10 12 - 24442 + 24437 12 15 - 24189 + 24184 15 100 - 13834 + 13831 @@ -7748,57 +7742,57 @@ 1 2 - 34067 + 34060 2 3 - 27838 + 27832 3 4 - 22983 + 22978 4 5 - 24330 + 24325 5 6 - 25340 + 25335 6 7 - 27950 + 27944 7 8 - 30616 + 30609 8 9 - 25593 + 25587 9 10 - 17623 + 17619 10 12 - 20457 + 20453 12 18 - 8222 + 8220 @@ -7814,67 +7808,67 @@ 1 2 - 33731 + 33723 2 3 - 22702 + 22697 3 4 - 17118 + 17114 4 6 - 24330 + 24325 6 8 - 20934 + 20930 8 10 - 17482 + 17479 10 13 - 19699 + 19695 13 16 - 20513 + 20509 16 19 - 20064 + 20060 19 22 - 18970 + 18966 22 26 - 23684 + 23679 26 31 - 20962 + 20958 31 39 - 4826 + 4825 @@ -8274,31 +8268,31 @@ locations_expr - 17958919 + 17955097 id - 17958919 + 17955097 container - 6342 + 6340 startLine - 262019 + 261964 startColumn - 3367 + 3366 endLine - 261991 + 261935 endColumn - 3816 + 3815 @@ -8312,7 +8306,7 @@ 1 2 - 17958919 + 17955097 @@ -8328,7 +8322,7 @@ 1 2 - 17958919 + 17955097 @@ -8344,7 +8338,7 @@ 1 2 - 17958919 + 17955097 @@ -8360,7 +8354,7 @@ 1 2 - 17958919 + 17955097 @@ -8376,7 +8370,7 @@ 1 2 - 17958919 + 17955097 @@ -8397,12 +8391,12 @@ 2 6 - 477 + 476 6 11 - 477 + 476 12 @@ -8412,47 +8406,47 @@ 27 87 - 477 + 476 95 514 - 477 + 476 525 1401 - 477 + 476 1526 2343 - 477 + 476 2404 3615 - 477 + 476 3668 5162 - 477 + 476 5341 7345 - 477 + 476 7399 9307 - 477 + 476 9382 16759 - 477 + 476 18811 @@ -8478,7 +8472,7 @@ 2 4 - 477 + 476 4 @@ -8493,42 +8487,42 @@ 20 66 - 477 + 476 67 162 - 477 + 476 166 362 - 477 + 476 376 591 - 477 + 476 593 929 - 477 + 476 960 1269 - 477 + 476 1291 1782 - 477 + 476 1851 2492 - 477 + 476 2594 @@ -8564,7 +8558,7 @@ 7 16 - 477 + 476 16 @@ -8574,7 +8568,7 @@ 36 59 - 477 + 476 59 @@ -8640,7 +8634,7 @@ 2 4 - 477 + 476 4 @@ -8655,42 +8649,42 @@ 20 68 - 477 + 476 68 163 - 477 + 476 166 362 - 477 + 476 376 592 - 477 + 476 593 931 - 477 + 476 960 1273 - 477 + 476 1292 1786 - 477 + 476 1855 2501 - 477 + 476 2593 @@ -8716,7 +8710,7 @@ 2 4 - 477 + 476 4 @@ -8726,17 +8720,17 @@ 7 15 - 477 + 476 15 36 - 477 + 476 36 62 - 477 + 476 62 @@ -8751,7 +8745,7 @@ 73 75 - 449 + 448 75 @@ -8766,12 +8760,12 @@ 77 79 - 477 + 476 79 84 - 477 + 476 84 @@ -8792,67 +8786,67 @@ 1 5 - 22001 + 21996 5 9 - 22506 + 22501 9 15 - 21888 + 21884 15 23 - 20625 + 20621 23 32 - 20682 + 20677 32 44 - 20485 + 20481 44 60 - 20148 + 20144 60 80 - 20289 + 20284 80 103 - 19952 + 19948 103 130 - 20092 + 20088 130 159 - 19896 + 19892 159 194 - 19952 + 19948 194 297 - 13498 + 13495 @@ -8868,62 +8862,62 @@ 1 2 - 32103 + 32096 2 3 - 21327 + 21322 3 4 - 15490 + 15487 4 6 - 22337 + 22333 6 8 - 18605 + 18601 8 11 - 22421 + 22417 11 16 - 23684 + 23679 16 21 - 22506 + 22501 21 28 - 22674 + 22669 28 35 - 21636 + 21631 35 43 - 21776 + 21771 43 61 - 17454 + 17451 @@ -8939,62 +8933,62 @@ 1 4 - 21804 + 21799 4 7 - 23937 + 23932 7 11 - 22786 + 22781 11 16 - 23768 + 23763 16 21 - 23909 + 23904 21 26 - 20569 + 20565 26 31 - 22085 + 22080 31 36 - 24105 + 24100 36 40 - 21467 + 21463 40 44 - 22618 + 22613 44 49 - 22758 + 22753 49 63 - 12207 + 12204 @@ -9010,27 +9004,27 @@ 1 2 - 138965 + 138936 2 3 - 61120 + 61107 3 4 - 37687 + 37679 4 6 - 19980 + 19976 6 23 - 4265 + 4264 @@ -9046,62 +9040,62 @@ 1 4 - 23151 + 23146 4 7 - 22730 + 22725 7 11 - 22421 + 22417 11 16 - 22141 + 22136 16 21 - 22450 + 22445 21 27 - 22870 + 22866 27 33 - 22478 + 22473 33 38 - 19756 + 19751 38 43 - 21299 + 21294 43 47 - 19952 + 19948 47 52 - 23039 + 23034 52 66 - 19671 + 19667 68 @@ -9198,7 +9192,7 @@ 1 2 - 449 + 448 2 @@ -9426,7 +9420,7 @@ 1 2 - 449 + 448 2 @@ -9502,67 +9496,67 @@ 1 5 - 22029 + 22024 5 9 - 22506 + 22501 9 15 - 21580 + 21575 15 23 - 20597 + 20593 23 32 - 21355 + 21351 32 44 - 20120 + 20116 44 60 - 19784 + 19779 60 80 - 20878 + 20874 80 103 - 19812 + 19807 103 130 - 20008 + 20004 130 159 - 19952 + 19948 159 193 - 19671 + 19667 193 296 - 13694 + 13691 @@ -9578,67 +9572,67 @@ 1 2 - 32103 + 32096 2 3 - 21243 + 21238 3 4 - 15490 + 15487 4 6 - 21916 + 21912 6 8 - 18409 + 18405 8 11 - 22506 + 22501 11 15 - 19784 + 19779 15 20 - 22814 + 22809 20 26 - 20457 + 20453 26 33 - 21916 + 21912 33 40 - 19896 + 19892 40 49 - 20036 + 20032 49 61 - 5416 + 5414 @@ -9654,27 +9648,27 @@ 1 2 - 130266 + 130238 2 3 - 68219 + 68205 3 4 - 40157 + 40148 4 6 - 21383 + 21379 6 11 - 1964 + 1963 @@ -9690,62 +9684,62 @@ 1 4 - 21608 + 21603 4 7 - 23825 + 23820 7 11 - 22506 + 22501 11 16 - 23684 + 23679 16 21 - 23628 + 23623 21 26 - 20682 + 20677 26 31 - 22281 + 22276 31 36 - 24077 + 24072 36 40 - 20878 + 20874 40 44 - 22590 + 22585 44 49 - 23151 + 23146 49 63 - 13077 + 13074 @@ -9761,62 +9755,62 @@ 1 4 - 23460 + 23455 4 7 - 22927 + 22922 7 11 - 22421 + 22417 11 16 - 23039 + 23034 16 21 - 21860 + 21856 21 26 - 19812 + 19807 26 32 - 22057 + 22052 32 38 - 23881 + 23876 38 43 - 22113 + 22108 43 47 - 19784 + 19779 47 52 - 22758 + 22753 52 69 - 17875 + 17872 @@ -9908,7 +9902,7 @@ 1 2 - 449 + 448 2 @@ -10201,19 +10195,19 @@ numlines - 860968 + 860994 element_id - 859622 + 859648 num_lines - 40095 + 40096 num_code - 35924 + 35925 num_comment @@ -10231,7 +10225,7 @@ 1 2 - 858277 + 858303 2 @@ -10252,7 +10246,7 @@ 1 2 - 858277 + 858303 2 @@ -10273,7 +10267,7 @@ 1 2 - 859353 + 859379 2 @@ -10294,7 +10288,7 @@ 1 2 - 26909 + 26910 2 @@ -10330,7 +10324,7 @@ 1 2 - 27178 + 27179 2 @@ -10407,7 +10401,7 @@ 1 2 - 23814 + 23815 2 @@ -10443,7 +10437,7 @@ 1 2 - 24083 + 24084 2 @@ -10458,7 +10452,7 @@ 5 8 - 2690 + 2691 8 @@ -10479,7 +10473,7 @@ 1 2 - 23949 + 23950 2 @@ -10632,11 +10626,11 @@ diagnostics - 1591 + 1590 id - 1591 + 1590 severity @@ -10670,7 +10664,7 @@ 1 2 - 1591 + 1590 @@ -10686,7 +10680,7 @@ 1 2 - 1591 + 1590 @@ -10702,7 +10696,7 @@ 1 2 - 1591 + 1590 @@ -10718,7 +10712,7 @@ 1 2 - 1591 + 1590 @@ -10734,7 +10728,7 @@ 1 2 - 1591 + 1590 @@ -11189,15 +11183,15 @@ files - 83640 + 83605 id - 83640 + 83605 name - 83640 + 83605 @@ -11211,7 +11205,7 @@ 1 2 - 83640 + 83605 @@ -11227,7 +11221,7 @@ 1 2 - 83640 + 83605 @@ -11237,15 +11231,15 @@ folders - 15890 + 15884 id - 15890 + 15884 name - 15890 + 15884 @@ -11259,7 +11253,7 @@ 1 2 - 15890 + 15884 @@ -11275,7 +11269,7 @@ 1 2 - 15890 + 15884 @@ -11285,15 +11279,15 @@ containerparent - 99504 + 99462 parent - 15890 + 15884 child - 99504 + 99462 @@ -11307,12 +11301,12 @@ 1 2 - 7735 + 7732 2 3 - 1950 + 1949 3 @@ -11327,7 +11321,7 @@ 6 10 - 1246 + 1245 10 @@ -11337,7 +11331,7 @@ 16 44 - 1192 + 1191 44 @@ -11358,7 +11352,7 @@ 1 2 - 99504 + 99462 @@ -11368,11 +11362,11 @@ fileannotations - 5387560 + 5385298 id - 7396 + 7393 kind @@ -11380,11 +11374,11 @@ name - 75309 + 75277 value - 50680 + 50659 @@ -11403,7 +11397,7 @@ 2 3 - 7139 + 7136 @@ -11449,7 +11443,7 @@ 480 549 - 325 + 324 550 @@ -11629,62 +11623,62 @@ 1 2 - 14143 + 14137 2 3 - 5595 + 5592 3 5 - 6489 + 6486 5 7 - 5256 + 5254 7 9 - 5893 + 5890 9 16 - 5554 + 5552 16 19 - 6272 + 6269 19 27 - 5459 + 5457 27 47 - 6204 + 6202 47 128 - 6313 + 6310 128 459 - 5933 + 5931 459 546 - 2194 + 2193 @@ -11700,7 +11694,7 @@ 1 2 - 75309 + 75277 @@ -11716,57 +11710,57 @@ 1 2 - 14861 + 14855 2 3 - 9862 + 9858 3 4 - 5256 + 5254 4 6 - 5215 + 5213 6 8 - 4389 + 4387 8 11 - 6082 + 6080 11 17 - 6922 + 6919 17 23 - 6028 + 6026 23 41 - 6001 + 5998 41 95 - 5730 + 5728 95 1726 - 4958 + 4956 @@ -11782,72 +11776,72 @@ 1 2 - 4308 + 4306 2 4 - 2099 + 2098 4 5 - 4091 + 4089 5 8 - 3156 + 3155 8 14 - 3806 + 3805 14 17 - 2479 + 2478 17 24 - 3901 + 3899 24 51 - 4538 + 4536 51 58 - 3888 + 3886 58 80 - 3820 + 3818 81 151 - 3955 + 3954 151 334 - 3820 + 3818 334 473 - 3847 + 3845 473 547 - 2966 + 2965 @@ -11863,7 +11857,7 @@ 1 2 - 50666 + 50645 2 @@ -11884,67 +11878,67 @@ 1 2 - 4362 + 4360 2 4 - 2452 + 2451 4 5 - 3915 + 3913 5 8 - 3183 + 3182 8 14 - 4470 + 4468 14 18 - 4429 + 4428 18 28 - 4104 + 4103 28 34 - 4037 + 4035 34 41 - 4104 + 4103 41 66 - 3833 + 3832 66 92 - 3942 + 3940 92 113 - 3833 + 3832 113 145 - 3888 + 3886 145 @@ -11959,15 +11953,15 @@ inmacroexpansion - 149742219 + 149563577 id - 24596888 + 24598516 inv - 3698096 + 3693134 @@ -11981,37 +11975,37 @@ 1 3 - 2167547 + 2201563 3 5 - 1469286 + 1470740 5 6 - 1617555 + 1615714 6 7 - 6573991 + 6563635 7 8 - 8708717 + 8693954 8 9 - 3552853 + 3546830 9 22 - 506936 + 506076 @@ -12027,57 +12021,57 @@ 1 2 - 529537 + 528641 2 3 - 743634 + 741073 3 4 - 479644 + 480129 4 7 - 273727 + 274512 7 8 - 282495 + 281342 8 9 - 329912 + 329298 9 10 - 2984 + 3037 10 11 - 443915 + 443373 11 337 - 306934 + 306914 339 423 - 281411 + 280946 423 7616 - 23899 + 23866 @@ -12087,15 +12081,15 @@ affectedbymacroexpansion - 48676725 + 48595837 id - 7035600 + 7024503 inv - 3798613 + 3792196 @@ -12109,37 +12103,37 @@ 1 2 - 3842142 + 3835659 2 3 - 764599 + 764103 3 4 - 361415 + 360802 4 5 - 771825 + 770516 5 12 - 534529 + 533623 12 50 - 555611 + 554669 50 9900 - 205476 + 205128 @@ -12155,67 +12149,67 @@ 1 4 - 312858 + 312348 4 7 - 316262 + 315698 7 9 - 300716 + 300223 9 12 - 342528 + 341953 12 13 - 455466 + 454694 13 14 - 225832 + 225450 14 15 - 407557 + 406866 15 16 - 166232 + 165950 16 17 - 377232 + 376592 17 18 - 200400 + 200060 18 20 - 343849 + 343266 20 25 - 285056 + 284573 25 - 109 - 64618 + 207 + 64516 @@ -12225,19 +12219,19 @@ macroinvocations - 40601906 + 40584859 id - 40601906 + 40584859 macro_id - 109909 + 109862 location - 1070112 + 1069663 kind @@ -12255,7 +12249,7 @@ 1 2 - 40601906 + 40584859 @@ -12271,7 +12265,7 @@ 1 2 - 40601906 + 40584859 @@ -12287,7 +12281,7 @@ 1 2 - 40601906 + 40584859 @@ -12303,52 +12297,52 @@ 1 2 - 23518 + 23508 2 3 - 20429 + 20420 3 4 - 7491 + 7488 4 6 - 10106 + 10102 6 11 - 9455 + 9452 11 21 - 9185 + 9181 21 48 - 8250 + 8246 48 145 - 8304 + 8300 145 952 - 8250 + 8246 954 175299 - 4917 + 4915 @@ -12364,37 +12358,37 @@ 1 2 - 60258 + 60232 2 3 - 13642 + 13636 3 4 - 6882 + 6879 4 6 - 8724 + 8720 6 13 - 9442 + 9438 13 67 - 8290 + 8287 67 4815 - 2668 + 2667 @@ -12410,12 +12404,12 @@ 1 2 - 101455 + 101412 2 3 - 8453 + 8449 @@ -12431,37 +12425,37 @@ 1 2 - 426617 + 426438 2 3 - 252710 + 252604 3 4 - 113201 + 113153 4 6 - 77503 + 77471 6 11 - 82760 + 82725 11 42 - 80457 + 80423 42 226288 - 36862 + 36846 @@ -12477,12 +12471,12 @@ 1 2 - 1009664 + 1009240 2 367 - 60447 + 60422 @@ -12498,7 +12492,7 @@ 1 2 - 1070112 + 1069663 @@ -12571,15 +12565,15 @@ macroparent - 35811564 + 35796528 id - 35811564 + 35796528 parent_id - 28060505 + 28048724 @@ -12593,7 +12587,7 @@ 1 2 - 35811564 + 35796528 @@ -12609,17 +12603,17 @@ 1 2 - 21858334 + 21849156 2 3 - 5174353 + 5172181 3 91 - 1027818 + 1027386 @@ -12629,15 +12623,15 @@ macrolocationbind - 5543848 + 5543165 id - 3882182 + 3881794 location - 2758856 + 2758367 @@ -12651,22 +12645,22 @@ 1 2 - 3056758 + 3056516 2 3 - 469908 + 469825 3 7 - 314961 + 314905 7 57 - 40553 + 40546 @@ -12682,22 +12676,22 @@ 1 2 - 2198772 + 2198082 2 3 - 239729 + 239987 3 8 - 216594 + 216556 8 723 - 103759 + 103740 @@ -12707,19 +12701,19 @@ macro_argument_unexpanded - 103253896 + 103210542 invocation - 31226557 + 31213446 argument_index - 894 + 893 text - 440272 + 440087 @@ -12733,22 +12727,22 @@ 1 2 - 9979611 + 9975421 2 3 - 12505256 + 12500006 3 4 - 6395613 + 6392927 4 67 - 2346075 + 2345090 @@ -12764,22 +12758,22 @@ 1 2 - 10213857 + 10209569 2 3 - 12526756 + 12521496 3 4 - 6195695 + 6193094 4 67 - 2290247 + 2289286 @@ -12847,57 +12841,57 @@ 1 2 - 52021 + 51999 2 3 - 79996 + 79963 3 4 - 29682 + 29669 4 5 - 44448 + 44429 5 6 - 50219 + 50198 6 9 - 36591 + 36575 9 15 - 36848 + 36833 15 27 - 33515 + 33501 27 57 - 34125 + 34111 57 517 - 33245 + 33231 518 485091 - 9577 + 9573 @@ -12913,17 +12907,17 @@ 1 2 - 311898 + 311767 2 3 - 115273 + 115225 3 9 - 13100 + 13094 @@ -12933,19 +12927,19 @@ macro_argument_expanded - 103253896 + 103210542 invocation - 31226557 + 31213446 argument_index - 894 + 893 text - 266691 + 266579 @@ -12959,22 +12953,22 @@ 1 2 - 9979611 + 9975421 2 3 - 12505256 + 12500006 3 4 - 6395613 + 6392927 4 67 - 2346075 + 2345090 @@ -12990,22 +12984,22 @@ 1 2 - 13763324 + 13757545 2 3 - 10789914 + 10785384 3 4 - 5404074 + 5401805 4 9 - 1269243 + 1268711 @@ -13047,7 +13041,7 @@ 1 2 - 772 + 771 2 @@ -13073,57 +13067,57 @@ 1 2 - 28300 + 28288 2 3 - 35155 + 35140 3 4 - 58510 + 58486 4 5 - 20564 + 20556 5 6 - 3996 + 3994 6 7 - 23314 + 23305 7 10 - 21770 + 21761 10 19 - 22949 + 22939 19 51 - 20077 + 20068 51 253 - 20090 + 20082 254 990266 - 11962 + 11957 @@ -13139,17 +13133,17 @@ 1 2 - 134781 + 134725 2 3 - 114040 + 113993 3 66 - 17868 + 17861 @@ -13159,15 +13153,15 @@ functions - 3356874 + 3352272 id - 3356874 + 3352272 name - 466658 + 466018 kind @@ -13185,7 +13179,7 @@ 1 2 - 3356874 + 3352272 @@ -13201,7 +13195,7 @@ 1 2 - 3356874 + 3352272 @@ -13217,22 +13211,22 @@ 1 2 - 372699 + 372188 2 3 - 31835 + 31791 3 9 - 36045 + 35996 9 4916 - 26078 + 26042 @@ -13248,12 +13242,12 @@ 1 2 - 465412 + 464774 2 4 - 1245 + 1244 @@ -13365,15 +13359,15 @@ function_entry_point - 1438642 + 1436670 id - 1433916 + 1431950 entry_point - 1438642 + 1436670 @@ -13387,12 +13381,12 @@ 1 2 - 1429877 + 1427917 2 17 - 4038 + 4032 @@ -13408,7 +13402,7 @@ 1 2 - 1438642 + 1436670 @@ -13418,15 +13412,15 @@ function_return_type - 3363190 + 3358579 id - 3356874 + 3352272 return_type - 631806 + 630940 @@ -13440,12 +13434,12 @@ 1 2 - 3351074 + 3346480 2 5 - 5799 + 5791 @@ -13461,22 +13455,22 @@ 1 2 - 436971 + 436372 2 3 - 120423 + 120258 3 6 - 52070 + 51999 6 36283 - 22340 + 22309 @@ -13756,44 +13750,44 @@ purefunctions - 137885 + 137889 id - 137885 + 137889 function_deleted - 94416 + 94386 id - 94416 + 94386 function_defaulted - 55395 + 55377 id - 55395 + 55377 function_prototyped - 3352750 + 3348154 id - 3352750 + 3348154 @@ -13873,15 +13867,15 @@ member_function_this_type - 674425 + 673500 id - 674425 + 673500 this_type - 233544 + 233223 @@ -13895,7 +13889,7 @@ 1 2 - 674425 + 673500 @@ -13911,32 +13905,32 @@ 1 2 - 82831 + 82718 2 3 - 61135 + 61051 3 4 - 36518 + 36468 4 5 - 16927 + 16904 5 7 - 19204 + 19177 7 66 - 16927 + 16904 @@ -13946,27 +13940,27 @@ fun_decls - 3392748 + 3388097 id - 3388838 + 3384193 function - 3232283 + 3227852 type_id - 600787 + 599963 name - 462018 + 461385 location - 932372 + 931093 @@ -13980,7 +13974,7 @@ 1 2 - 3388838 + 3384193 @@ -13996,12 +13990,12 @@ 1 2 - 3385444 + 3380803 2 5 - 3394 + 3389 @@ -14017,7 +14011,7 @@ 1 2 - 3388838 + 3384193 @@ -14033,7 +14027,7 @@ 1 2 - 3388838 + 3384193 @@ -14049,12 +14043,12 @@ 1 2 - 3101892 + 3097640 2 7 - 130391 + 130212 @@ -14070,12 +14064,12 @@ 1 2 - 3221929 + 3217512 2 5 - 10353 + 10339 @@ -14091,7 +14085,7 @@ 1 2 - 3232283 + 3227852 @@ -14107,12 +14101,12 @@ 1 2 - 3146959 + 3142645 2 6 - 85323 + 85206 @@ -14128,22 +14122,22 @@ 1 2 - 397059 + 396515 2 3 - 127254 + 127080 3 6 - 53359 + 53286 6 37538 - 23113 + 23082 @@ -14159,22 +14153,22 @@ 1 2 - 415404 + 414834 2 3 - 112733 + 112579 3 6 - 52285 + 52213 6 35946 - 20364 + 20336 @@ -14190,22 +14184,22 @@ 1 2 - 472630 + 471982 2 3 - 73422 + 73322 3 7 - 45153 + 45091 7 3213 - 9580 + 9567 @@ -14221,22 +14215,22 @@ 1 2 - 441310 + 440705 2 3 - 90221 + 90097 3 6 - 51383 + 51312 6 7079 - 17872 + 17847 @@ -14252,27 +14246,27 @@ 1 2 - 347652 + 347175 2 3 - 37978 + 37926 3 6 - 37592 + 37540 6 110 - 34756 + 34709 110 4996 - 4038 + 4032 @@ -14288,22 +14282,22 @@ 1 2 - 369348 + 368842 2 3 - 32050 + 32006 3 9 - 35615 + 35567 9 4900 - 25004 + 24969 @@ -14319,12 +14313,12 @@ 1 2 - 427519 + 426933 2 3435 - 34498 + 34451 @@ -14340,22 +14334,22 @@ 1 2 - 355514 + 355027 2 3 - 50738 + 50669 3 6 - 35787 + 35738 6 1706 - 19977 + 19950 @@ -14371,22 +14365,22 @@ 1 2 - 736892 + 735882 2 3 - 90264 + 90140 3 13 - 70630 + 70533 13 1516 - 34584 + 34537 @@ -14402,22 +14396,22 @@ 1 2 - 777793 + 776726 2 4 - 73251 + 73150 4 66 - 71017 + 70919 66 1516 - 10310 + 10296 @@ -14433,17 +14427,17 @@ 1 2 - 854395 + 853223 2 19 - 70286 + 70190 19 1509 - 7690 + 7679 @@ -14459,12 +14453,12 @@ 1 2 - 884769 + 883556 2 10 - 47602 + 47537 @@ -14474,11 +14468,11 @@ fun_def - 1592190 + 1590007 id - 1592190 + 1590007 @@ -14507,11 +14501,11 @@ fun_decl_specifiers - 2464552 + 2464627 id - 1197759 + 1197795 name @@ -14529,17 +14523,17 @@ 1 2 - 267558 + 267566 2 3 - 596777 + 596795 3 4 - 330256 + 330266 4 @@ -14716,26 +14710,26 @@ fun_decl_empty_throws - 435234 + 435248 fun_decl - 435234 + 435248 fun_decl_noexcept - 178852 + 178607 fun_decl - 178852 + 178607 constant - 178251 + 178007 @@ -14749,7 +14743,7 @@ 1 2 - 178852 + 178607 @@ -14765,12 +14759,12 @@ 1 2 - 177692 + 177449 2 4 - 558 + 557 @@ -14780,11 +14774,11 @@ fun_decl_empty_noexcept - 1063865 + 1063897 fun_decl - 1063865 + 1063897 @@ -14889,11 +14883,11 @@ fun_requires - 31202 + 31193 id - 10839 + 10835 kind @@ -14901,7 +14895,7 @@ constraint - 30949 + 30939 @@ -14915,7 +14909,7 @@ 1 2 - 10769 + 10766 2 @@ -14936,7 +14930,7 @@ 1 2 - 7794 + 7792 2 @@ -14956,7 +14950,7 @@ 13 14 - 1222 + 1221 19 @@ -15019,7 +15013,7 @@ 1 2 - 30695 + 30685 2 @@ -15040,7 +15034,7 @@ 1 2 - 30949 + 30939 @@ -15050,19 +15044,19 @@ param_decl_bind - 4870873 + 4864195 id - 4870873 + 4864195 index - 859 + 858 fun_decl - 2664662 + 2661010 @@ -15076,7 +15070,7 @@ 1 2 - 4870873 + 4864195 @@ -15092,7 +15086,7 @@ 1 2 - 4870873 + 4864195 @@ -15270,22 +15264,22 @@ 1 2 - 1370804 + 1368925 2 3 - 667766 + 666850 3 4 - 449001 + 448385 4 21 - 177091 + 176848 @@ -15301,22 +15295,22 @@ 1 2 - 1370804 + 1368925 2 3 - 667766 + 666850 3 4 - 449001 + 448385 4 21 - 177091 + 176848 @@ -15326,27 +15320,27 @@ var_decls - 6738800 + 6739140 id - 6733822 + 6734162 variable - 6565772 + 6565972 type_id - 1513118 + 1513164 name - 829080 + 829105 location - 3605463 + 3605573 @@ -15360,7 +15354,7 @@ 1 2 - 6733822 + 6734162 @@ -15376,7 +15370,7 @@ 1 2 - 6728843 + 6729183 2 @@ -15397,7 +15391,7 @@ 1 2 - 6733822 + 6734162 @@ -15413,7 +15407,7 @@ 1 2 - 6733822 + 6734162 @@ -15429,12 +15423,12 @@ 1 2 - 6408890 + 6408951 2 4 - 156882 + 157021 @@ -15450,7 +15444,7 @@ 1 2 - 6551241 + 6551441 2 @@ -15471,7 +15465,7 @@ 1 2 - 6548550 + 6548750 2 @@ -15492,12 +15486,12 @@ 1 2 - 6434723 + 6434919 2 4 - 131049 + 131053 @@ -15513,27 +15507,27 @@ 1 2 - 890164 + 890191 2 3 - 294254 + 294129 3 5 - 133067 + 133205 5 12 - 116517 + 116521 12 1800 - 79113 + 79116 @@ -15549,27 +15543,27 @@ 1 2 - 909405 + 909432 2 3 - 280531 + 280539 3 5 - 129165 + 129169 5 12 - 116383 + 116386 12 1756 - 77633 + 77636 @@ -15585,22 +15579,22 @@ 1 2 - 1159932 + 1159967 2 3 - 207740 + 207747 3 7 - 115979 + 115983 7 981 - 29465 + 29466 @@ -15616,27 +15610,27 @@ 1 2 - 1026326 + 1026357 2 3 - 228595 + 228602 3 5 - 112481 + 112484 5 17 - 114365 + 114368 17 1756 - 31349 + 31350 @@ -15652,32 +15646,32 @@ 1 2 - 457998 + 458012 2 3 - 157016 + 157021 3 4 - 58124 + 58126 4 7 - 65389 + 65391 7 28 - 62833 + 62835 28 - 6408 - 27716 + 6409 + 27717 @@ -15693,27 +15687,27 @@ 1 2 - 471857 + 471871 2 3 - 156343 + 156348 3 4 - 51935 + 51936 4 8 - 69830 + 69832 8 47 - 62564 + 62566 47 @@ -15734,22 +15728,22 @@ 1 2 - 640175 + 640195 2 3 - 101448 + 101451 3 10 - 62968 + 62970 10 3216 - 24487 + 24488 @@ -15765,27 +15759,27 @@ 1 2 - 487733 + 487748 2 3 - 170067 + 170072 3 4 - 51800 + 51802 4 8 - 63371 + 63373 8 1866 - 56106 + 56107 @@ -15801,17 +15795,17 @@ 1 2 - 3120824 + 3120919 2 4 - 290622 + 290630 4 - 2757 - 194017 + 2758 + 194023 @@ -15827,17 +15821,17 @@ 1 2 - 3145715 + 3145811 2 5 - 299771 + 299780 5 2752 - 159976 + 159981 @@ -15853,17 +15847,17 @@ 1 2 - 3312957 + 3313058 2 13 - 271516 + 271524 13 2391 - 20989 + 20990 @@ -15879,12 +15873,12 @@ 1 2 - 3594430 + 3594540 2 5 - 11032 + 11033 @@ -15894,11 +15888,11 @@ var_def - 3747410 + 3747525 id - 3747410 + 3747525 @@ -15916,11 +15910,11 @@ var_decl_specifiers - 487061 + 487076 id - 487061 + 487076 name @@ -15938,7 +15932,7 @@ 1 2 - 487061 + 487076 @@ -15990,7 +15984,7 @@ var_requires - 415 + 414 id @@ -15998,7 +15992,7 @@ constraint - 415 + 414 @@ -16038,7 +16032,7 @@ 1 2 - 415 + 414 @@ -16048,19 +16042,19 @@ type_decls - 1890806 + 1889998 id - 1890806 + 1889998 type_id - 1849392 + 1848615 location - 1485539 + 1484915 @@ -16074,7 +16068,7 @@ 1 2 - 1890806 + 1889998 @@ -16090,7 +16084,7 @@ 1 2 - 1890806 + 1889998 @@ -16106,12 +16100,12 @@ 1 2 - 1819601 + 1818837 2 24 - 29790 + 29777 @@ -16127,12 +16121,12 @@ 1 2 - 1820929 + 1820164 2 24 - 28462 + 28450 @@ -16148,12 +16142,12 @@ 1 2 - 1409011 + 1408419 2 651 - 76528 + 76496 @@ -16169,12 +16163,12 @@ 1 2 - 1410352 + 1409760 2 651 - 75187 + 75155 @@ -16184,29 +16178,29 @@ type_def - 1297381 + 1296836 id - 1297381 + 1296836 type_decl_top - 652211 + 652231 type_decl - 652211 + 652231 type_requires - 8233 + 8230 id @@ -16214,7 +16208,7 @@ constraint - 8210 + 8207 @@ -16264,7 +16258,7 @@ 1 2 - 8187 + 8184 2 @@ -16279,11 +16273,11 @@ namespace_decls - 425650 + 425663 id - 425650 + 425663 namespace_id @@ -16291,11 +16285,11 @@ location - 425650 + 425663 bodylocation - 425650 + 425663 @@ -16309,7 +16303,7 @@ 1 2 - 425650 + 425663 @@ -16325,7 +16319,7 @@ 1 2 - 425650 + 425663 @@ -16341,7 +16335,7 @@ 1 2 - 425650 + 425663 @@ -16555,7 +16549,7 @@ 1 2 - 425650 + 425663 @@ -16571,7 +16565,7 @@ 1 2 - 425650 + 425663 @@ -16587,7 +16581,7 @@ 1 2 - 425650 + 425663 @@ -16603,7 +16597,7 @@ 1 2 - 425650 + 425663 @@ -16619,7 +16613,7 @@ 1 2 - 425650 + 425663 @@ -16635,7 +16629,7 @@ 1 2 - 425650 + 425663 @@ -16645,19 +16639,19 @@ usings - 338586 + 338431 id - 338586 + 338431 element_id - 65352 + 65311 location - 33922 + 33908 kind @@ -16675,7 +16669,7 @@ 1 2 - 338586 + 338431 @@ -16691,7 +16685,7 @@ 1 2 - 338586 + 338431 @@ -16707,7 +16701,7 @@ 1 2 - 338586 + 338431 @@ -16723,17 +16717,17 @@ 1 2 - 55435 + 55398 2 4 - 5608 + 5606 4 134 - 4308 + 4306 @@ -16749,17 +16743,17 @@ 1 2 - 55435 + 55398 2 4 - 5608 + 5606 4 134 - 4308 + 4306 @@ -16775,7 +16769,7 @@ 1 2 - 65352 + 65311 @@ -16791,22 +16785,22 @@ 1 2 - 26810 + 26798 2 4 - 2844 + 2857 4 145 - 2479 + 2464 145 289 - 1788 + 1787 @@ -16822,22 +16816,22 @@ 1 2 - 26810 + 26798 2 4 - 2844 + 2857 4 145 - 2479 + 2464 145 289 - 1788 + 1787 @@ -16853,7 +16847,7 @@ 1 2 - 33922 + 33908 @@ -16872,8 +16866,8 @@ 13 - 24600 - 24601 + 24599 + 24600 13 @@ -16893,8 +16887,8 @@ 13 - 4610 - 4611 + 4609 + 4610 13 @@ -16926,15 +16920,15 @@ using_container - 732121 + 731800 parent - 26484 + 26473 child - 338586 + 338431 @@ -16948,27 +16942,27 @@ 1 2 - 12328 + 12322 2 4 - 2424 + 2437 4 6 - 1612 + 1597 6 7 - 2899 + 2897 7 27 - 1991 + 1990 27 @@ -16978,12 +16972,12 @@ 145 146 - 3359 + 3358 146 437 - 867 + 866 @@ -16999,27 +16993,27 @@ 1 2 - 114189 + 114128 2 3 - 154262 + 154198 3 4 - 25238 + 25227 4 5 - 34233 + 34219 5 65 - 10661 + 10657 @@ -17029,23 +17023,23 @@ static_asserts - 183983 + 183988 id - 183983 + 183988 condition - 183983 + 183988 message - 41292 + 41294 location - 23998 + 23999 enclosing @@ -17063,7 +17057,7 @@ 1 2 - 183983 + 183988 @@ -17079,7 +17073,7 @@ 1 2 - 183983 + 183988 @@ -17095,7 +17089,7 @@ 1 2 - 183983 + 183988 @@ -17111,7 +17105,7 @@ 1 2 - 183983 + 183988 @@ -17127,7 +17121,7 @@ 1 2 - 183983 + 183988 @@ -17143,7 +17137,7 @@ 1 2 - 183983 + 183988 @@ -17159,7 +17153,7 @@ 1 2 - 183983 + 183988 @@ -17175,7 +17169,7 @@ 1 2 - 183983 + 183988 @@ -17191,7 +17185,7 @@ 1 2 - 30381 + 30382 2 @@ -17201,12 +17195,12 @@ 3 4 - 3928 + 3929 4 12 - 2202 + 2203 12 @@ -17232,7 +17226,7 @@ 1 2 - 30381 + 30382 2 @@ -17242,12 +17236,12 @@ 3 4 - 3928 + 3929 4 12 - 2202 + 2203 12 @@ -17273,12 +17267,12 @@ 1 2 - 38265 + 38266 2 33 - 3026 + 3027 @@ -17294,7 +17288,7 @@ 1 2 - 32333 + 32334 2 @@ -17462,7 +17456,7 @@ 3 4 - 8308 + 8309 4 @@ -17637,23 +17631,23 @@ params - 4808534 + 4801942 id - 4798867 + 4792289 function - 2659163 + 2655518 index - 859 + 858 type_id - 862085 + 860903 @@ -17667,7 +17661,7 @@ 1 2 - 4798867 + 4792289 @@ -17683,7 +17677,7 @@ 1 2 - 4798867 + 4792289 @@ -17699,12 +17693,12 @@ 1 2 - 4789545 + 4782979 2 4 - 9322 + 9310 @@ -17720,22 +17714,22 @@ 1 2 - 1392113 + 1390205 2 3 - 661149 + 660243 3 4 - 439592 + 438989 4 21 - 166307 + 166079 @@ -17751,22 +17745,22 @@ 1 2 - 1392113 + 1390205 2 3 - 661149 + 660243 3 4 - 439592 + 438989 4 21 - 166307 + 166079 @@ -17782,22 +17776,22 @@ 1 2 - 1481046 + 1479015 2 3 - 669914 + 668995 3 4 - 403847 + 403293 4 10 - 104355 + 104212 @@ -18056,32 +18050,32 @@ 1 2 - 449172 + 448557 2 3 - 180012 + 179766 3 4 - 53144 + 53071 4 6 - 77762 + 77655 6 15 - 65603 + 65513 15 3702 - 36389 + 36339 @@ -18097,32 +18091,32 @@ 1 2 - 492092 + 491417 2 3 - 152345 + 152136 3 4 - 53230 + 53157 4 6 - 69384 + 69289 6 18 - 66248 + 66157 18 3701 - 28784 + 28745 @@ -18138,17 +18132,17 @@ 1 2 - 634470 + 633600 2 3 - 187746 + 187488 3 17 - 39869 + 39814 @@ -18158,15 +18152,15 @@ overrides - 170557 + 170562 new - 161259 + 161264 old - 19193 + 19194 @@ -18180,12 +18174,12 @@ 1 2 - 151970 + 151975 2 4 - 9288 + 9289 @@ -18236,19 +18230,19 @@ membervariables - 1444291 + 1444335 id - 1441833 + 1441877 type_id - 448060 + 448074 name - 617366 + 617385 @@ -18262,7 +18256,7 @@ 1 2 - 1439484 + 1439528 2 @@ -18283,7 +18277,7 @@ 1 2 - 1441833 + 1441877 @@ -18299,22 +18293,22 @@ 1 2 - 332331 + 332341 2 3 - 70890 + 70892 3 10 - 34898 + 34899 10 4153 - 9939 + 9940 @@ -18330,17 +18324,17 @@ 1 2 - 349043 + 349054 2 3 - 63462 + 63464 3 40 - 33642 + 33643 41 @@ -18361,22 +18355,22 @@ 1 2 - 403713 + 403725 2 3 - 118295 + 118299 3 5 - 56307 + 56309 5 646 - 39049 + 39050 @@ -18392,17 +18386,17 @@ 1 2 - 502839 + 502854 2 3 - 70726 + 70728 3 650 - 43801 + 43802 @@ -18583,19 +18577,19 @@ localvariables - 735322 + 735182 id - 735322 + 735182 type_id - 54078 + 54092 name - 102826 + 102807 @@ -18609,7 +18603,7 @@ 1 2 - 735322 + 735182 @@ -18625,7 +18619,7 @@ 1 2 - 735322 + 735182 @@ -18641,17 +18635,17 @@ 1 2 - 29229 + 29248 2 3 - 7925 + 7924 3 4 - 4076 + 4075 4 @@ -18661,17 +18655,17 @@ 6 12 - 4202 + 4201 12 - 165 - 4056 + 166 + 4059 - 165 + 168 19320 - 486 + 482 @@ -18687,22 +18681,22 @@ 1 2 - 38830 + 38847 2 3 - 6786 + 6784 3 5 - 4522 + 4521 5 3502 - 3938 + 3937 @@ -18718,27 +18712,27 @@ 1 2 - 63261 + 63250 2 3 - 16249 + 16246 3 4 - 6615 + 6614 4 8 - 8234 + 8232 8 135 - 7715 + 7713 135 @@ -18759,17 +18753,17 @@ 1 2 - 85563 + 85547 2 3 - 8526 + 8524 3 15 - 7771 + 7770 15 @@ -18784,11 +18778,11 @@ autoderivation - 202090 + 202096 var - 202090 + 202096 derivation_type @@ -18806,7 +18800,7 @@ 1 2 - 202090 + 202096 @@ -18852,15 +18846,15 @@ orphaned_variables - 55894 + 55817 var - 55894 + 55817 function - 51769 + 51698 @@ -18874,7 +18868,7 @@ 1 2 - 55894 + 55817 @@ -18890,12 +18884,12 @@ 1 2 - 50695 + 50626 2 47 - 1074 + 1072 @@ -18905,15 +18899,15 @@ enumconstants - 330365 + 330375 id - 330365 + 330375 parent - 38995 + 38996 index @@ -18925,11 +18919,11 @@ name - 329983 + 329993 location - 302894 + 302903 @@ -18943,7 +18937,7 @@ 1 2 - 330365 + 330375 @@ -18959,7 +18953,7 @@ 1 2 - 330365 + 330375 @@ -18975,7 +18969,7 @@ 1 2 - 330365 + 330375 @@ -18991,7 +18985,7 @@ 1 2 - 330365 + 330375 @@ -19007,7 +19001,7 @@ 1 2 - 330365 + 330375 @@ -19058,7 +19052,7 @@ 8 11 - 3549 + 3550 11 @@ -19124,7 +19118,7 @@ 8 11 - 3549 + 3550 11 @@ -19155,7 +19149,7 @@ 1 2 - 38995 + 38996 @@ -19206,7 +19200,7 @@ 8 11 - 3549 + 3550 11 @@ -19247,7 +19241,7 @@ 3 4 - 7973 + 7974 4 @@ -19618,7 +19612,7 @@ 1 2 - 329600 + 329610 2 @@ -19639,7 +19633,7 @@ 1 2 - 329600 + 329610 2 @@ -19660,7 +19654,7 @@ 1 2 - 329983 + 329993 @@ -19676,7 +19670,7 @@ 1 2 - 329983 + 329993 @@ -19692,7 +19686,7 @@ 1 2 - 329600 + 329610 2 @@ -19713,7 +19707,7 @@ 1 2 - 301856 + 301865 2 @@ -19734,7 +19728,7 @@ 1 2 - 302894 + 302903 @@ -19750,7 +19744,7 @@ 1 2 - 301856 + 301865 2 @@ -19771,7 +19765,7 @@ 1 2 - 302894 + 302903 @@ -19787,7 +19781,7 @@ 1 2 - 301856 + 301865 2 @@ -20479,15 +20473,15 @@ derivedtypes - 3188501 + 3188598 id - 3188501 + 3188598 name - 1506660 + 1506706 kind @@ -20495,7 +20489,7 @@ type_id - 2055209 + 2055272 @@ -20509,7 +20503,7 @@ 1 2 - 3188501 + 3188598 @@ -20525,7 +20519,7 @@ 1 2 - 3188501 + 3188598 @@ -20541,7 +20535,7 @@ 1 2 - 3188501 + 3188598 @@ -20557,17 +20551,17 @@ 1 2 - 1369018 + 1369060 2 10 - 113826 + 113830 10 4291 - 23814 + 23815 @@ -20583,7 +20577,7 @@ 1 2 - 1506660 + 1506706 @@ -20599,17 +20593,17 @@ 1 2 - 1369153 + 1369194 2 10 - 113692 + 113695 10 4291 - 23814 + 23815 @@ -20748,22 +20742,22 @@ 1 2 - 1388258 + 1388301 2 3 - 410100 + 410112 3 4 - 122572 + 122576 4 124 - 134278 + 134282 @@ -20779,22 +20773,22 @@ 1 2 - 1389873 + 1389915 2 3 - 410100 + 410112 3 4 - 120958 + 120961 4 124 - 134278 + 134282 @@ -20810,22 +20804,22 @@ 1 2 - 1390142 + 1390184 2 3 - 410907 + 410919 3 4 - 122707 + 122710 4 6 - 131452 + 131456 @@ -20835,11 +20829,11 @@ pointerishsize - 2366955 + 2367027 id - 2366955 + 2367027 size @@ -20861,7 +20855,7 @@ 1 2 - 2366955 + 2367027 @@ -20877,7 +20871,7 @@ 1 2 - 2366955 + 2367027 @@ -20961,15 +20955,15 @@ arraysizes - 86379 + 86381 id - 86379 + 86381 num_elements - 18567 + 18568 bytesize @@ -20991,7 +20985,7 @@ 1 2 - 86379 + 86381 @@ -21007,7 +21001,7 @@ 1 2 - 86379 + 86381 @@ -21023,7 +21017,7 @@ 1 2 - 86379 + 86381 @@ -21085,12 +21079,12 @@ 1 2 - 9283 + 9284 2 3 - 6861 + 6862 3 @@ -21116,12 +21110,12 @@ 1 2 - 9283 + 9284 2 3 - 6861 + 6862 3 @@ -21357,15 +21351,15 @@ typedefbase - 2175706 + 2172724 id - 2175706 + 2172724 type_id - 905391 + 904236 @@ -21379,7 +21373,7 @@ 1 2 - 2175706 + 2172724 @@ -21395,22 +21389,22 @@ 1 2 - 730534 + 729661 2 3 - 81714 + 81602 3 6 - 70028 + 69889 6 2848 - 23113 + 23082 @@ -21420,23 +21414,27 @@ decltypes - 175650 + 813065 id - 15374 + 27516 expr - 161629 + 813065 + + + kind + 21 base_type - 11280 + 3335 parentheses_would_change_meaning - 16 + 21 @@ -21450,37 +21448,63 @@ 1 2 - 2137 + 9720 2 3 - 6659 - - - 3 - 4 - 2162 + 3642 4 5 - 1056 + 3620 - 5 + 6 9 - 1213 + 548 - 9 - 22 - 1204 + 23 + 24 + 3247 - 22 - 1808 - 940 + 29 + 30 + 3137 + + + 32 + 33 + 131 + + + 171 + 172 + 3071 + + + 173 + 224 + 394 + + + + + + + id + kind + + + 12 + + + 1 + 2 + 27516 @@ -21496,7 +21520,7 @@ 1 2 - 15374 + 27516 @@ -21512,7 +21536,7 @@ 1 2 - 15374 + 27516 @@ -21528,17 +21552,39 @@ 1 2 - 148087 + 813065 + + + + + + expr + kind + + + 12 + - 2 - 3 - 13063 + 1 + 2 + 813065 + + + + + + expr + base_type + + + 12 + - 3 - 4 - 478 + 1 + 2 + 813065 @@ -21546,7 +21592,7 @@ expr - base_type + parentheses_would_change_meaning 12 @@ -21554,24 +21600,62 @@ 1 2 - 148087 + 813065 + + + + + + kind + id + + + 12 + - 2 - 3 - 13063 + 1254 + 1255 + 21 + + + + + + kind + expr + + + 12 + - 3 - 4 - 478 + 37054 + 37055 + 21 - expr + kind + base_type + + + 12 + + + 152 + 153 + 21 + + + + + + + kind parentheses_would_change_meaning @@ -21580,7 +21664,7 @@ 1 2 - 161629 + 21 @@ -21596,17 +21680,37 @@ 1 2 - 9787 + 1206 2 3 - 1320 + 1031 3 - 269 - 173 + 4 + 351 + + + 4 + 5 + 175 + + + 5 + 8 + 285 + + + 8 + 166 + 263 + + + 245 + 246 + 21 @@ -21622,37 +21726,53 @@ 1 2 - 965 + 1162 2 3 - 5504 + 855 3 4 - 1600 + 329 4 - 5 - 1114 + 7 + 285 - 5 - 8 - 949 + 7 + 201 + 307 - 8 - 41 - 858 + 340 + 1601 + 263 - 42 - 5498 - 288 + 2800 + 8194 + 131 + + + + + + + base_type + kind + + + 12 + + + 1 + 2 + 3335 @@ -21668,7 +21788,55 @@ 1 2 - 11280 + 3335 + + + + + + + parentheses_would_change_meaning + id + + + 12 + + + 1254 + 1255 + 21 + + + + + + + parentheses_would_change_meaning + expr + + + 12 + + + 37054 + 37055 + 21 + + + + + + + parentheses_would_change_meaning + kind + + + 12 + + + 1 + 2 + 21 @@ -21676,62 +21844,331 @@ parentheses_would_change_meaning + base_type + + + 12 + + + 152 + 153 + 21 + + + + + + + + + type_operators + 8530 + + + id + 8530 + + + arg_type + 7700 + + + kind + 92 + + + base_type + 5625 + + + + + id + arg_type + + + 12 + + + 1 + 2 + 8530 + + + + + + + id + kind + + + 12 + + + 1 + 2 + 8530 + + + + + + + id + base_type + + + 12 + + + 1 + 2 + 8530 + + + + + + + arg_type id 12 + + 1 + 2 + 6870 + 2 3 - 8 + 829 + + + + + + arg_type + kind + + + 12 + - 1861 - 1862 - 8 + 1 + 2 + 6870 + + + 2 + 3 + 829 - parentheses_would_change_meaning - expr + arg_type + base_type 12 + + 1 + 2 + 7677 + 2 3 - 8 + 23 + + + + + + + kind + id + + + 12 + + + 1 + 2 + 23 - 19584 - 19585 - 8 + 7 + 8 + 23 + + + 96 + 97 + 23 + + + 266 + 267 + 23 - parentheses_would_change_meaning + kind + arg_type + + + 12 + + + 1 + 2 + 23 + + + 7 + 8 + 23 + + + 96 + 97 + 23 + + + 266 + 267 + 23 + + + + + + + kind base_type 12 + + 1 + 2 + 23 + + + 4 + 5 + 23 + + + 72 + 73 + 23 + + + 222 + 223 + 23 + + + + + + + base_type + id + + + 12 + + + 1 + 2 + 3896 + 2 3 - 8 + 968 - 1365 - 1366 - 8 + 3 + 4 + 368 + + + 4 + 6 + 391 + + + + + + + base_type + arg_type + + + 12 + + + 1 + 2 + 4057 + + + 2 + 3 + 1060 + + + 3 + 4 + 484 + + + 4 + 5 + 23 + + + + + + + base_type + kind + + + 12 + + + 1 + 2 + 4380 + + + 2 + 3 + 1221 + + + 3 + 4 + 23 @@ -21741,15 +22178,15 @@ usertypes - 4987509 + 4985429 id - 4987509 + 4985429 name - 1074799 + 1074389 kind @@ -21767,7 +22204,7 @@ 1 2 - 4987509 + 4985429 @@ -21783,7 +22220,7 @@ 1 2 - 4987509 + 4985429 @@ -21799,22 +22236,22 @@ 1 2 - 743244 + 742972 2 3 - 196950 + 196894 3 7 - 86025 + 85961 7 30181 - 48580 + 48560 @@ -21830,12 +22267,12 @@ 1 2 - 1008445 + 1008062 2 10 - 66354 + 66326 @@ -21899,8 +22336,8 @@ 13 - 85548 - 85549 + 85549 + 85550 13 @@ -21965,8 +22402,8 @@ 13 - 10827 - 10828 + 10829 + 10830 13 @@ -21975,8 +22412,8 @@ 13 - 51345 - 51346 + 51346 + 51347 13 @@ -21987,15 +22424,15 @@ usertypesize - 1632161 + 1631490 id - 1632161 + 1631490 size - 1896 + 1895 alignment @@ -22013,7 +22450,7 @@ 1 2 - 1632161 + 1631490 @@ -22029,7 +22466,7 @@ 1 2 - 1632161 + 1631490 @@ -22045,7 +22482,7 @@ 1 2 - 596 + 595 2 @@ -22065,31 +22502,31 @@ 6 8 - 149 + 148 8 14 - 149 + 148 14 26 - 149 + 148 26 86 - 149 + 148 96 1592 - 149 + 148 1733 - 92729 + 92730 67 @@ -22165,8 +22602,8 @@ 13 - 107915 - 107916 + 107916 + 107917 13 @@ -22223,26 +22660,26 @@ usertype_final - 12243 + 12244 id - 12243 + 12244 usertype_uuid - 50061 + 50062 id - 50061 + 50062 uuid - 49549 + 49551 @@ -22256,7 +22693,7 @@ 1 2 - 50061 + 50062 @@ -22272,7 +22709,7 @@ 1 2 - 49037 + 49039 2 @@ -22287,11 +22724,11 @@ usertype_alias_kind - 2175749 + 2172767 id - 2175706 + 2172724 alias_kind @@ -22309,7 +22746,7 @@ 1 2 - 2175663 + 2172681 2 @@ -22345,26 +22782,26 @@ nontype_template_parameters - 966312 + 964987 id - 966312 + 964987 type_template_type_constraint - 29104 + 29095 id - 14344 + 14340 constraint - 27882 + 27873 @@ -22378,7 +22815,7 @@ 1 2 - 10954 + 10951 2 @@ -22393,7 +22830,7 @@ 5 14 - 1199 + 1198 14 @@ -22414,12 +22851,12 @@ 1 2 - 26659 + 26651 2 3 - 1222 + 1221 @@ -22429,15 +22866,15 @@ mangled_name - 7776283 + 7773031 id - 7776283 + 7773031 mangled_name - 5327221 + 5323548 is_complete @@ -22455,7 +22892,7 @@ 1 2 - 7776283 + 7773031 @@ -22471,7 +22908,7 @@ 1 2 - 7776283 + 7773031 @@ -22487,17 +22924,17 @@ 1 2 - 4733728 + 4730278 2 3 - 459564 + 459154 3 9032 - 133928 + 134115 @@ -22513,7 +22950,7 @@ 1 2 - 5327221 + 5323548 @@ -22527,13 +22964,13 @@ 12 - 4842 - 4843 + 4956 + 4957 13 - 570790 - 570791 + 570682 + 570683 13 @@ -22548,13 +22985,13 @@ 12 - 1515 - 1516 + 1518 + 1519 13 - 391717 - 391718 + 391608 + 391609 13 @@ -22565,59 +23002,59 @@ is_pod_class - 747547 + 746522 id - 747547 + 746522 is_standard_layout_class - 1344878 + 1344327 id - 1344878 + 1344327 is_complete - 1611299 + 1610636 id - 1611299 + 1610636 is_class_template - 292187 + 292064 id - 292187 + 292064 class_instantiation - 1327050 + 1326506 to - 1323148 + 1322606 from - 91606 + 91568 @@ -22631,12 +23068,12 @@ 1 2 - 1320411 + 1319871 2 8 - 2736 + 2735 @@ -22652,47 +23089,47 @@ 1 2 - 26728 + 26717 2 3 - 16622 + 16615 3 4 - 9103 + 9099 4 5 - 5974 + 5971 5 7 - 7694 + 7691 7 10 - 6949 + 6946 10 17 - 7356 + 7353 17 53 - 6936 + 6933 53 4219 - 4240 + 4238 @@ -22702,19 +23139,19 @@ class_template_argument - 3501753 + 3500296 type_id - 1631240 + 1630569 index - 1517 + 1516 arg_type - 1034483 + 1034048 @@ -22728,27 +23165,27 @@ 1 2 - 678894 + 678622 2 3 - 490113 + 489907 3 4 - 308755 + 308626 4 7 - 124120 + 124067 7 113 - 29356 + 29344 @@ -22764,22 +23201,22 @@ 1 2 - 713453 + 713167 2 3 - 505462 + 505250 3 4 - 306818 + 306689 4 113 - 105506 + 105461 @@ -22824,7 +23261,7 @@ 11329 - 120409 + 120410 54 @@ -22887,27 +23324,27 @@ 1 2 - 649090 + 648817 2 3 - 212190 + 212101 3 4 - 62154 + 62128 4 11 - 78669 + 78635 11 11553 - 32377 + 32364 @@ -22923,17 +23360,17 @@ 1 2 - 912395 + 912012 2 3 - 98854 + 98812 3 22 - 23233 + 23223 @@ -22943,11 +23380,11 @@ class_template_argument_value - 643234 + 642352 type_id - 259536 + 259180 index @@ -22955,7 +23392,7 @@ arg_value - 643062 + 642181 @@ -22969,17 +23406,17 @@ 1 2 - 196467 + 196198 2 3 - 54691 + 54616 3 8 - 8377 + 8366 @@ -22995,22 +23432,22 @@ 1 2 - 186543 + 186287 2 3 - 51039 + 50969 3 45 - 19590 + 19564 45 154 - 2362 + 2359 @@ -23138,7 +23575,7 @@ 1 2 - 642890 + 642009 2 @@ -23159,7 +23596,7 @@ 1 2 - 643062 + 642181 @@ -23169,15 +23606,15 @@ is_proxy_class_for - 62060 + 62033 id - 62060 + 62033 templ_param_id - 58632 + 58607 @@ -23191,7 +23628,7 @@ 1 2 - 62060 + 62033 @@ -23207,12 +23644,12 @@ 1 2 - 57711 + 57687 2 79 - 921 + 920 @@ -23222,19 +23659,19 @@ type_mentions - 5507858 + 5508026 id - 5507858 + 5508026 type_id - 270944 + 270952 location - 5462036 + 5462202 kind @@ -23252,7 +23689,7 @@ 1 2 - 5507858 + 5508026 @@ -23268,7 +23705,7 @@ 1 2 - 5507858 + 5508026 @@ -23284,7 +23721,7 @@ 1 2 - 5507858 + 5508026 @@ -23300,17 +23737,17 @@ 1 2 - 133424 + 133428 2 3 - 29710 + 29711 3 4 - 11250 + 11251 4 @@ -23330,12 +23767,12 @@ 12 27 - 20753 + 20754 27 8555 - 19715 + 19716 @@ -23351,17 +23788,17 @@ 1 2 - 133424 + 133428 2 3 - 29710 + 29711 3 4 - 11250 + 11251 4 @@ -23381,12 +23818,12 @@ 12 27 - 20753 + 20754 27 8555 - 19715 + 19716 @@ -23402,7 +23839,7 @@ 1 2 - 270944 + 270952 @@ -23418,12 +23855,12 @@ 1 2 - 5416214 + 5416379 2 3 - 45821 + 45823 @@ -23439,12 +23876,12 @@ 1 2 - 5416214 + 5416379 2 3 - 45821 + 45823 @@ -23460,7 +23897,7 @@ 1 2 - 5462036 + 5462202 @@ -23518,26 +23955,26 @@ is_function_template - 1418397 + 1418440 id - 1418397 + 1418440 function_instantiation - 1226965 + 1225283 to - 1226965 + 1225283 from - 230193 + 229877 @@ -23551,7 +23988,7 @@ 1 2 - 1226965 + 1225283 @@ -23567,27 +24004,27 @@ 1 2 - 140014 + 139822 2 3 - 53273 + 53200 3 9 - 18130 + 18105 9 103 - 17270 + 17247 103 1532 - 1503 + 1501 @@ -23597,19 +24034,19 @@ function_template_argument - 3133426 + 3129131 function_id - 1832651 + 1830138 index - 601 + 600 arg_type - 375792 + 375277 @@ -23623,22 +24060,22 @@ 1 2 - 987407 + 986053 2 3 - 521006 + 520291 3 4 - 216659 + 216362 4 15 - 107578 + 107430 @@ -23654,22 +24091,22 @@ 1 2 - 1011551 + 1010165 2 3 - 518600 + 517889 3 4 - 213910 + 213617 4 9 - 88588 + 88467 @@ -23807,37 +24244,37 @@ 1 2 - 220397 + 220095 2 3 - 33210 + 33164 3 4 - 25218 + 25184 4 6 - 28570 + 28530 6 11 - 29300 + 29260 11 76 - 29472 + 29431 79 2452 - 9623 + 9610 @@ -23853,17 +24290,17 @@ 1 2 - 323851 + 323407 2 3 - 40513 + 40458 3 15 - 11428 + 11412 @@ -23873,19 +24310,19 @@ function_template_argument_value - 570971 + 570188 function_id - 248151 + 247811 index - 601 + 600 arg_value - 567577 + 566799 @@ -23899,17 +24336,17 @@ 1 2 - 190925 + 190663 2 3 - 54089 + 54015 3 8 - 3136 + 3131 @@ -23925,22 +24362,22 @@ 1 2 - 182203 + 181954 2 3 - 46270 + 46207 3 54 - 18731 + 18705 54 113 - 945 + 943 @@ -24078,12 +24515,12 @@ 1 2 - 564183 + 563410 2 3 - 3394 + 3389 @@ -24099,7 +24536,7 @@ 1 2 - 567577 + 566799 @@ -24109,26 +24546,26 @@ is_variable_template - 55029 + 55031 id - 55029 + 55031 variable_instantiation - 279051 + 279059 to - 279051 + 279059 from - 34040 + 34041 @@ -24142,7 +24579,7 @@ 1 2 - 279051 + 279059 @@ -24158,7 +24595,7 @@ 1 2 - 16683 + 16684 2 @@ -24203,11 +24640,11 @@ variable_template_argument - 525810 + 525826 variable_id - 267210 + 267219 index @@ -24215,7 +24652,7 @@ arg_type - 257119 + 257127 @@ -24229,17 +24666,17 @@ 1 2 - 116248 + 116252 2 3 - 97277 + 97280 3 4 - 39422 + 39423 4 @@ -24260,17 +24697,17 @@ 1 2 - 122168 + 122172 2 3 - 99295 + 99298 3 4 - 32829 + 32830 4 @@ -24408,17 +24845,17 @@ 1 2 - 199668 + 199674 2 3 - 30542 + 30543 3 11 - 19643 + 19644 11 @@ -24439,17 +24876,17 @@ 1 2 - 233439 + 233446 2 3 - 20989 + 20990 3 7 - 2690 + 2691 @@ -24463,7 +24900,7 @@ variable_id - 11032 + 11033 index @@ -24485,7 +24922,7 @@ 1 2 - 10494 + 10495 2 @@ -24506,7 +24943,7 @@ 1 2 - 6592 + 6593 2 @@ -24620,15 +25057,15 @@ template_template_instantiation - 7437 + 7434 to - 6976 + 6973 from - 4931 + 4929 @@ -24642,12 +25079,12 @@ 1 2 - 6827 + 6824 2 15 - 149 + 148 @@ -24663,7 +25100,7 @@ 1 2 - 3224 + 3222 2 @@ -24683,11 +25120,11 @@ template_template_argument - 12409 + 12404 type_id - 7843 + 7840 index @@ -24695,7 +25132,7 @@ arg_type - 11650 + 11645 @@ -24709,7 +25146,7 @@ 1 2 - 6434 + 6432 2 @@ -24719,7 +25156,7 @@ 3 8 - 650 + 649 8 @@ -24740,17 +25177,17 @@ 1 2 - 6462 + 6459 2 4 - 718 + 717 4 10 - 596 + 595 10 @@ -24893,7 +25330,7 @@ 1 2 - 11610 + 11605 3 @@ -24914,7 +25351,7 @@ 1 2 - 11623 + 11618 2 @@ -24929,7 +25366,7 @@ template_template_argument_value - 799 + 798 type_id @@ -24941,7 +25378,7 @@ arg_value - 799 + 798 @@ -25039,7 +25476,7 @@ 1 2 - 799 + 798 @@ -25055,7 +25492,7 @@ 1 2 - 799 + 798 @@ -25065,19 +25502,19 @@ concept_templates - 3874 + 3873 concept_id - 3874 + 3873 name - 3874 + 3873 location - 3874 + 3873 @@ -25091,7 +25528,7 @@ 1 2 - 3874 + 3873 @@ -25107,7 +25544,7 @@ 1 2 - 3874 + 3873 @@ -25123,7 +25560,7 @@ 1 2 - 3874 + 3873 @@ -25139,7 +25576,7 @@ 1 2 - 3874 + 3873 @@ -25155,7 +25592,7 @@ 1 2 - 3874 + 3873 @@ -25171,7 +25608,7 @@ 1 2 - 3874 + 3873 @@ -25181,15 +25618,15 @@ concept_instantiation - 96929 + 96899 to - 96929 + 96899 from - 3689 + 3688 @@ -25203,7 +25640,7 @@ 1 2 - 96929 + 96899 @@ -25229,7 +25666,7 @@ 3 4 - 392 + 391 4 @@ -25299,22 +25736,22 @@ is_type_constraint - 39551 + 39538 concept_id - 39551 + 39538 concept_template_argument - 121167 + 121129 concept_id - 81870 + 81844 index @@ -25322,7 +25759,7 @@ arg_type - 22969 + 22962 @@ -25336,17 +25773,17 @@ 1 2 - 49814 + 49798 2 3 - 26452 + 26443 3 7 - 5604 + 5602 @@ -25362,17 +25799,17 @@ 1 2 - 53688 + 53671 2 3 - 23984 + 23976 3 7 - 4197 + 4195 @@ -25470,17 +25907,17 @@ 1 2 - 11138 + 11135 2 3 - 3182 + 3181 3 4 - 1130 + 1129 4 @@ -25490,7 +25927,7 @@ 5 6 - 1245 + 1244 6 @@ -25521,12 +25958,12 @@ 1 2 - 19325 + 19319 2 3 - 3505 + 3504 3 @@ -25583,7 +26020,7 @@ 1 2 - 66 + 65 2 @@ -25672,15 +26109,15 @@ routinetypes - 762068 + 761024 id - 762068 + 761024 return_type - 357963 + 357472 @@ -25694,7 +26131,7 @@ 1 2 - 762068 + 761024 @@ -25710,17 +26147,17 @@ 1 2 - 295367 + 294962 2 3 - 44251 + 44190 3 4676 - 18344 + 18319 @@ -25730,11 +26167,11 @@ routinetypeargs - 1165645 + 1165681 routine - 411414 + 411426 index @@ -25742,7 +26179,7 @@ type_id - 110813 + 110817 @@ -25756,32 +26193,32 @@ 1 2 - 81430 + 81433 2 3 - 125395 + 125399 3 4 - 106717 + 106720 4 5 - 48934 + 48936 5 7 - 32441 + 32442 7 19 - 16493 + 16494 @@ -25797,27 +26234,27 @@ 1 2 - 87383 + 87386 2 3 - 138121 + 138125 3 4 - 113435 + 113438 4 5 - 40141 + 40143 5 10 - 32222 + 32223 10 @@ -26015,7 +26452,7 @@ 1 2 - 33096 + 33097 2 @@ -26025,7 +26462,7 @@ 3 4 - 13052 + 13053 4 @@ -26040,12 +26477,12 @@ 6 8 - 9502 + 9503 8 13 - 9502 + 9503 13 @@ -26071,7 +26508,7 @@ 1 2 - 78153 + 78156 2 @@ -26081,7 +26518,7 @@ 3 5 - 9502 + 9503 5 @@ -26096,19 +26533,19 @@ ptrtomembers - 12084 + 12079 id - 12084 + 12079 type_id - 10160 + 10156 class_id - 5987 + 5985 @@ -26122,7 +26559,7 @@ 1 2 - 12084 + 12079 @@ -26138,7 +26575,7 @@ 1 2 - 12084 + 12079 @@ -26154,7 +26591,7 @@ 1 2 - 9875 + 9871 2 @@ -26175,7 +26612,7 @@ 1 2 - 9875 + 9871 2 @@ -26196,7 +26633,7 @@ 1 2 - 4877 + 4874 2 @@ -26227,7 +26664,7 @@ 1 2 - 4877 + 4874 2 @@ -26252,15 +26689,15 @@ specifiers - 8341 + 8342 id - 8341 + 8342 str - 8341 + 8342 @@ -26274,7 +26711,7 @@ 1 2 - 8341 + 8342 @@ -26290,7 +26727,7 @@ 1 2 - 8341 + 8342 @@ -26300,11 +26737,11 @@ typespecifiers - 991511 + 991095 type_id - 984927 + 984513 spec_id @@ -26322,12 +26759,12 @@ 1 2 - 978343 + 977932 2 3 - 6583 + 6581 @@ -26388,15 +26825,15 @@ funspecifiers - 9728384 + 9715091 func_id - 3340505 + 3335926 spec_id - 816 + 815 @@ -26410,32 +26847,32 @@ 1 2 - 437873 + 437273 2 3 - 677303 + 676332 3 4 - 1424163 + 1422254 4 5 - 459483 + 458854 5 6 - 225080 + 224771 6 8 - 116600 + 116440 @@ -26524,8 +26961,8 @@ 42 - 42406 - 42407 + 42407 + 42408 42 @@ -26546,11 +26983,11 @@ varspecifiers - 2898085 + 2898173 var_id - 2545054 + 2545132 spec_id @@ -26568,12 +27005,12 @@ 1 2 - 2192023 + 2192090 2 3 - 353030 + 353041 @@ -26629,15 +27066,15 @@ explicit_specifier_exprs - 44535 + 44536 func_id - 44535 + 44536 constant - 44535 + 44536 @@ -26651,7 +27088,7 @@ 1 2 - 44535 + 44536 @@ -26667,7 +27104,7 @@ 1 2 - 44535 + 44536 @@ -26677,11 +27114,11 @@ attributes - 629815 + 629835 id - 629815 + 629835 kind @@ -26697,7 +27134,7 @@ location - 623357 + 623376 @@ -26711,7 +27148,7 @@ 1 2 - 629815 + 629835 @@ -26727,7 +27164,7 @@ 1 2 - 629815 + 629835 @@ -26743,7 +27180,7 @@ 1 2 - 629815 + 629835 @@ -26759,7 +27196,7 @@ 1 2 - 629815 + 629835 @@ -27147,7 +27584,7 @@ 1 2 - 617033 + 617052 2 @@ -27168,7 +27605,7 @@ 1 2 - 623357 + 623376 @@ -27184,7 +27621,7 @@ 1 2 - 617841 + 617859 2 @@ -27205,7 +27642,7 @@ 1 2 - 623357 + 623376 @@ -27215,11 +27652,11 @@ attribute_args - 98908 + 98921 id - 98908 + 98921 kind @@ -27227,7 +27664,7 @@ attribute - 85334 + 85298 index @@ -27235,7 +27672,7 @@ location - 91945 + 91906 @@ -27249,7 +27686,7 @@ 1 2 - 98908 + 98921 @@ -27265,7 +27702,7 @@ 1 2 - 98908 + 98921 @@ -27281,7 +27718,7 @@ 1 2 - 98908 + 98921 @@ -27297,7 +27734,7 @@ 1 2 - 98908 + 98921 @@ -27326,8 +27763,8 @@ 13 - 6598 - 6599 + 6602 + 6603 13 @@ -27432,12 +27869,12 @@ 1 2 - 77395 + 77308 2 4 - 6583 + 6635 4 @@ -27458,12 +27895,12 @@ 1 2 - 83031 + 82996 2 3 - 2303 + 2302 @@ -27479,12 +27916,12 @@ 1 2 - 79048 + 79015 2 6 - 6285 + 6283 @@ -27500,12 +27937,12 @@ 1 2 - 80660 + 80626 2 6 - 4673 + 4671 @@ -27539,8 +27976,8 @@ 13 - 6481 - 6482 + 6485 + 6486 13 @@ -27655,12 +28092,12 @@ 1 2 - 89547 + 89455 2 23 - 2397 + 2451 @@ -27676,7 +28113,7 @@ 1 2 - 91728 + 91690 2 @@ -27697,7 +28134,7 @@ 1 2 - 91538 + 91500 2 @@ -27718,7 +28155,7 @@ 1 2 - 91389 + 91351 2 @@ -27733,15 +28170,15 @@ attribute_arg_value - 21051 + 21022 arg - 21051 + 21022 value - 644 + 643 @@ -27755,7 +28192,7 @@ 1 2 - 21051 + 21022 @@ -27864,7 +28301,7 @@ 1 2 - 73 + 72 2 @@ -27889,15 +28326,15 @@ attribute_arg_constant - 89384 + 89401 arg - 89384 + 89401 constant - 89384 + 89401 @@ -27911,7 +28348,7 @@ 1 2 - 89384 + 89401 @@ -27927,7 +28364,7 @@ 1 2 - 89384 + 89401 @@ -28038,15 +28475,15 @@ typeattributes - 84495 + 84498 type_id - 83957 + 83960 spec_id - 26909 + 26910 @@ -28060,7 +28497,7 @@ 1 2 - 83419 + 83421 2 @@ -28106,15 +28543,15 @@ funcattributes - 824909 + 824934 func_id - 776472 + 776496 spec_id - 598600 + 598619 @@ -28128,12 +28565,12 @@ 1 2 - 732879 + 732901 2 7 - 43593 + 43594 @@ -28149,12 +28586,12 @@ 1 2 - 555007 + 555024 2 202 - 43593 + 43594 @@ -28227,11 +28664,11 @@ stmtattributes - 2375 + 2374 stmt_id - 2375 + 2374 spec_id @@ -28249,7 +28686,7 @@ 1 2 - 2375 + 2374 @@ -28295,15 +28732,15 @@ unspecifiedtype - 8345729 + 8343173 type_id - 8345729 + 8343173 unspecified_type_id - 4799107 + 4797160 @@ -28317,7 +28754,7 @@ 1 2 - 8345729 + 8343173 @@ -28333,17 +28770,17 @@ 1 2 - 3198511 + 3197208 2 3 - 1309032 + 1308496 3 6271 - 291564 + 291455 @@ -28353,19 +28790,19 @@ member - 4687208 + 4680740 parent - 562422 + 561651 index - 10740 + 10725 child - 4570006 + 4563699 @@ -28379,52 +28816,52 @@ 1 2 - 233200 + 232880 2 3 - 25949 + 25913 3 4 - 29429 + 29388 4 5 - 37764 + 37712 5 7 - 47860 + 47794 7 11 - 43349 + 43289 11 14 - 41759 + 41702 14 19 - 45368 + 45306 19 53 - 42318 + 42260 53 251 - 15423 + 15402 @@ -28440,52 +28877,52 @@ 1 2 - 233071 + 232752 2 3 - 26078 + 26042 3 4 - 29472 + 29431 4 5 - 37849 + 37798 5 7 - 47645 + 47580 7 11 - 43778 + 43718 11 14 - 41673 + 41616 14 19 - 45153 + 45091 19 53 - 42318 + 42260 53 255 - 15380 + 15359 @@ -28501,57 +28938,57 @@ 1 2 - 2835 + 2831 2 4 - 816 + 815 4 22 - 816 + 815 22 31 - 816 + 815 31 53 - 859 + 858 53 108 - 816 + 815 110 218 - 816 + 815 223 328 - 816 + 815 328 581 - 816 + 815 653 2518 - 816 + 815 2884 12742 - 515 + 514 @@ -28567,57 +29004,57 @@ 1 2 - 1761 + 1759 2 3 - 1374 + 1372 3 8 - 816 + 815 8 31 - 859 + 858 31 41 - 859 + 858 41 97 - 816 + 815 97 161 - 816 + 815 164 314 - 859 + 858 318 386 - 816 + 815 435 1127 - 816 + 815 1139 6168 - 816 + 815 6500 @@ -28638,7 +29075,7 @@ 1 2 - 4570006 + 4563699 @@ -28654,12 +29091,12 @@ 1 2 - 4482148 + 4475961 2 13 - 87858 + 87737 @@ -28669,15 +29106,15 @@ enclosingfunction - 144783 + 144585 child - 144783 + 144585 parent - 89963 + 89840 @@ -28691,7 +29128,7 @@ 1 2 - 144783 + 144585 @@ -28707,22 +29144,22 @@ 1 2 - 62209 + 62124 2 3 - 5842 + 5834 3 4 - 19376 + 19349 4 37 - 2534 + 2531 @@ -28732,15 +29169,15 @@ derivations - 599885 + 599063 derivation - 599885 + 599063 sub - 572475 + 571690 index @@ -28748,11 +29185,11 @@ super - 296054 + 295648 location - 44638 + 44576 @@ -28766,7 +29203,7 @@ 1 2 - 599885 + 599063 @@ -28782,7 +29219,7 @@ 1 2 - 599885 + 599063 @@ -28798,7 +29235,7 @@ 1 2 - 599885 + 599063 @@ -28814,7 +29251,7 @@ 1 2 - 599885 + 599063 @@ -28830,12 +29267,12 @@ 1 2 - 551638 + 550882 2 9 - 20836 + 20808 @@ -28851,12 +29288,12 @@ 1 2 - 551638 + 550882 2 8 - 20836 + 20808 @@ -28872,12 +29309,12 @@ 1 2 - 551638 + 550882 2 9 - 20836 + 20808 @@ -28893,12 +29330,12 @@ 1 2 - 551638 + 550882 2 8 - 20836 + 20808 @@ -29053,12 +29490,12 @@ 1 2 - 283939 + 283549 2 1655 - 12115 + 12098 @@ -29074,12 +29511,12 @@ 1 2 - 283939 + 283549 2 1655 - 12115 + 12098 @@ -29095,12 +29532,12 @@ 1 2 - 295496 + 295090 2 4 - 558 + 557 @@ -29116,12 +29553,12 @@ 1 2 - 289524 + 289127 2 81 - 6530 + 6521 @@ -29137,22 +29574,22 @@ 1 2 - 33510 + 33464 2 5 - 3995 + 3990 5 22 - 3394 + 3389 23 383 - 3351 + 3346 388 @@ -29173,22 +29610,22 @@ 1 2 - 33510 + 33464 2 5 - 3995 + 3990 5 22 - 3394 + 3389 23 383 - 3351 + 3346 388 @@ -29209,7 +29646,7 @@ 1 2 - 44638 + 44576 @@ -29225,22 +29662,22 @@ 1 2 - 36303 + 36253 2 4 - 3308 + 3303 4 26 - 3479 + 3475 26 928 - 1546 + 1544 @@ -29250,11 +29687,11 @@ derspecifiers - 602119 + 601293 der_id - 599326 + 598505 spec_id @@ -29272,12 +29709,12 @@ 1 2 - 596534 + 595716 2 3 - 2792 + 2788 @@ -29318,15 +29755,15 @@ direct_base_offsets - 565944 + 565169 der_id - 565944 + 565169 offset - 644 + 643 @@ -29340,7 +29777,7 @@ 1 2 - 565944 + 565169 @@ -29401,11 +29838,11 @@ virtual_base_offsets - 7346 + 7336 sub - 7346 + 7336 super @@ -29427,7 +29864,7 @@ 1 2 - 7346 + 7336 @@ -29443,7 +29880,7 @@ 1 2 - 7346 + 7336 @@ -29537,23 +29974,23 @@ frienddecls - 883308 + 881497 id - 883308 + 881497 type_id - 53488 + 53414 decl_id - 98040 + 98034 location - 7690 + 7679 @@ -29567,7 +30004,7 @@ 1 2 - 883308 + 881497 @@ -29583,7 +30020,7 @@ 1 2 - 883308 + 881497 @@ -29599,7 +30036,7 @@ 1 2 - 883308 + 881497 @@ -29615,47 +30052,47 @@ 1 2 - 7776 + 7808 2 3 - 17614 + 17590 3 7 - 4511 + 4504 7 12 - 4339 + 4333 12 20 - 4596 + 4547 20 32 - 4167 + 4161 33 50 - 4768 + 4762 50 80 - 4768 + 4762 101 120 - 945 + 943 @@ -29671,47 +30108,47 @@ 1 2 - 7776 + 7808 2 3 - 17614 + 17590 3 7 - 4511 + 4504 7 12 - 4339 + 4333 12 20 - 4596 + 4547 20 32 - 4167 + 4161 33 50 - 4768 + 4762 50 80 - 4768 + 4762 101 120 - 945 + 943 @@ -29727,12 +30164,12 @@ 1 2 - 51769 + 51698 2 13 - 1718 + 1716 @@ -29748,32 +30185,32 @@ 1 2 - 60362 + 60579 2 3 - 7647 + 7465 3 8 - 7561 + 7551 8 15 - 7647 + 7636 15 40 - 7647 + 7636 40 164 - 7174 + 7164 @@ -29789,32 +30226,32 @@ 1 2 - 60362 + 60579 2 3 - 7647 + 7465 3 8 - 7561 + 7551 8 15 - 7647 + 7636 15 40 - 7647 + 7636 40 164 - 7174 + 7164 @@ -29830,12 +30267,12 @@ 1 2 - 97181 + 97176 2 5 - 859 + 858 @@ -29851,12 +30288,12 @@ 1 2 - 7217 + 7207 2 - 20371 - 472 + 20357 + 471 @@ -29872,7 +30309,7 @@ 1 2 - 7518 + 7508 2 @@ -29893,11 +30330,11 @@ 1 2 - 7260 + 7250 2 - 2129 + 2132 429 @@ -29908,19 +30345,19 @@ comments - 11290131 + 11290475 id - 11290131 + 11290475 contents - 4299054 + 4299185 location - 11290131 + 11290475 @@ -29934,7 +30371,7 @@ 1 2 - 11290131 + 11290475 @@ -29950,7 +30387,7 @@ 1 2 - 11290131 + 11290475 @@ -29966,17 +30403,17 @@ 1 2 - 3932682 + 3932802 2 7 - 323182 + 323192 7 32784 - 43189 + 43190 @@ -29992,17 +30429,17 @@ 1 2 - 3932682 + 3932802 2 7 - 323182 + 323192 7 32784 - 43189 + 43190 @@ -30018,7 +30455,7 @@ 1 2 - 11290131 + 11290475 @@ -30034,7 +30471,7 @@ 1 2 - 11290131 + 11290475 @@ -30044,15 +30481,15 @@ commentbinding - 3316590 + 3316691 id - 3263040 + 3263140 element - 3173566 + 3173663 @@ -30066,12 +30503,12 @@ 1 2 - 3231287 + 3231385 2 85 - 31753 + 31754 @@ -30087,12 +30524,12 @@ 1 2 - 3030542 + 3030635 2 3 - 143023 + 143028 @@ -30102,15 +30539,15 @@ exprconv - 9603735 + 9605400 converted - 9603630 + 9605295 conversion - 9603735 + 9605400 @@ -30124,7 +30561,7 @@ 1 2 - 9603525 + 9605190 2 @@ -30145,7 +30582,7 @@ 1 2 - 9603735 + 9605400 @@ -30155,30 +30592,30 @@ compgenerated - 10716063 + 10710519 id - 10716063 + 10710519 synthetic_destructor_call - 1791782 + 1791215 element - 1334392 + 1333971 i - 415 + 414 destructor_call - 1791782 + 1791215 @@ -30192,17 +30629,17 @@ 1 2 - 888211 + 887930 2 3 - 438893 + 438754 3 19 - 7287 + 7285 @@ -30218,17 +30655,17 @@ 1 2 - 888211 + 887930 2 3 - 438893 + 438754 3 19 - 7287 + 7285 @@ -30376,7 +30813,7 @@ 1 2 - 1791782 + 1791215 @@ -30392,7 +30829,7 @@ 1 2 - 1791782 + 1791215 @@ -30402,15 +30839,15 @@ namespaces - 11095 + 11090 id - 11095 + 11090 name - 5865 + 5863 @@ -30424,7 +30861,7 @@ 1 2 - 11095 + 11090 @@ -30440,7 +30877,7 @@ 1 2 - 4795 + 4793 2 @@ -30471,15 +30908,15 @@ namespacembrs - 2025696 + 2024859 parentid - 10363 + 10359 memberid - 2025696 + 2024859 @@ -30493,7 +30930,7 @@ 1 2 - 1124 + 1123 2 @@ -30508,17 +30945,17 @@ 4 5 - 772 + 771 5 8 - 894 + 893 8 14 - 894 + 893 14 @@ -30528,12 +30965,12 @@ 22 37 - 799 + 798 37 57 - 799 + 798 57 @@ -30569,7 +31006,7 @@ 1 2 - 2025696 + 2024859 @@ -30579,19 +31016,19 @@ exprparents - 19401276 + 19397147 expr_id - 19401276 + 19397147 child_index - 19980 + 19976 parent_id - 12904774 + 12902028 @@ -30605,7 +31042,7 @@ 1 2 - 19401276 + 19397147 @@ -30621,7 +31058,7 @@ 1 2 - 19401276 + 19397147 @@ -30637,7 +31074,7 @@ 1 2 - 3844 + 3843 2 @@ -30652,7 +31089,7 @@ 4 5 - 8951 + 8950 5 @@ -30688,7 +31125,7 @@ 1 2 - 3844 + 3843 2 @@ -30703,7 +31140,7 @@ 4 5 - 8951 + 8950 5 @@ -30739,17 +31176,17 @@ 1 2 - 7374634 + 7373064 2 3 - 5068849 + 5067770 3 712 - 461291 + 461193 @@ -30765,17 +31202,17 @@ 1 2 - 7374634 + 7373064 2 3 - 5068849 + 5067770 3 712 - 461291 + 461193 @@ -30785,22 +31222,22 @@ expr_isload - 6961476 + 6961688 expr_id - 6961476 + 6961688 conversionkinds - 6048225 + 6048227 expr_id - 6048225 + 6048227 kind @@ -30818,7 +31255,7 @@ 1 2 - 6048225 + 6048227 @@ -30862,8 +31299,8 @@ 1 - 5829770 - 5829771 + 5829772 + 5829773 1 @@ -30874,11 +31311,11 @@ iscall - 6219948 + 6218005 caller - 6219948 + 6218005 kind @@ -30896,7 +31333,7 @@ 1 2 - 6219948 + 6218005 @@ -30920,8 +31357,8 @@ 23 - 268067 - 268068 + 268068 + 268069 23 @@ -30932,11 +31369,11 @@ numtemplatearguments - 723402 + 722410 expr_id - 723402 + 722410 num @@ -30954,7 +31391,7 @@ 1 2 - 723402 + 722410 @@ -31063,23 +31500,23 @@ namequalifiers - 3258067 + 3257060 id - 3258067 + 3257060 qualifiableelement - 3258067 + 3257060 qualifyingelement - 50413 + 50397 location - 591864 + 591677 @@ -31093,7 +31530,7 @@ 1 2 - 3258067 + 3257060 @@ -31109,7 +31546,7 @@ 1 2 - 3258067 + 3257060 @@ -31125,7 +31562,7 @@ 1 2 - 3258067 + 3257060 @@ -31141,7 +31578,7 @@ 1 2 - 3258067 + 3257060 @@ -31157,7 +31594,7 @@ 1 2 - 3258067 + 3257060 @@ -31173,7 +31610,7 @@ 1 2 - 3258067 + 3257060 @@ -31189,25 +31626,25 @@ 1 2 - 33832 + 33821 2 3 - 8417 + 8414 3 5 - 4266 + 4265 5 1601 - 3782 + 3780 - 6806 + 6807 41956 115 @@ -31225,25 +31662,25 @@ 1 2 - 33832 + 33821 2 3 - 8417 + 8414 3 5 - 4266 + 4265 5 1601 - 3782 + 3780 - 6806 + 6807 41956 115 @@ -31261,22 +31698,22 @@ 1 2 - 36714 + 36703 2 3 - 7587 + 7585 3 6 - 3782 + 3780 6 20057 - 2329 + 2328 @@ -31292,22 +31729,22 @@ 1 2 - 85006 + 84956 2 6 - 40543 + 40553 6 7 - 427777 + 427642 7 192 - 38536 + 38524 @@ -31323,22 +31760,22 @@ 1 2 - 85006 + 84956 2 6 - 40543 + 40553 6 7 - 427777 + 427642 7 192 - 38536 + 38524 @@ -31354,22 +31791,22 @@ 1 2 - 119346 + 119308 2 4 - 14252 + 14247 4 5 - 445212 + 445072 5 33 - 13053 + 13048 @@ -31379,15 +31816,15 @@ varbind - 8226107 + 8230416 expr - 8226107 + 8230416 var - 1047517 + 1047294 @@ -31401,7 +31838,7 @@ 1 2 - 8226107 + 8230416 @@ -31417,52 +31854,52 @@ 1 2 - 171069 + 171032 2 3 - 188187 + 188147 3 4 - 145251 + 145220 4 5 - 116319 + 116294 5 6 - 82924 + 82907 6 7 - 65638 + 65624 7 9 - 80595 + 80578 9 13 - 82139 + 81335 13 - 28 - 80286 + 27 + 78895 - 28 + 27 5137 - 35106 + 37259 @@ -31472,15 +31909,15 @@ funbind - 6230372 + 6228425 expr - 6227720 + 6225774 fun - 295540 + 295469 @@ -31494,12 +31931,12 @@ 1 2 - 6225068 + 6223123 2 3 - 2652 + 2651 @@ -31515,27 +31952,27 @@ 1 2 - 194320 + 194282 2 3 - 41557 + 41544 3 4 - 18403 + 18397 4 8 - 24376 + 24368 8 37798 - 16881 + 16876 @@ -31545,11 +31982,11 @@ expr_allocator - 57054 + 56975 expr - 57054 + 56975 func @@ -31571,7 +32008,7 @@ 1 2 - 57054 + 56975 @@ -31587,7 +32024,7 @@ 1 2 - 57054 + 56975 @@ -31671,11 +32108,11 @@ expr_deallocator - 67880 + 67787 expr - 67880 + 67787 func @@ -31697,7 +32134,7 @@ 1 2 - 67880 + 67787 @@ -31713,7 +32150,7 @@ 1 2 - 67880 + 67787 @@ -31807,26 +32244,26 @@ expr_cond_two_operand - 722 + 652 cond - 722 + 652 expr_cond_guard - 896444 + 895300 cond - 896444 + 895300 guard - 896444 + 895300 @@ -31840,7 +32277,7 @@ 1 2 - 896444 + 895300 @@ -31856,7 +32293,7 @@ 1 2 - 896444 + 895300 @@ -31866,15 +32303,15 @@ expr_cond_true - 896441 + 895297 cond - 896441 + 895297 true - 896441 + 895297 @@ -31888,7 +32325,7 @@ 1 2 - 896441 + 895297 @@ -31904,7 +32341,7 @@ 1 2 - 896441 + 895297 @@ -31914,15 +32351,15 @@ expr_cond_false - 896444 + 895300 cond - 896444 + 895300 false - 896444 + 895300 @@ -31936,7 +32373,7 @@ 1 2 - 896444 + 895300 @@ -31952,7 +32389,7 @@ 1 2 - 896444 + 895300 @@ -31962,15 +32399,15 @@ values - 14099248 + 13198553 id - 14099248 + 13198553 str - 128199 + 113721 @@ -31984,7 +32421,7 @@ 1 2 - 14099248 + 13198553 @@ -32000,27 +32437,27 @@ 1 2 - 88599 + 78593 2 3 - 17382 + 15419 3 7 - 11000 + 9741 7 - 359 - 9621 + 351 + 8529 - 360 - 562781 - 1593 + 352 + 660247 + 1436 @@ -32030,11 +32467,11 @@ valuetext - 6605580 + 6605633 id - 6605580 + 6605633 text @@ -32052,7 +32489,7 @@ 1 2 - 6605580 + 6605633 @@ -32082,7 +32519,7 @@ 7 - 593260 + 593269 27560 @@ -32093,15 +32530,15 @@ valuebind - 14484483 + 13543087 val - 14099248 + 13198553 expr - 14484483 + 13543087 @@ -32115,12 +32552,12 @@ 1 2 - 13735579 + 12873876 2 6 - 363669 + 324676 @@ -32136,7 +32573,7 @@ 1 2 - 14484483 + 13543087 @@ -32146,15 +32583,15 @@ fieldoffsets - 1441833 + 1441877 id - 1441833 + 1441877 byteoffset - 31021 + 31022 bitoffset @@ -32172,7 +32609,7 @@ 1 2 - 1441833 + 1441877 @@ -32188,7 +32625,7 @@ 1 2 - 1441833 + 1441877 @@ -32204,7 +32641,7 @@ 1 2 - 17804 + 17805 2 @@ -32250,7 +32687,7 @@ 1 2 - 30092 + 30093 2 @@ -32347,19 +32784,19 @@ bitfield - 27388 + 26910 id - 27388 + 26910 bits - 279 + 3363 declared_bits - 279 + 3363 @@ -32373,7 +32810,7 @@ 1 2 - 27388 + 26910 @@ -32389,7 +32826,7 @@ 1 2 - 27388 + 26910 @@ -32405,62 +32842,42 @@ 1 2 - 58 + 941 2 3 - 32 + 807 3 4 - 26 + 269 4 5 - 19 + 269 5 6 - 19 + 269 6 - 7 - 19 + 8 + 269 - 10 + 8 11 - 19 - - - 18 - 21 - 19 - - - 26 - 33 - 19 - - - 36 - 79 - 19 - - - 82 - 1081 - 19 + 269 - 2547 - 2548 - 6 + 12 + 115 + 269 @@ -32476,7 +32893,7 @@ 1 2 - 279 + 3363 @@ -32492,62 +32909,42 @@ 1 2 - 58 + 941 2 3 - 32 + 807 3 4 - 26 + 269 4 5 - 19 + 269 5 6 - 19 + 269 6 - 7 - 19 + 8 + 269 - 10 + 8 11 - 19 - - - 18 - 21 - 19 - - - 26 - 33 - 19 - - - 36 - 79 - 19 - - - 82 - 1081 - 19 + 269 - 2547 - 2548 - 6 + 12 + 115 + 269 @@ -32563,7 +32960,7 @@ 1 2 - 279 + 3363 @@ -32573,23 +32970,23 @@ initialisers - 2336670 + 2336741 init - 2336670 + 2336741 var - 983090 + 983120 expr - 2336670 + 2336741 location - 539034 + 539051 @@ -32603,7 +33000,7 @@ 1 2 - 2336670 + 2336741 @@ -32619,7 +33016,7 @@ 1 2 - 2336670 + 2336741 @@ -32635,7 +33032,7 @@ 1 2 - 2336670 + 2336741 @@ -32651,17 +33048,17 @@ 1 2 - 865933 + 865959 2 15 - 39245 + 39247 16 25 - 77910 + 77913 @@ -32677,17 +33074,17 @@ 1 2 - 865933 + 865959 2 15 - 39245 + 39247 16 25 - 77910 + 77913 @@ -32703,7 +33100,7 @@ 1 2 - 983081 + 983111 2 @@ -32724,7 +33121,7 @@ 1 2 - 2336670 + 2336741 @@ -32740,7 +33137,7 @@ 1 2 - 2336670 + 2336741 @@ -32756,7 +33153,7 @@ 1 2 - 2336670 + 2336741 @@ -32772,22 +33169,22 @@ 1 2 - 439415 + 439428 2 3 - 32732 + 32733 3 15 - 42316 + 42317 15 111551 - 24570 + 24571 @@ -32803,12 +33200,12 @@ 1 2 - 470681 + 470696 2 4 - 49306 + 49308 4 @@ -32829,22 +33226,22 @@ 1 2 - 439415 + 439428 2 3 - 32732 + 32733 3 15 - 42316 + 42317 15 111551 - 24570 + 24571 @@ -32854,26 +33251,26 @@ braced_initialisers - 74303 + 74268 init - 74303 + 74268 expr_ancestor - 1798193 + 1797625 exp - 1798193 + 1797625 ancestor - 899973 + 899688 @@ -32887,7 +33284,7 @@ 1 2 - 1798193 + 1797625 @@ -32903,17 +33300,17 @@ 1 2 - 18311 + 18305 2 3 - 870868 + 870593 3 19 - 10793 + 10789 @@ -32923,19 +33320,19 @@ exprs - 25135853 + 25136620 id - 25135853 + 25136620 kind - 1581 + 1448 location - 11535468 + 10563688 @@ -32949,7 +33346,7 @@ 1 2 - 25135853 + 25136620 @@ -32965,7 +33362,7 @@ 1 2 - 25135853 + 25136620 @@ -32981,72 +33378,72 @@ 1 10 - 119 + 109 12 18 - 119 + 109 26 100 - 119 + 109 105 305 - 119 + 109 323 - 417 - 119 + 467 + 109 - 466 - 876 - 119 + 607 + 893 + 109 - 892 + 906 1658 - 119 + 109 - 1680 + 1781 2386 - 119 + 109 3210 - 4067 - 119 + 4267 + 109 - 4299 + 4809 5185 - 119 + 109 5187 - 20392 - 119 + 22126 + 109 26363 50205 - 119 + 109 - 61894 - 137424 - 119 + 63936 + 144106 + 109 - 286226 - 286227 - 23 + 312846 + 312847 + 21 @@ -33062,72 +33459,72 @@ 1 9 - 119 + 109 9 15 - 119 + 109 17 96 - 119 + 109 99 222 - 119 + 109 260 383 - 119 + 109 408 594 - 119 + 109 599 749 - 119 + 109 864 1774 - 119 + 109 1812 2545 - 119 + 109 2623 2919 - 119 + 109 3419 4913 - 119 + 109 5471 21139 - 119 + 109 26254 76840 - 119 + 109 - 223932 - 223933 - 23 + 224078 + 224079 + 21 @@ -33143,22 +33540,22 @@ 1 2 - 9705660 + 8887659 2 3 - 898509 + 818573 3 16 - 866990 + 793536 16 71733 - 64307 + 63919 @@ -33174,17 +33571,17 @@ 1 2 - 9853403 + 9023791 2 3 - 844292 + 772932 3 32 - 837773 + 766964 @@ -33194,15 +33591,15 @@ expr_reuse - 907883 + 907596 reuse - 907883 + 907596 original - 907883 + 907596 value_category @@ -33220,7 +33617,7 @@ 1 2 - 907883 + 907596 @@ -33236,7 +33633,7 @@ 1 2 - 907883 + 907596 @@ -33252,7 +33649,7 @@ 1 2 - 907883 + 907596 @@ -33268,7 +33665,7 @@ 1 2 - 907883 + 907596 @@ -33320,19 +33717,19 @@ expr_types - 25135853 + 25136620 id - 25135853 + 25136620 typeid - 200113 + 213831 value_category - 47 + 43 @@ -33346,7 +33743,7 @@ 1 2 - 25135853 + 25136620 @@ -33362,7 +33759,7 @@ 1 2 - 25135853 + 25136620 @@ -33378,52 +33775,52 @@ 1 2 - 50525 + 52421 2 3 - 34227 + 35130 3 4 - 15819 + 14504 4 5 - 11696 + 14504 5 - 7 - 14045 + 8 + 17510 - 7 - 11 - 16658 + 8 + 14 + 17378 - 11 - 19 - 16130 + 14 + 24 + 16391 - 19 - 37 - 15124 + 24 + 49 + 16084 - 37 + 49 134 - 15076 + 16105 134 - 467220 - 10809 + 440938 + 13801 @@ -33439,12 +33836,12 @@ 1 2 - 168858 + 185591 2 3 - 31255 + 28240 @@ -33458,14 +33855,14 @@ 12 - 110354 - 110355 - 23 + 153383 + 153384 + 21 - 938347 - 938348 - 23 + 992173 + 992174 + 21 @@ -33479,14 +33876,14 @@ 12 - 2274 - 2275 - 23 + 2282 + 2283 + 21 - 7379 - 7380 - 23 + 8750 + 8751 + 21 @@ -33507,15 +33904,15 @@ new_allocated_type - 58257 + 58177 expr - 58257 + 58177 type_id - 34541 + 34494 @@ -33529,7 +33926,7 @@ 1 2 - 58257 + 58177 @@ -33545,17 +33942,17 @@ 1 2 - 14521 + 14501 2 3 - 18259 + 18234 3 19 - 1761 + 1759 @@ -34964,15 +35361,15 @@ condition_decl_bind - 438294 + 438155 expr - 438294 + 438155 decl - 438294 + 438155 @@ -34986,7 +35383,7 @@ 1 2 - 438294 + 438155 @@ -35002,7 +35399,7 @@ 1 2 - 438294 + 438155 @@ -35012,15 +35409,15 @@ typeid_bind - 60405 + 60322 expr - 60405 + 60322 type_id - 20106 + 20078 @@ -35034,7 +35431,7 @@ 1 2 - 60405 + 60322 @@ -35050,17 +35447,17 @@ 1 2 - 3737 + 3732 2 3 - 15853 + 15831 3 328 - 515 + 514 @@ -35070,11 +35467,11 @@ uuidof_bind - 27727 + 27728 expr - 27727 + 27728 type_id @@ -35092,7 +35489,7 @@ 1 2 - 27727 + 27728 @@ -35108,7 +35505,7 @@ 1 2 - 27233 + 27234 2 @@ -35123,15 +35520,15 @@ sizeof_bind - 245234 + 241252 expr - 245234 + 241252 type_id - 12607 + 11189 @@ -35145,7 +35542,7 @@ 1 2 - 245234 + 241252 @@ -35161,42 +35558,42 @@ 1 2 - 4410 + 3901 2 3 - 3103 + 2758 3 4 - 1164 + 1021 4 5 - 1340 + 1136 5 6 - 318 + 294 6 7 - 1164 + 1061 7 - 42 - 949 + 40 + 848 - 42 - 5351 - 156 + 40 + 6061 + 167 @@ -35254,11 +35651,11 @@ lambdas - 17829 + 17804 expr - 17829 + 17804 default_capture @@ -35280,7 +35677,7 @@ 1 2 - 17829 + 17804 @@ -35296,7 +35693,7 @@ 1 2 - 17829 + 17804 @@ -35423,7 +35820,7 @@ location - 18603 + 18604 @@ -36509,7 +36906,7 @@ 1 2 - 17380 + 17381 2 @@ -36530,7 +36927,7 @@ 1 2 - 17857 + 17858 2 @@ -36577,7 +36974,7 @@ 1 2 - 18577 + 18578 2 @@ -36598,7 +36995,7 @@ 1 2 - 18603 + 18604 @@ -36608,11 +37005,11 @@ fold - 1374 + 1372 expr - 1374 + 1372 operator @@ -36634,7 +37031,7 @@ 1 2 - 1374 + 1372 @@ -36650,7 +37047,7 @@ 1 2 - 1374 + 1372 @@ -36729,11 +37126,11 @@ stmts - 6324260 + 6324453 id - 6324260 + 6324453 kind @@ -36741,7 +37138,7 @@ location - 2966229 + 2966319 @@ -36755,7 +37152,7 @@ 1 2 - 6324260 + 6324453 @@ -36771,7 +37168,7 @@ 1 2 - 6324260 + 6324453 @@ -36999,22 +37396,22 @@ 1 2 - 2357133 + 2357205 2 3 - 243530 + 243538 3 8 - 228595 + 228602 8 653 - 136969 + 136973 @@ -37030,12 +37427,12 @@ 1 2 - 2892631 + 2892720 2 8 - 73597 + 73599 @@ -37141,11 +37538,11 @@ type_is_vla - 47 + 43 type_id - 47 + 43 @@ -37200,15 +37597,15 @@ if_then - 987520 + 987309 if_stmt - 987520 + 987309 then_id - 987520 + 987309 @@ -37222,7 +37619,7 @@ 1 2 - 987520 + 987309 @@ -37238,7 +37635,7 @@ 1 2 - 987520 + 987309 @@ -37248,15 +37645,15 @@ if_else - 468505 + 468357 if_stmt - 468505 + 468357 else_id - 468505 + 468357 @@ -37270,7 +37667,7 @@ 1 2 - 468505 + 468357 @@ -37286,7 +37683,7 @@ 1 2 - 468505 + 468357 @@ -37344,15 +37741,15 @@ constexpr_if_then - 72386 + 72388 constexpr_if_stmt - 72386 + 72388 then_id - 72386 + 72388 @@ -37366,7 +37763,7 @@ 1 2 - 72386 + 72388 @@ -37382,7 +37779,7 @@ 1 2 - 72386 + 72388 @@ -37392,15 +37789,15 @@ constexpr_if_else - 41978 + 41980 constexpr_if_stmt - 41978 + 41980 else_id - 41978 + 41980 @@ -37414,7 +37811,7 @@ 1 2 - 41978 + 41980 @@ -37430,7 +37827,7 @@ 1 2 - 41978 + 41980 @@ -37536,15 +37933,15 @@ while_body - 39540 + 39531 while_stmt - 39540 + 39531 body_id - 39540 + 39531 @@ -37558,7 +37955,7 @@ 1 2 - 39540 + 39531 @@ -37574,7 +37971,7 @@ 1 2 - 39540 + 39531 @@ -37584,15 +37981,15 @@ do_body - 258278 + 232977 do_stmt - 258278 + 232977 body_id - 258278 + 232977 @@ -37606,7 +38003,7 @@ 1 2 - 258278 + 232977 @@ -37622,7 +38019,7 @@ 1 2 - 258278 + 232977 @@ -37680,19 +38077,19 @@ switch_case - 896214 + 895930 switch_stmt - 441453 + 441314 index - 415 + 414 case_id - 896214 + 895930 @@ -37711,12 +38108,12 @@ 2 3 - 438363 + 438224 3 19 - 3067 + 3066 @@ -37737,12 +38134,12 @@ 2 3 - 438363 + 438224 3 19 - 3067 + 3066 @@ -37900,7 +38297,7 @@ 1 2 - 896214 + 895930 @@ -37916,7 +38313,7 @@ 1 2 - 896214 + 895930 @@ -37926,15 +38323,15 @@ switch_body - 441453 + 441314 switch_stmt - 441453 + 441314 body_id - 441453 + 441314 @@ -37948,7 +38345,7 @@ 1 2 - 441453 + 441314 @@ -37964,7 +38361,7 @@ 1 2 - 441453 + 441314 @@ -37974,15 +38371,15 @@ for_initialization - 73046 + 73031 for_stmt - 73046 + 73031 init_id - 73046 + 73031 @@ -37996,7 +38393,7 @@ 1 2 - 73046 + 73031 @@ -38012,7 +38409,7 @@ 1 2 - 73046 + 73031 @@ -38022,15 +38419,15 @@ for_condition - 76133 + 76117 for_stmt - 76133 + 76117 condition_id - 76133 + 76117 @@ -38044,7 +38441,7 @@ 1 2 - 76133 + 76117 @@ -38060,7 +38457,7 @@ 1 2 - 76133 + 76117 @@ -38070,15 +38467,15 @@ for_update - 73187 + 73171 for_stmt - 73187 + 73171 update_id - 73187 + 73171 @@ -38092,7 +38489,7 @@ 1 2 - 73187 + 73171 @@ -38108,7 +38505,7 @@ 1 2 - 73187 + 73171 @@ -38118,15 +38515,15 @@ for_body - 84159 + 84141 for_stmt - 84159 + 84141 body_id - 84159 + 84141 @@ -38140,7 +38537,7 @@ 1 2 - 84159 + 84141 @@ -38156,7 +38553,7 @@ 1 2 - 84159 + 84141 @@ -38166,11 +38563,11 @@ stmtparents - 5536437 + 5536606 id - 5536437 + 5536606 index @@ -38178,7 +38575,7 @@ parent - 2349072 + 2349144 @@ -38192,7 +38589,7 @@ 1 2 - 5536437 + 5536606 @@ -38208,7 +38605,7 @@ 1 2 - 5536437 + 5536606 @@ -38346,32 +38743,32 @@ 1 2 - 1349052 + 1349093 2 3 - 508947 + 508963 3 4 - 144286 + 144290 4 6 - 151883 + 151888 6 17 - 178119 + 178125 17 1943 - 16782 + 16783 @@ -38387,32 +38784,32 @@ 1 2 - 1349052 + 1349093 2 3 - 508947 + 508963 3 4 - 144286 + 144290 4 6 - 151883 + 151888 6 17 - 178119 + 178125 17 1943 - 16782 + 16783 @@ -38422,22 +38819,22 @@ ishandler - 47531 + 47453 block - 47531 + 47453 stmt_decl_bind - 730759 + 730619 stmt - 690289 + 690157 num @@ -38445,7 +38842,7 @@ decl - 730690 + 730550 @@ -38459,12 +38856,12 @@ 1 2 - 668061 + 667933 2 32 - 22228 + 22224 @@ -38480,12 +38877,12 @@ 1 2 - 668061 + 667933 2 32 - 22228 + 22224 @@ -38545,7 +38942,7 @@ 5480 - 170179 + 170178 8 @@ -38606,7 +39003,7 @@ 5480 - 170162 + 170161 8 @@ -38623,7 +39020,7 @@ 1 2 - 730666 + 730526 2 @@ -38644,7 +39041,7 @@ 1 2 - 730690 + 730550 @@ -38654,11 +39051,11 @@ stmt_decl_entry_bind - 730759 + 730619 stmt - 690289 + 690157 num @@ -38666,7 +39063,7 @@ decl_entry - 730759 + 730619 @@ -38680,12 +39077,12 @@ 1 2 - 668061 + 667933 2 32 - 22228 + 22224 @@ -38701,12 +39098,12 @@ 1 2 - 668061 + 667933 2 32 - 22228 + 22224 @@ -38766,7 +39163,7 @@ 5480 - 170179 + 170178 8 @@ -38827,7 +39224,7 @@ 5480 - 170179 + 170178 8 @@ -38844,7 +39241,7 @@ 1 2 - 730759 + 730619 @@ -38860,7 +39257,7 @@ 1 2 - 730759 + 730619 @@ -38870,15 +39267,15 @@ blockscope - 1838723 + 1838779 block - 1838723 + 1838779 enclosing - 1575683 + 1575731 @@ -38892,7 +39289,7 @@ 1 2 - 1838723 + 1838779 @@ -38908,17 +39305,17 @@ 1 2 - 1400368 + 1400410 2 3 - 129838 + 129842 3 28 - 45476 + 45478 @@ -38928,19 +39325,19 @@ jumpinfo - 347364 + 347302 id - 347364 + 347302 str - 28869 + 28864 target - 72506 + 72493 @@ -38954,7 +39351,7 @@ 1 2 - 347364 + 347302 @@ -38970,7 +39367,7 @@ 1 2 - 347364 + 347302 @@ -38986,12 +39383,12 @@ 2 3 - 13559 + 13557 3 4 - 6042 + 6041 4 @@ -39016,7 +39413,7 @@ 25 13711 - 1000 + 999 @@ -39032,7 +39429,7 @@ 1 2 - 23127 + 23122 2 @@ -39042,7 +39439,7 @@ 3 3321 - 2125 + 2124 @@ -39063,27 +39460,27 @@ 2 3 - 36111 + 36105 3 4 - 17584 + 17581 4 5 - 7358 + 7357 5 8 - 6400 + 6399 8 2124 - 5017 + 5016 @@ -39099,7 +39496,7 @@ 1 2 - 72506 + 72493 @@ -39109,11 +39506,11 @@ preprocdirects - 5704669 + 5704844 id - 5704669 + 5704844 kind @@ -39121,7 +39518,7 @@ location - 5701306 + 5701480 @@ -39135,7 +39532,7 @@ 1 2 - 5704669 + 5704844 @@ -39151,7 +39548,7 @@ 1 2 - 5704669 + 5704844 @@ -39299,7 +39696,7 @@ 1 2 - 5701171 + 5701345 26 @@ -39320,7 +39717,7 @@ 1 2 - 5701306 + 5701480 @@ -39330,15 +39727,15 @@ preprocpair - 1103825 + 1103859 begin - 846302 + 846328 elseelifend - 1103825 + 1103859 @@ -39352,12 +39749,12 @@ 1 2 - 601560 + 601579 2 3 - 235592 + 235599 3 @@ -39378,7 +39775,7 @@ 1 2 - 1103825 + 1103859 @@ -39388,41 +39785,41 @@ preproctrue - 388572 + 388584 branch - 388572 + 388584 preprocfalse - 273265 + 273273 branch - 273265 + 273273 preproctext - 4690318 + 4690461 id - 4690318 + 4690461 head - 3333139 + 3333241 body - 1948244 + 1948304 @@ -39436,7 +39833,7 @@ 1 2 - 4690318 + 4690461 @@ -39452,7 +39849,7 @@ 1 2 - 4690318 + 4690461 @@ -39468,12 +39865,12 @@ 1 2 - 3143697 + 3143793 2 740 - 189442 + 189448 @@ -39489,12 +39886,12 @@ 1 2 - 3252949 + 3253048 2 5 - 80190 + 80192 @@ -39510,17 +39907,17 @@ 1 2 - 1763645 + 1763699 2 6 - 146118 + 146122 6 12303 - 38480 + 38481 @@ -39536,17 +39933,17 @@ 1 2 - 1767547 + 1767601 2 7 - 146521 + 146526 7 2977 - 34175 + 34176 @@ -39556,15 +39953,15 @@ includes - 408680 + 408508 id - 408680 + 408508 included - 75282 + 75250 @@ -39578,7 +39975,7 @@ 1 2 - 408680 + 408508 @@ -39594,37 +39991,37 @@ 1 2 - 37254 + 37239 2 3 - 12111 + 12106 3 4 - 6353 + 6351 4 6 - 6868 + 6865 6 11 - 5798 + 5795 11 47 - 5649 + 5646 47 793 - 1246 + 1245 @@ -39634,15 +40031,15 @@ link_targets - 948 + 947 id - 948 + 947 binary - 948 + 947 @@ -39656,7 +40053,7 @@ 1 2 - 948 + 947 @@ -39672,7 +40069,7 @@ 1 2 - 948 + 947 @@ -39682,11 +40079,11 @@ link_parent - 38313696 + 38261175 element - 4873064 + 4866384 link_target @@ -39704,17 +40101,17 @@ 1 2 - 668840 + 667923 2 9 - 33983 + 33936 9 10 - 4170240 + 4164523 From 1ac47a892b6ef5f70d858df4531f663f509ec68f Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Tue, 15 Apr 2025 17:39:23 +0200 Subject: [PATCH 154/240] Swift: make extractor compile again after 6.1 upgrade --- swift/extractor/SwiftExtractor.cpp | 2 +- swift/extractor/infra/SwiftLocationExtractor.h | 1 + swift/extractor/infra/SwiftTagTraits.h | 7 +++++-- swift/extractor/mangler/SwiftMangler.cpp | 11 ++++------- swift/extractor/mangler/SwiftMangler.h | 1 - swift/extractor/translators/DeclTranslator.cpp | 8 -------- swift/extractor/translators/DeclTranslator.h | 1 - swift/extractor/translators/ExprTranslator.cpp | 2 +- swift/extractor/translators/TypeTranslator.cpp | 6 ------ swift/extractor/translators/TypeTranslator.h | 1 - swift/ql/.generated.list | 6 +++--- swift/ql/lib/codeql/swift/elements/MacroRole.qll | 2 +- swift/ql/lib/codeql/swift/generated/MacroRole.qll | 12 ++++++------ swift/ql/lib/codeql/swift/generated/Raw.qll | 2 +- swift/ql/lib/swift.dbscheme | 7 +------ swift/schema.py | 2 +- swift/third_party/load.bzl | 4 ++++ 17 files changed, 29 insertions(+), 46 deletions(-) diff --git a/swift/extractor/SwiftExtractor.cpp b/swift/extractor/SwiftExtractor.cpp index b0de6a7a2a49..3b994ee63ad0 100644 --- a/swift/extractor/SwiftExtractor.cpp +++ b/swift/extractor/SwiftExtractor.cpp @@ -155,7 +155,7 @@ static std::unordered_set extractDeclarations( if (primaryFile && primaryFile->getBufferID()) { auto& sourceManager = compiler.getSourceMgr(); auto tokens = swift::tokenize(compiler.getInvocation().getLangOptions(), sourceManager, - *primaryFile->getBufferID()); + primaryFile->getBufferID()); for (auto& token : tokens) { if (token.getKind() == swift::tok::comment) { comments.push_back(token); diff --git a/swift/extractor/infra/SwiftLocationExtractor.h b/swift/extractor/infra/SwiftLocationExtractor.h index dd015a94c8de..3a96cdcf6195 100644 --- a/swift/extractor/infra/SwiftLocationExtractor.h +++ b/swift/extractor/infra/SwiftLocationExtractor.h @@ -1,6 +1,7 @@ #pragma once #include +#include // needed (but not included) by the following header #include #include #include diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index 6c7e2309e840..b95cec8d7d97 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -177,6 +177,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::ABISafeConversionExpr, AbiSafeConversionExprTag) // different acronym convention MAP(swift::ActorIsolationErasureExpr, ActorIsolationErasureExprTag) MAP(swift::UnreachableExpr, UnreachableExprTag) + MAP(swift::UnsafeCastExpr, void) // TODO swift 6.1 MAP(swift::ExplicitCastExpr, ExplicitCastExprTag) MAP(swift::CheckedCastExpr, CheckedCastExprTag) MAP(swift::ForcedCheckedCastExpr, ForcedCheckedCastExprTag) @@ -204,6 +205,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::SingleValueStmtExpr, SingleValueStmtExprTag) MAP(swift::ExtractFunctionIsolationExpr, ExtractFunctionIsolationExprTag) MAP(swift::CurrentContextIsolationExpr, CurrentContextIsolationExprTag) + MAP(swift::TypeValueExpr, void) // TODO swift 6.1 MAP(swift::Decl, DeclTag) MAP(swift::ValueDecl, ValueDeclTag) MAP(swift::TypeDecl, TypeDeclTag) @@ -235,7 +237,6 @@ MAP(swift::Decl, DeclTag) MAP(swift::ExtensionDecl, ExtensionDeclTag) MAP(swift::TopLevelCodeDecl, TopLevelCodeDeclTag) MAP(swift::ImportDecl, ImportDeclTag) - MAP(swift::IfConfigDecl, IfConfigDeclTag) MAP(swift::PoundDiagnosticDecl, PoundDiagnosticDeclTag) MAP(swift::PrecedenceGroupDecl, PrecedenceGroupDeclTag) MAP(swift::MissingMemberDecl, MissingMemberDeclTag) @@ -284,6 +285,8 @@ MAP(swift::TypeBase, TypeTag) MAP(swift::BuiltinVectorType, BuiltinVectorTypeTag) MAP(swift::BuiltinPackIndexType, void) // SIL type, cannot really appear in the frontend run MAP(swift::BuiltinNonDefaultDistributedActorStorageType, void) // Does not appear in AST/SIL, only used during IRGen + MAP(swift::BuiltinFixedArrayType, void) // TODO swift 6.1 + MAP(swift::BuiltinUnboundGenericType, void) // TODO swift 6.1 MAP(swift::TupleType, TupleTypeTag) MAP(swift::ReferenceStorageType, ReferenceStorageTypeTag) MAP(swift::WeakStorageType, WeakStorageTypeTag) @@ -336,8 +339,8 @@ MAP(swift::TypeBase, TypeTag) MAP(swift::PackElementType, PackElementTypeTag) MAP(swift::TypeVariableType, void) // created during type checking and only used for constraint checking MAP(swift::ErrorUnionType, void) // created during type checking and only used for constraint checking + MAP(swift::IntegerType, void) // TODO swift 6.1 MAP(swift::SugarType, SugarTypeTag) - MAP(swift::ParenType, ParenTypeTag) MAP(swift::TypeAliasType, TypeAliasTypeTag) MAP(swift::SyntaxSugarType, SyntaxSugarTypeTag) MAP(swift::UnarySyntaxSugarType, UnarySyntaxSugarTypeTag) diff --git a/swift/extractor/mangler/SwiftMangler.cpp b/swift/extractor/mangler/SwiftMangler.cpp index 02465b1988a9..313c7c0a21e1 100644 --- a/swift/extractor/mangler/SwiftMangler.cpp +++ b/swift/extractor/mangler/SwiftMangler.cpp @@ -353,9 +353,10 @@ SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType( } SwiftMangledName SwiftMangler::visitOpenedArchetypeType(const swift::OpenedArchetypeType* type) { - llvm::SmallVector uuid; - type->getOpenedExistentialID().toString(uuid); - return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); + // llvm::SmallVector uuid; + // type->getOpenedExistentialID().toString(uuid); // <- doesn't compile any more + // return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); + return visitArchetypeType(type); } SwiftMangledName SwiftMangler::visitProtocolCompositionType( @@ -370,10 +371,6 @@ SwiftMangledName SwiftMangler::visitProtocolCompositionType( return ret; } -SwiftMangledName SwiftMangler::visitParenType(const swift::ParenType* type) { - return initMangled(type) << fetch(type->getUnderlyingType()); -} - SwiftMangledName SwiftMangler::visitLValueType(const swift::LValueType* type) { return initMangled(type) << fetch(type->getObjectType()); } diff --git a/swift/extractor/mangler/SwiftMangler.h b/swift/extractor/mangler/SwiftMangler.h index 6cf909db03be..e4eb19345ed7 100644 --- a/swift/extractor/mangler/SwiftMangler.h +++ b/swift/extractor/mangler/SwiftMangler.h @@ -94,7 +94,6 @@ class SwiftMangler : private swift::TypeVisitor, SwiftMangledName visitOpaqueTypeArchetypeType(const swift::OpaqueTypeArchetypeType* type); SwiftMangledName visitOpenedArchetypeType(const swift::OpenedArchetypeType* type); SwiftMangledName visitProtocolCompositionType(const swift::ProtocolCompositionType* type); - SwiftMangledName visitParenType(const swift::ParenType* type); SwiftMangledName visitLValueType(const swift::LValueType* type); SwiftMangledName visitDynamicSelfType(const swift::DynamicSelfType* type); SwiftMangledName visitUnboundGenericType(const swift::UnboundGenericType* type); diff --git a/swift/extractor/translators/DeclTranslator.cpp b/swift/extractor/translators/DeclTranslator.cpp index 77f9bd18b135..ab50777babb1 100644 --- a/swift/extractor/translators/DeclTranslator.cpp +++ b/swift/extractor/translators/DeclTranslator.cpp @@ -334,14 +334,6 @@ void DeclTranslator::fillAbstractStorageDecl(const swift::AbstractStorageDecl& d fillValueDecl(decl, entry); } -codeql::IfConfigDecl DeclTranslator::translateIfConfigDecl(const swift::IfConfigDecl& decl) { - auto entry = createEntry(decl); - if (auto activeClause = decl.getActiveClause()) { - entry.active_elements = dispatcher.fetchRepeatedLabels(activeClause->Elements); - } - return entry; -} - codeql::OpaqueTypeDecl DeclTranslator::translateOpaqueTypeDecl(const swift::OpaqueTypeDecl& decl) { auto entry = createEntry(decl); fillTypeDecl(decl, entry); diff --git a/swift/extractor/translators/DeclTranslator.h b/swift/extractor/translators/DeclTranslator.h index 1c61c89aa45f..57a6fdb9a2f4 100644 --- a/swift/extractor/translators/DeclTranslator.h +++ b/swift/extractor/translators/DeclTranslator.h @@ -44,7 +44,6 @@ class DeclTranslator : public AstTranslatorBase { codeql::ExtensionDecl translateExtensionDecl(const swift::ExtensionDecl& decl); codeql::ImportDecl translateImportDecl(const swift::ImportDecl& decl); codeql::ModuleDecl translateModuleDecl(const swift::ModuleDecl& decl); - codeql::IfConfigDecl translateIfConfigDecl(const swift::IfConfigDecl& decl); codeql::OpaqueTypeDecl translateOpaqueTypeDecl(const swift::OpaqueTypeDecl& decl); codeql::PoundDiagnosticDecl translatePoundDiagnosticDecl(const swift::PoundDiagnosticDecl& decl); codeql::MissingMemberDecl translateMissingMemberDecl(const swift::MissingMemberDecl& decl); diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index 915d26b33731..e3b8c17c52a8 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -624,7 +624,7 @@ codeql::AppliedPropertyWrapperExpr ExprTranslator::translateAppliedPropertyWrapp codeql::RegexLiteralExpr ExprTranslator::translateRegexLiteralExpr( const swift::RegexLiteralExpr& expr) { auto entry = createExprEntry(expr); - auto pattern = expr.getRegexText(); + auto pattern = expr.getParsedRegexText(); // TODO: there is now this and getRegexToEmit // the pattern has enclosing '/' delimiters, we'd rather get it without entry.pattern = pattern.substr(1, pattern.size() - 2); entry.version = expr.getVersion(); diff --git a/swift/extractor/translators/TypeTranslator.cpp b/swift/extractor/translators/TypeTranslator.cpp index 46e32a5bdeea..3404bb7d95ab 100644 --- a/swift/extractor/translators/TypeTranslator.cpp +++ b/swift/extractor/translators/TypeTranslator.cpp @@ -76,12 +76,6 @@ codeql::DependentMemberType TypeTranslator::translateDependentMemberType( return entry; } -codeql::ParenType TypeTranslator::translateParenType(const swift::ParenType& type) { - auto entry = createTypeEntry(type); - entry.type = dispatcher.fetchLabel(type.getUnderlyingType()); - return entry; -} - codeql::OptionalType TypeTranslator::translateOptionalType(const swift::OptionalType& type) { auto entry = createTypeEntry(type); fillUnarySyntaxSugarType(type, entry); diff --git a/swift/extractor/translators/TypeTranslator.h b/swift/extractor/translators/TypeTranslator.h index 6e5acf53546c..02eb24632f46 100644 --- a/swift/extractor/translators/TypeTranslator.h +++ b/swift/extractor/translators/TypeTranslator.h @@ -24,7 +24,6 @@ class TypeTranslator : public TypeTranslatorBase { const swift::ExistentialMetatypeType& type); codeql::TypeAliasType translateTypeAliasType(const swift::TypeAliasType& type); codeql::DependentMemberType translateDependentMemberType(const swift::DependentMemberType& type); - codeql::ParenType translateParenType(const swift::ParenType& type); codeql::UnarySyntaxSugarType translateUnarySyntaxSugarType( const swift::UnarySyntaxSugarType& type); codeql::OptionalType translateOptionalType(const swift::OptionalType& type); diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 61bc11662f52..04ed47ffe922 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -12,7 +12,7 @@ lib/codeql/swift/elements/File.qll 642fde19ad366151c71ccb44c32b6063c3374d7169ada lib/codeql/swift/elements/KeyPathComponent.qll cc64d5a3cc6e6aa12faee7dfc95e6b5e10d0adb9bc10d815a93a3a61fd70e535 ab82cebb73753bf72ef8f79c271851dc7e738a25c7100b634630f4363ceec061 lib/codeql/swift/elements/Locatable.qll a4e01abd3f337a60e3741705cede50be974ccffcb707a53f2b378972838c5977 89ba4dbebcfa291797407c27087d91a18b1ec1bc97140a14ec08dbb12cef7395 lib/codeql/swift/elements/Location.qll db213e8e27f8d732ad472c16929f2c503634c622d4d7b6b6977ed8b7b3c71c5b 9b951af94891848ecea9a690741e4a401c4b7ad676fd1fcee703fce4dcee2da4 -lib/codeql/swift/elements/MacroRole.qll 2e814f75c578763570addab34c423245e4e68dba651ac9df05441b25c7ce6186 8822c126e2e19e9f7a2eb7035408acff3ac1d99ccb87def2a3b1d26dcfaeccfe +lib/codeql/swift/elements/MacroRole.qll d55500010c47fab14fb2110db0afadef5f1f01115d05c803c9fd114508aca6da 858a7fe124cb8874e1fe62b3b36153740b0bb1cd1e9ed0005b36d01040960ed8 lib/codeql/swift/elements/OtherAvailabilitySpec.qll b3e3aafc7b1f7b1ff2efa2bc9ff64370cc6847760a46ff5594f5144caee858ab 6630e73998c9359b6cefd265222cb72274b4484d6904b4a9f949bdb7a2781c0f lib/codeql/swift/elements/PlatformVersionAvailabilitySpec.qll 1a94d317cbb1731844986b57bbdc4095d90957c671d5248bc581bc1fdbb18f8b 3888eb1afc641d365c30fa514962f1a31b9b9c04383836e0062445e566003d34 lib/codeql/swift/elements/UnknownFile.qll 29e9f59c24c3ee6c2b01ea19390dd6730192628e5e4a541c3c00a42d16daad78 0ec046d67ebdc1722915b0d952468d1d3c3dfdf2c61e7fa215c7ba2fb91de04c @@ -719,12 +719,12 @@ lib/codeql/swift/generated/File.qll 476ac95566ef0080e0ad8c3da144b1be1d945d2f33a2 lib/codeql/swift/generated/KeyPathComponent.qll 5276acdc9a4ff0ec0cc8af615c04043391fb99613731ddcc86db4e47b37c8c5a ccc0931bbd6cc2cfae5037c2ee17bbdcbd87536f5fed90d07e73065c016c4382 lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fda2d2008700f955ad82ce109a7 e97d4d4fb8a4800e0008cc00f60c8ed9b1ebd5f1140fd85e68b034616178d721 lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa -lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c +lib/codeql/swift/generated/MacroRole.qll facf907e75490d69cd401c491215e4719324d751f40ea46c86ccf24cf3663c1f 969d8d4b44e3f1a9c193a152a4d83a303e56d2dbb871fc920c47a33f699cf018 lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f lib/codeql/swift/generated/ParentChild.qll 7c9537f74a4c5a02622ce28c3de4b0ce02a7027d2e9aea9a860ece6a1e2ec340 49c1993b2a96df66903bffde78d63d8f4c68b2d604c419b20d88b63406366156 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 522f8500ce46d62fca22730ade5fa4716452adece25ffc36c50582b653f2fe6f 4d870e0695fff541c1a14eadc8ba51960a264ba2e6e53d0ccc32b34c7fd2cadd +lib/codeql/swift/generated/Raw.qll 6012194c54f8992401dffc0916b5790cdf581f18ac7b884379362dc807a52706 f9538fdfb326b715fdbc47e9e8b310df684d5a34519f751a65b3a4a75e430ce9 lib/codeql/swift/generated/Synth.qll a14dddab40979df82d30b2d73407fe0058a803ed6e1a882cd9a6ae5ffd240526 0879d2476a42123b46eee216d4ea03523e0c04fe0b68d9a68e0046253edb1bc9 lib/codeql/swift/generated/SynthConstructors.qll f64121911e082aa15478eb8779025cee96e97503724c02aff31741e65a894a4b f64121911e082aa15478eb8779025cee96e97503724c02aff31741e65a894a4b lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d diff --git a/swift/ql/lib/codeql/swift/elements/MacroRole.qll b/swift/ql/lib/codeql/swift/elements/MacroRole.qll index 222644e05e0f..bb1f9e7519aa 100644 --- a/swift/ql/lib/codeql/swift/elements/MacroRole.qll +++ b/swift/ql/lib/codeql/swift/elements/MacroRole.qll @@ -5,7 +5,7 @@ private import internal.MacroRoleImpl import codeql.swift.elements.AstNode -import codeql.swift.elements.expr.TypeExpr +import codeql.swift.elements.expr.Expr /** * The role of a macro, for example #freestanding(declaration) or @attached(member). diff --git a/swift/ql/lib/codeql/swift/generated/MacroRole.qll b/swift/ql/lib/codeql/swift/generated/MacroRole.qll index e3a66dc1e05b..47153ab6bfec 100644 --- a/swift/ql/lib/codeql/swift/generated/MacroRole.qll +++ b/swift/ql/lib/codeql/swift/generated/MacroRole.qll @@ -7,7 +7,7 @@ private import codeql.swift.generated.Synth private import codeql.swift.generated.Raw import codeql.swift.elements.internal.AstNodeImpl::Impl as AstNodeImpl -import codeql.swift.elements.expr.TypeExpr +import codeql.swift.elements.expr.Expr /** * INTERNAL: This module contains the fully generated definition of `MacroRole` and should not @@ -44,9 +44,9 @@ module Generated { * This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the * behavior of both the `Immediate` and non-`Immediate` versions. */ - TypeExpr getImmediateConformance(int index) { + Expr getImmediateConformance(int index) { result = - Synth::convertTypeExprFromRaw(Synth::convertMacroRoleToRaw(this) + Synth::convertExprFromRaw(Synth::convertMacroRoleToRaw(this) .(Raw::MacroRole) .getConformance(index)) } @@ -54,8 +54,8 @@ module Generated { /** * Gets the `index`th conformance of this macro role (0-based). */ - final TypeExpr getConformance(int index) { - exists(TypeExpr immediate | + final Expr getConformance(int index) { + exists(Expr immediate | immediate = this.getImmediateConformance(index) and result = immediate.resolve() ) @@ -64,7 +64,7 @@ module Generated { /** * Gets any of the conformances of this macro role. */ - final TypeExpr getAConformance() { result = this.getConformance(_) } + final Expr getAConformance() { result = this.getConformance(_) } /** * Gets the number of conformances of this macro role. diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index 2e0e08599cea..c59c831a1ee2 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -266,7 +266,7 @@ module Raw { /** * Gets the `index`th conformance of this macro role (0-based). */ - TypeExpr getConformance(int index) { macro_role_conformances(this, index, result) } + Expr getConformance(int index) { macro_role_conformances(this, index, result) } /** * Gets the `index`th name of this macro role (0-based). diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index be2357fd0023..4dd3d5ca8a89 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -210,7 +210,7 @@ macro_roles( macro_role_conformances( int id: @macro_role ref, int index: int ref, - int conformance: @type_expr_or_none ref + int conformance: @expr_or_none ref ); #keyset[id, index] @@ -2794,11 +2794,6 @@ variadic_sequence_types( //dir=type | @unspecified_element ; -@type_expr_or_none = - @type_expr -| @unspecified_element -; - @type_repr_or_none = @type_repr | @unspecified_element diff --git a/swift/schema.py b/swift/schema.py index d99a00c2e67d..78750ae2baac 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1394,7 +1394,7 @@ class MacroRole(AstNode): """ kind: int | doc("kind of this macro role (declaration, expression, member, etc.)") | ql.internal macro_syntax: int | doc("#freestanding or @attached") | ql.internal - conformances: list[TypeExpr] | doc("conformances of this macro role") + conformances: list[Expr] | doc("conformances of this macro role") names: list[string] | doc("names of this macro role") class MacroDecl(GenericContext, ValueDecl): diff --git a/swift/third_party/load.bzl b/swift/third_party/load.bzl index d19345a18803..8c891a26fc38 100644 --- a/swift/third_party/load.bzl +++ b/swift/third_party/load.bzl @@ -5,6 +5,10 @@ load("//misc/bazel:lfs.bzl", "lfs_archive", "lfs_files") _override = { # these are used to test new artifacts. Must be empty before merging to main + "swift-prebuilt-macOS-swift-6.1-RELEASE-78.tar.zst": "4dcfe858b5519327c9b0c99735b47fe75c7a5090793d917de1ba6e42795aa86d", + "swift-prebuilt-Linux-swift-6.1-RELEASE-78.tar.zst": "d01b90bccfec46995bdf98a59339bd94e64257da99b4963148869c4a108bc2a9", + "resource-dir-macOS-swift-6.1-RELEASE-91.zip": "12bef89163486ac24d9ca00a5cc6ef3851b633e6fa63b7493c518e4d426e036c", + "resource-dir-Linux-swift-6.1-RELEASE-91.zip": "874932f93c4ca6269ae3a9e9c841916b3fd88f65f5018eec8777a52dde56901d", } _staging_url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/staging-{}/{}" From 4fc5a73bac430e85e886288c954a42f98f274872 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 17 Apr 2025 10:34:17 +0200 Subject: [PATCH 155/240] Swift: Update mangling of `OpenedArchetypeType` --- swift/extractor/mangler/SwiftMangler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/swift/extractor/mangler/SwiftMangler.cpp b/swift/extractor/mangler/SwiftMangler.cpp index 313c7c0a21e1..81678256db22 100644 --- a/swift/extractor/mangler/SwiftMangler.cpp +++ b/swift/extractor/mangler/SwiftMangler.cpp @@ -6,8 +6,8 @@ #include #include #include +#include #include -#include using namespace codeql; @@ -353,10 +353,10 @@ SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType( } SwiftMangledName SwiftMangler::visitOpenedArchetypeType(const swift::OpenedArchetypeType* type) { - // llvm::SmallVector uuid; - // type->getOpenedExistentialID().toString(uuid); // <- doesn't compile any more - // return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); - return visitArchetypeType(type); + auto *env = type->getGenericEnvironment(); + llvm::SmallVector uuid; + env->getOpenedExistentialUUID().toString(uuid); + return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); } SwiftMangledName SwiftMangler::visitProtocolCompositionType( From 30242ed6fb3c7fca0bf478feb83dd64294f0c666 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 17 Apr 2025 10:34:48 +0200 Subject: [PATCH 156/240] Swift: Remove "to do" comment --- swift/extractor/translators/ExprTranslator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index e3b8c17c52a8..c57cfd5b9ee8 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -624,7 +624,7 @@ codeql::AppliedPropertyWrapperExpr ExprTranslator::translateAppliedPropertyWrapp codeql::RegexLiteralExpr ExprTranslator::translateRegexLiteralExpr( const swift::RegexLiteralExpr& expr) { auto entry = createExprEntry(expr); - auto pattern = expr.getParsedRegexText(); // TODO: there is now this and getRegexToEmit + auto pattern = expr.getParsedRegexText(); // the pattern has enclosing '/' delimiters, we'd rather get it without entry.pattern = pattern.substr(1, pattern.size() - 2); entry.version = expr.getVersion(); From 7834a3d9e4f02b8d03d099a4a5b33beac49b23ee Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 17 Apr 2025 15:46:35 +0200 Subject: [PATCH 157/240] Swift: expand mangling of `ExistentialMetatypeType` --- swift/extractor/mangler/SwiftMangler.cpp | 8 +++++++- swift/extractor/mangler/SwiftMangler.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/swift/extractor/mangler/SwiftMangler.cpp b/swift/extractor/mangler/SwiftMangler.cpp index 81678256db22..5771f2436792 100644 --- a/swift/extractor/mangler/SwiftMangler.cpp +++ b/swift/extractor/mangler/SwiftMangler.cpp @@ -298,6 +298,12 @@ SwiftMangledName SwiftMangler::visitAnyMetatypeType(const swift::AnyMetatypeType return initMangled(type) << fetch(type->getInstanceType()); } +SwiftMangledName SwiftMangler::visitExistentialMetatypeType( + const swift::ExistentialMetatypeType* type) { + return visitAnyMetatypeType(type) + << fetch(const_cast(type)->getExistentialInstanceType()); +} + SwiftMangledName SwiftMangler::visitDependentMemberType(const swift::DependentMemberType* type) { return initMangled(type) << fetch(type->getBase()) << fetch(type->getAssocType()); } @@ -353,7 +359,7 @@ SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType( } SwiftMangledName SwiftMangler::visitOpenedArchetypeType(const swift::OpenedArchetypeType* type) { - auto *env = type->getGenericEnvironment(); + auto* env = type->getGenericEnvironment(); llvm::SmallVector uuid; env->getOpenedExistentialUUID().toString(uuid); return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); diff --git a/swift/extractor/mangler/SwiftMangler.h b/swift/extractor/mangler/SwiftMangler.h index e4eb19345ed7..2e3acbb9103c 100644 --- a/swift/extractor/mangler/SwiftMangler.h +++ b/swift/extractor/mangler/SwiftMangler.h @@ -84,6 +84,7 @@ class SwiftMangler : private swift::TypeVisitor, SwiftMangledName visitGenericFunctionType(const swift::GenericFunctionType* type); SwiftMangledName visitGenericTypeParamType(const swift::GenericTypeParamType* type); SwiftMangledName visitAnyMetatypeType(const swift::AnyMetatypeType* type); + SwiftMangledName visitExistentialMetatypeType(const swift::ExistentialMetatypeType* type); SwiftMangledName visitDependentMemberType(const swift::DependentMemberType* type); SwiftMangledName visitInOutType(const swift::InOutType* type); SwiftMangledName visitExistentialType(const swift::ExistentialType* type); From 36672f44b94ad63b0ef2b1b82f17b14116d4efc9 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 12:57:53 +0200 Subject: [PATCH 158/240] Swift: Take inverses into account when mangling `ProtocolCompositionType`s --- swift/extractor/mangler/SwiftMangler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/swift/extractor/mangler/SwiftMangler.cpp b/swift/extractor/mangler/SwiftMangler.cpp index 5771f2436792..6357a58beca6 100644 --- a/swift/extractor/mangler/SwiftMangler.cpp +++ b/swift/extractor/mangler/SwiftMangler.cpp @@ -371,6 +371,9 @@ SwiftMangledName SwiftMangler::visitProtocolCompositionType( for (auto composed : type->getMembers()) { ret << fetch(composed); } + for (auto inverse : type->getInverses()) { + ret << (uint8_t)inverse << "_"; + } if (type->hasExplicitAnyObject()) { ret << "&AnyObject"; } From 1b21e4c667addabdb63260e249816f41f83bcf6c Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 16:26:23 +0200 Subject: [PATCH 159/240] Swift: Update test results for `IfConfigDecl` no longer being extracted --- .../extractor-tests/declarations/all.expected | 3 -- .../decl/IfConfigDecl/IfConfigDecl.expected | 1 - .../IfConfigDecl_getActiveElement.expected | 3 -- .../test/library-tests/ast/PrintAst.expected | 30 ++++++++----------- .../controlflow/graph/Cfg.expected | 9 ++---- 5 files changed, 15 insertions(+), 31 deletions(-) diff --git a/swift/ql/test/extractor-tests/declarations/all.expected b/swift/ql/test/extractor-tests/declarations/all.expected index f06a19299a2a..98b948953451 100644 --- a/swift/ql/test/extractor-tests/declarations/all.expected +++ b/swift/ql/test/extractor-tests/declarations/all.expected @@ -264,9 +264,6 @@ | declarations.swift:155:1:155:28 | { ... } | | | declarations.swift:155:5:155:5 | d | | | declarations.swift:157:1:180:1 | ifConfig() | | -| declarations.swift:158:3:166:3 | #if ... | | -| declarations.swift:168:3:171:3 | #if ... | | -| declarations.swift:173:3:179:3 | #if ... | | | declarations.swift:182:1:182:10 | B | | | declarations.swift:182:7:182:7 | B.deinit() | | | declarations.swift:182:7:182:7 | B.init() | | diff --git a/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl.expected b/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl.expected index a4cad96aacc1..e69de29bb2d1 100644 --- a/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl.expected +++ b/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl.expected @@ -1 +0,0 @@ -| if_config.swift:1:1:10:1 | #if ... | getModule: | file://:0:0:0:0 | if_config | getNumberOfMembers: | 0 | getNumberOfActiveElements: | 3 | diff --git a/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl_getActiveElement.expected b/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl_getActiveElement.expected index 93c9f638a8be..e69de29bb2d1 100644 --- a/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl_getActiveElement.expected +++ b/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl_getActiveElement.expected @@ -1,3 +0,0 @@ -| if_config.swift:1:1:10:1 | #if ... | 0 | if_config.swift:8:1:8:16 | { ... } | -| if_config.swift:1:1:10:1 | #if ... | 1 | if_config.swift:8:5:8:5 | baz | -| if_config.swift:1:1:10:1 | #if ... | 2 | if_config.swift:9:1:9:12 | { ... } | diff --git a/swift/ql/test/library-tests/ast/PrintAst.expected b/swift/ql/test/library-tests/ast/PrintAst.expected index 879de94c833c..cc72595a4513 100644 --- a/swift/ql/test/library-tests/ast/PrintAst.expected +++ b/swift/ql/test/library-tests/ast/PrintAst.expected @@ -3109,16 +3109,13 @@ cfg.swift: # 467| [NamedFunction] testIfConfig() # 467| InterfaceType = () -> () # 467| getBody(): [BraceStmt] { ... } -# 468| getElement(0): [IfConfigDecl] #if ... -# 472| getElement(1): [IntegerLiteralExpr] 3 -# 473| getElement(2): [IntegerLiteralExpr] 4 -# 476| getElement(3): [IntegerLiteralExpr] 5 -# 478| getElement(4): [IfConfigDecl] #if ... -# 483| getElement(5): [IntegerLiteralExpr] 8 -# 485| getElement(6): [IfConfigDecl] #if ... -# 489| getElement(7): [IntegerLiteralExpr] 11 -# 490| getElement(8): [IntegerLiteralExpr] 12 -# 493| getElement(9): [IntegerLiteralExpr] 13 +# 472| getElement(0): [IntegerLiteralExpr] 3 +# 473| getElement(1): [IntegerLiteralExpr] 4 +# 476| getElement(2): [IntegerLiteralExpr] 5 +# 483| getElement(3): [IntegerLiteralExpr] 8 +# 489| getElement(4): [IntegerLiteralExpr] 11 +# 490| getElement(5): [IntegerLiteralExpr] 12 +# 493| getElement(6): [IntegerLiteralExpr] 13 # 496| [NamedFunction] testAvailable() # 496| InterfaceType = () -> Int # 496| getBody(): [BraceStmt] { ... } @@ -4587,14 +4584,11 @@ declarations.swift: # 157| [NamedFunction] ifConfig() # 157| InterfaceType = () -> () # 157| getBody(): [BraceStmt] { ... } -# 158| getElement(0): [IfConfigDecl] #if ... -# 163| getElement(1): [IntegerLiteralExpr] 4 -# 164| getElement(2): [IntegerLiteralExpr] 5 -# 165| getElement(3): [IntegerLiteralExpr] 6 -# 168| getElement(4): [IfConfigDecl] #if ... -# 173| getElement(5): [IfConfigDecl] #if ... -# 174| getElement(6): [IntegerLiteralExpr] 9 -# 175| getElement(7): [IntegerLiteralExpr] 10 +# 163| getElement(0): [IntegerLiteralExpr] 4 +# 164| getElement(1): [IntegerLiteralExpr] 5 +# 165| getElement(2): [IntegerLiteralExpr] 6 +# 174| getElement(3): [IntegerLiteralExpr] 9 +# 175| getElement(4): [IntegerLiteralExpr] 10 # 182| [ClassDecl] B # 182| getMember(0): [Deinitializer] B.deinit() # 182| InterfaceType = (B) -> () -> () diff --git a/swift/ql/test/library-tests/controlflow/graph/Cfg.expected b/swift/ql/test/library-tests/controlflow/graph/Cfg.expected index 05f14b3082e5..41f64f27d717 100644 --- a/swift/ql/test/library-tests/controlflow/graph/Cfg.expected +++ b/swift/ql/test/library-tests/controlflow/graph/Cfg.expected @@ -1902,14 +1902,11 @@ | cfg.swift:464:39:464:39 | kpGet_mayB_x | cfg.swift:464:39:464:39 | (KeyPath) ... | | | cfg.swift:467:1:494:1 | enter testIfConfig() | cfg.swift:467:1:494:1 | testIfConfig() | | | cfg.swift:467:1:494:1 | exit testIfConfig() (normal) | cfg.swift:467:1:494:1 | exit testIfConfig() | | -| cfg.swift:467:1:494:1 | testIfConfig() | cfg.swift:468:1:474:1 | #if ... | | -| cfg.swift:468:1:474:1 | #if ... | cfg.swift:472:3:472:3 | 3 | | +| cfg.swift:467:1:494:1 | testIfConfig() | cfg.swift:472:3:472:3 | 3 | | | cfg.swift:472:3:472:3 | 3 | cfg.swift:473:3:473:3 | 4 | | | cfg.swift:473:3:473:3 | 4 | cfg.swift:476:3:476:3 | 5 | | -| cfg.swift:476:3:476:3 | 5 | cfg.swift:478:1:481:1 | #if ... | | -| cfg.swift:478:1:481:1 | #if ... | cfg.swift:483:3:483:3 | 8 | | -| cfg.swift:483:3:483:3 | 8 | cfg.swift:485:1:491:1 | #if ... | | -| cfg.swift:485:1:491:1 | #if ... | cfg.swift:489:3:489:3 | 11 | | +| cfg.swift:476:3:476:3 | 5 | cfg.swift:483:3:483:3 | 8 | | +| cfg.swift:483:3:483:3 | 8 | cfg.swift:489:3:489:3 | 11 | | | cfg.swift:489:3:489:3 | 11 | cfg.swift:490:3:490:3 | 12 | | | cfg.swift:490:3:490:3 | 12 | cfg.swift:493:3:493:3 | 13 | | | cfg.swift:493:3:493:3 | 13 | cfg.swift:467:1:494:1 | exit testIfConfig() (normal) | | From b6076c04811634994f60cfdd96555be374808b0c Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 17:01:20 +0200 Subject: [PATCH 160/240] Swift: Update test results for `ParenType` no longer being extracted --- .../decl/CapturedDecl/PrintAst.expected | 6 +-- .../IdentityExpr_getType.expected | 8 ++-- .../ProtocolCompositionType.expected | 1 - ...ProtocolCompositionType_getMember.expected | 2 - .../extractor-tests/patterns/types.expected | 48 +++++++++---------- .../test/library-tests/ast/PrintAst.expected | 18 +++---- 6 files changed, 40 insertions(+), 43 deletions(-) diff --git a/swift/ql/test/extractor-tests/generated/decl/CapturedDecl/PrintAst.expected b/swift/ql/test/extractor-tests/generated/decl/CapturedDecl/PrintAst.expected index c3ae0bba4c0d..3b815eb18420 100644 --- a/swift/ql/test/extractor-tests/generated/decl/CapturedDecl/PrintAst.expected +++ b/swift/ql/test/extractor-tests/generated/decl/CapturedDecl/PrintAst.expected @@ -101,7 +101,7 @@ closures.swift: # 24| getSubExpr(): [CallExpr] call to ... # 24| getFunction(): [BindOptionalExpr] ...? # 24| getSubExpr(): [DeclRefExpr] escape -# 24| getFunction().getFullyConverted(): [LoadExpr] ((() -> ())) ... +# 24| getFunction().getFullyConverted(): [LoadExpr] (() -> ()) ... # 24| getSubExpr().getFullyConverted(): [InjectIntoOptionalExpr] (()?) ... # 24| getCapture(0): [CapturedDecl] escape # 27| [NamedFunction] logical() @@ -145,8 +145,8 @@ closures.swift: # 30| getArgument(0): [Argument] : ... .!=(_:_:) ... # 30| getExpr(): [BinaryExpr] ... .!=(_:_:) ... # 30| getFunction(): [MethodLookupExpr] .!=(_:_:) -# 30| getBase(): [TypeExpr] Optional<((Int) -> Int)>.Type -# 30| getTypeRepr(): [TypeRepr] Optional<((Int) -> Int)> +# 30| getBase(): [TypeExpr] Optional<(Int) -> Int>.Type +# 30| getTypeRepr(): [TypeRepr] Optional<(Int) -> Int> # 30| getMethodRef(): [DeclRefExpr] !=(_:_:) # 30| getArgument(0): [Argument] : f # 30| getExpr(): [DeclRefExpr] f diff --git a/swift/ql/test/extractor-tests/generated/expr/IdentityExpr/IdentityExpr_getType.expected b/swift/ql/test/extractor-tests/generated/expr/IdentityExpr/IdentityExpr_getType.expected index d4c7bd3ee979..7922f8fdeedb 100644 --- a/swift/ql/test/extractor-tests/generated/expr/IdentityExpr/IdentityExpr_getType.expected +++ b/swift/ql/test/extractor-tests/generated/expr/IdentityExpr/IdentityExpr_getType.expected @@ -1,9 +1,9 @@ | identity_expressions.swift:5:9:5:14 | .self | A | | identity_expressions.swift:5:9:5:21 | .self | @lvalue Int | -| identity_expressions.swift:5:28:5:31 | (...) | (Int) | -| identity_expressions.swift:9:5:9:9 | (...) | (A) | -| identity_expressions.swift:12:28:12:43 | (...) | (A) | +| identity_expressions.swift:5:28:5:31 | (...) | Int | +| identity_expressions.swift:9:5:9:9 | (...) | A | +| identity_expressions.swift:12:28:12:43 | (...) | A | | identity_expressions.swift:12:29:12:42 | await ... | A | | identity_expressions.swift:15:5:15:21 | await ... | () | -| identity_expressions.swift:15:11:15:19 | (...) | (() async -> ()) | +| identity_expressions.swift:15:11:15:19 | (...) | () async -> () | | identity_expressions.swift:18:9:18:17 | BorrowExpr | Int | diff --git a/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType.expected b/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType.expected index 5cda96eb6fe3..f8278a6bae96 100644 --- a/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType.expected +++ b/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType.expected @@ -1,4 +1,3 @@ -| P1 & (P2 & P3) | getName: | P1 & (P2 & P3) | getCanonicalType: | P1 & P2 & P3 | getNumberOfMembers: | 2 | | P1 & P2 & P3 | getName: | P1 & P2 & P3 | getCanonicalType: | P1 & P2 & P3 | getNumberOfMembers: | 3 | | P1 & P23 | getName: | P1 & P23 | getCanonicalType: | P1 & P2 & P3 | getNumberOfMembers: | 2 | | P2 & P4 | getName: | P2 & P4 | getCanonicalType: | P2 & P4 | getNumberOfMembers: | 2 | diff --git a/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType_getMember.expected b/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType_getMember.expected index 4792394a7573..40aa86c2da19 100644 --- a/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType_getMember.expected +++ b/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType_getMember.expected @@ -1,5 +1,3 @@ -| P1 & (P2 & P3) | 0 | P1 | -| P1 & (P2 & P3) | 1 | (P2 & P3) | | P1 & P2 & P3 | 0 | P1 | | P1 & P2 & P3 | 1 | P2 | | P1 & P2 & P3 | 2 | P3 | diff --git a/swift/ql/test/extractor-tests/patterns/types.expected b/swift/ql/test/extractor-tests/patterns/types.expected index 0fececfa9226..2d7dfd00dacf 100644 --- a/swift/ql/test/extractor-tests/patterns/types.expected +++ b/swift/ql/test/extractor-tests/patterns/types.expected @@ -63,9 +63,9 @@ | patterns.swift:78:9:78:13 | ... as ... | MyEnum | | patterns.swift:81:10:81:11 | .myNone | MyEnum | | patterns.swift:83:10:83:25 | .mySingle(...) | MyEnum | -| patterns.swift:83:19:83:25 | (...) | (Int) | -| patterns.swift:83:20:83:24 | let ... | (Int) | -| patterns.swift:83:24:83:24 | a | (Int) | +| patterns.swift:83:19:83:25 | (...) | Int | +| patterns.swift:83:20:83:24 | let ... | Int | +| patterns.swift:83:24:83:24 | a | Int | | patterns.swift:85:10:85:30 | .myPair(...) | MyEnum | | patterns.swift:85:17:85:30 | (...) | (Int, Int) | | patterns.swift:85:18:85:22 | let ... | Int | @@ -78,9 +78,9 @@ | patterns.swift:88:22:88:22 | a | Int | | patterns.swift:88:25:88:25 | _ | MyEnum | | patterns.swift:92:13:92:28 | .mySingle(...) | MyEnum | -| patterns.swift:92:22:92:28 | (...) | (Int) | -| patterns.swift:92:23:92:27 | let ... | (Int) | -| patterns.swift:92:27:92:27 | x | (Int) | +| patterns.swift:92:22:92:28 | (...) | Int | +| patterns.swift:92:23:92:27 | let ... | Int | +| patterns.swift:92:27:92:27 | x | Int | | patterns.swift:95:13:95:33 | .myPair(...) | MyEnum | | patterns.swift:95:20:95:33 | (...) | (Int, Int) | | patterns.swift:95:21:95:25 | let ... | Int | @@ -89,9 +89,9 @@ | patterns.swift:95:32:95:32 | y | Int | | patterns.swift:103:10:103:11 | .myNone | MyEnum | | patterns.swift:105:10:105:25 | .mySingle(...) | MyEnum | -| patterns.swift:105:19:105:25 | (...) | (Int) | -| patterns.swift:105:20:105:24 | let ... | (Int) | -| patterns.swift:105:24:105:24 | a | (Int) | +| patterns.swift:105:19:105:25 | (...) | Int | +| patterns.swift:105:20:105:24 | let ... | Int | +| patterns.swift:105:24:105:24 | a | Int | | patterns.swift:107:10:107:30 | .myPair(...) | MyEnum | | patterns.swift:107:17:107:30 | (...) | (Int, Int) | | patterns.swift:107:18:107:22 | let ... | Int | @@ -104,9 +104,9 @@ | patterns.swift:110:22:110:22 | a | Int | | patterns.swift:110:25:110:25 | _ | MyEnum | | patterns.swift:114:13:114:28 | .mySingle(...) | MyEnum | -| patterns.swift:114:22:114:28 | (...) | (Int) | -| patterns.swift:114:23:114:27 | let ... | (Int) | -| patterns.swift:114:27:114:27 | x | (Int) | +| patterns.swift:114:22:114:28 | (...) | Int | +| patterns.swift:114:23:114:27 | let ... | Int | +| patterns.swift:114:27:114:27 | x | Int | | patterns.swift:117:13:117:33 | .myPair(...) | MyEnum | | patterns.swift:117:20:117:33 | (...) | (Int, Int) | | patterns.swift:117:21:117:25 | let ... | Int | @@ -115,9 +115,9 @@ | patterns.swift:117:32:117:32 | y | Int | | patterns.swift:125:10:125:11 | .myNone | MyEnum | | patterns.swift:127:10:127:25 | .mySingle(...) | MyEnum | -| patterns.swift:127:19:127:25 | (...) | (Int) | -| patterns.swift:127:20:127:24 | let ... | (Int) | -| patterns.swift:127:24:127:24 | a | (Int) | +| patterns.swift:127:19:127:25 | (...) | Int | +| patterns.swift:127:20:127:24 | let ... | Int | +| patterns.swift:127:24:127:24 | a | Int | | patterns.swift:129:10:129:30 | .myPair(...) | MyEnum | | patterns.swift:129:17:129:30 | (...) | (Int, Int) | | patterns.swift:129:18:129:22 | let ... | Int | @@ -130,9 +130,9 @@ | patterns.swift:132:22:132:22 | a | Int | | patterns.swift:132:25:132:25 | _ | MyEnum | | patterns.swift:136:13:136:28 | .mySingle(...) | MyEnum | -| patterns.swift:136:22:136:28 | (...) | (Int) | -| patterns.swift:136:23:136:27 | let ... | (Int) | -| patterns.swift:136:27:136:27 | x | (Int) | +| patterns.swift:136:22:136:28 | (...) | Int | +| patterns.swift:136:23:136:27 | let ... | Int | +| patterns.swift:136:27:136:27 | x | Int | | patterns.swift:139:13:139:33 | .myPair(...) | MyEnum | | patterns.swift:139:20:139:33 | (...) | (Int, Int) | | patterns.swift:139:21:139:25 | let ... | Int | @@ -143,9 +143,9 @@ | patterns.swift:144:9:144:12 | ... as ... | MyEnum | | patterns.swift:147:10:147:11 | .myNone | MyEnum | | patterns.swift:149:10:149:25 | .mySingle(...) | MyEnum | -| patterns.swift:149:19:149:25 | (...) | (Int) | -| patterns.swift:149:20:149:24 | let ... | (Int) | -| patterns.swift:149:24:149:24 | a | (Int) | +| patterns.swift:149:19:149:25 | (...) | Int | +| patterns.swift:149:20:149:24 | let ... | Int | +| patterns.swift:149:24:149:24 | a | Int | | patterns.swift:151:10:151:30 | .myPair(...) | MyEnum | | patterns.swift:151:17:151:30 | (...) | (Int, Int) | | patterns.swift:151:18:151:22 | let ... | Int | @@ -166,9 +166,9 @@ | patterns.swift:158:22:158:22 | a | Int | | patterns.swift:158:25:158:25 | _ | MyEnum | | patterns.swift:162:13:162:28 | .mySingle(...) | MyEnum | -| patterns.swift:162:22:162:28 | (...) | (Int) | -| patterns.swift:162:23:162:27 | let ... | (Int) | -| patterns.swift:162:27:162:27 | x | (Int) | +| patterns.swift:162:22:162:28 | (...) | Int | +| patterns.swift:162:23:162:27 | let ... | Int | +| patterns.swift:162:27:162:27 | x | Int | | patterns.swift:165:13:165:39 | .myPair(...) | MyEnum | | patterns.swift:165:26:165:39 | (...) | (Int, Int) | | patterns.swift:165:27:165:31 | let ... | Int | diff --git a/swift/ql/test/library-tests/ast/PrintAst.expected b/swift/ql/test/library-tests/ast/PrintAst.expected index cc72595a4513..f3f0aa1cfd2a 100644 --- a/swift/ql/test/library-tests/ast/PrintAst.expected +++ b/swift/ql/test/library-tests/ast/PrintAst.expected @@ -853,7 +853,7 @@ cfg.swift: # 144| [ConcreteVarDecl] $match # 144| Type = Int # 156| [ConcreteVarDecl] x -# 156| Type = (Int) +# 156| Type = Int # 163| [NamedFunction] testDefer(x:) # 163| InterfaceType = (inout Int) -> () # 163| getParam(0): [ParamDecl] x @@ -6399,7 +6399,7 @@ patterns.swift: # 83| getSubPattern().getFullyUnresolved(): [ParenPattern] (...) # 83| getSubPattern(): [BindingPattern] let ... # 83| getVariable(0): [ConcreteVarDecl] a -# 83| Type = (Int) +# 83| Type = Int # 84| getBody(): [BraceStmt] { ... } # 84| getElement(0): [CallExpr] call to sink(arg:) # 84| getFunction(): [DeclRefExpr] sink(arg:) @@ -6499,7 +6499,7 @@ patterns.swift: # 105| getSubPattern().getFullyUnresolved(): [ParenPattern] (...) # 105| getSubPattern(): [BindingPattern] let ... # 105| getVariable(0): [ConcreteVarDecl] a -# 105| Type = (Int) +# 105| Type = Int # 106| getBody(): [BraceStmt] { ... } # 106| getElement(0): [CallExpr] call to sink(arg:) # 106| getFunction(): [DeclRefExpr] sink(arg:) @@ -6601,7 +6601,7 @@ patterns.swift: # 127| getSubPattern().getFullyUnresolved(): [ParenPattern] (...) # 127| getSubPattern(): [BindingPattern] let ... # 127| getVariable(0): [ConcreteVarDecl] a -# 127| Type = (Int) +# 127| Type = Int # 128| getBody(): [BraceStmt] { ... } # 128| getElement(0): [CallExpr] call to sink(arg:) # 128| getFunction(): [DeclRefExpr] sink(arg:) @@ -6704,7 +6704,7 @@ patterns.swift: # 149| getSubPattern().getFullyUnresolved(): [ParenPattern] (...) # 149| getSubPattern(): [BindingPattern] let ... # 149| getVariable(0): [ConcreteVarDecl] a -# 149| Type = (Int) +# 149| Type = Int # 150| getBody(): [BraceStmt] { ... } # 150| getElement(0): [CallExpr] call to sink(arg:) # 150| getFunction(): [DeclRefExpr] sink(arg:) @@ -6898,25 +6898,25 @@ patterns.swift: # 181| getBody(): [BraceStmt] { ... } # 181| getElement(0): [TupleExpr] (...) # 92| [ConcreteVarDecl] x -# 92| Type = (Int) +# 92| Type = Int # 95| [ConcreteVarDecl] x # 95| Type = Int # 95| [ConcreteVarDecl] y # 95| Type = Int # 114| [ConcreteVarDecl] x -# 114| Type = (Int) +# 114| Type = Int # 117| [ConcreteVarDecl] x # 117| Type = Int # 117| [ConcreteVarDecl] y # 117| Type = Int # 136| [ConcreteVarDecl] x -# 136| Type = (Int) +# 136| Type = Int # 139| [ConcreteVarDecl] x # 139| Type = Int # 139| [ConcreteVarDecl] y # 139| Type = Int # 162| [ConcreteVarDecl] x -# 162| Type = (Int) +# 162| Type = Int # 165| [ConcreteVarDecl] x # 165| Type = Int # 165| [ConcreteVarDecl] y From e135f5ddf61a8a6fe9e239d5e050badc79145ed5 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 17:39:09 +0200 Subject: [PATCH 161/240] Swift: Update `ObjectLiteralExpr` test The entities now have proper error types instead of missing types. --- .../expr/ObjectLiteralExpr/ObjectLiteralExpr.expected | 6 +++--- .../ObjectLiteralExpr/ObjectLiteralExpr_getType.expected | 3 +++ .../generated/expr/ObjectLiteralExpr/object_literals.swift | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr.expected b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr.expected index d303c7a2f769..46cfc6b8a790 100644 --- a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr.expected +++ b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr.expected @@ -1,3 +1,3 @@ -| object_literals.swift:5:5:5:42 | #fileLiteral(...) | hasType: | no | getKind: | 0 | getNumberOfArguments: | 1 | -| object_literals.swift:6:5:6:61 | #colorLiteral(...) | hasType: | no | getKind: | 2 | getNumberOfArguments: | 4 | -| object_literals.swift:7:5:7:44 | #imageLiteral(...) | hasType: | no | getKind: | 1 | getNumberOfArguments: | 1 | +| object_literals.swift:5:5:5:42 | #fileLiteral(...) | hasType: | yes | getKind: | 0 | getNumberOfArguments: | 1 | +| object_literals.swift:6:5:6:61 | #colorLiteral(...) | hasType: | yes | getKind: | 2 | getNumberOfArguments: | 4 | +| object_literals.swift:7:5:7:44 | #imageLiteral(...) | hasType: | yes | getKind: | 1 | getNumberOfArguments: | 1 | diff --git a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr_getType.expected b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr_getType.expected index e69de29bb2d1..49fcd7db593a 100644 --- a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr_getType.expected +++ b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr_getType.expected @@ -0,0 +1,3 @@ +| object_literals.swift:5:5:5:42 | #fileLiteral(...) | <> | +| object_literals.swift:6:5:6:61 | #colorLiteral(...) | <> | +| object_literals.swift:7:5:7:44 | #imageLiteral(...) | <> | diff --git a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/object_literals.swift b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/object_literals.swift index cb5373234481..5cb9163bfe3f 100644 --- a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/object_literals.swift +++ b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/object_literals.swift @@ -1,7 +1,7 @@ //codeql-extractor-expected-status: 1 // These require Foundation and UIKit/AppKit to really work -// That is why compilation will fail and the entities will not have a type +// That is why compilation will fail and the entities will have error types _ = #fileLiteral(resourceName: "file.txt") _ = #colorLiteral(red: 255, green: 255, blue: 255, alpha: 50) _ = #imageLiteral(resourceName: "image.gif") From 9a21b0dc5ca6e8c93b382e32b82217d9652c5cb6 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 17:42:18 +0200 Subject: [PATCH 162/240] Swift: Update `SuccessfullyExtractedLines` for external code being extracted --- .../query-tests/Diagnostics/SuccessfullyExtractedLines.expected | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/ql/test/query-tests/Diagnostics/SuccessfullyExtractedLines.expected b/swift/ql/test/query-tests/Diagnostics/SuccessfullyExtractedLines.expected index b5a514b9ffa6..3516ff5eb5dd 100644 --- a/swift/ql/test/query-tests/Diagnostics/SuccessfullyExtractedLines.expected +++ b/swift/ql/test/query-tests/Diagnostics/SuccessfullyExtractedLines.expected @@ -1 +1 @@ -| 4 | +| 287 | From 10d86c9708b0599776d782b6b10209283e642c17 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 17:56:57 +0200 Subject: [PATCH 163/240] Swift: Disable parts of tests that crash with Swift 6.1 --- .../generated/decl/ParamDecl/ParamDecl.expected | 4 ---- ...mDecl_getAttachedPropertyWrapperType.expected | 2 -- ...ramDecl_getPropertyWrapperBackingVar.expected | 2 -- ...cl_getPropertyWrapperLocalWrappedVar.expected | 2 -- ...Decl_getPropertyWrapperProjectionVar.expected | 2 -- ...tPropertyWrapperProjectionVarBinding.expected | 2 -- .../generated/decl/ParamDecl/param_decls.swift | 4 ++-- .../AppliedPropertyWrapperExpr.expected | 3 --- .../AppliedPropertyWrapperExpr_getType.expected | 3 --- .../applied_property_wrapper.swift | 16 +++++++++++----- 10 files changed, 13 insertions(+), 27 deletions(-) diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl.expected index a83bdc80b267..ffb1fa020723 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl.expected @@ -57,7 +57,3 @@ | param_decls.swift:41:10:41:26 | projectedValue | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Bool | getNumberOfAccessors: | 0 | getName: | projectedValue | getType: | Bool | hasAttachedPropertyWrapperType: | no | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | no | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | no | | param_decls.swift:48:18:48:22 | p1 | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Int | getNumberOfAccessors: | 0 | getName: | p1 | getType: | Int | hasAttachedPropertyWrapperType: | yes | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | yes | hasPropertyWrapperBackingVar: | yes | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | yes | | param_decls.swift:49:26:49:30 | p2 | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Int | getNumberOfAccessors: | 0 | getName: | p2 | getType: | Int | hasAttachedPropertyWrapperType: | yes | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | yes | hasPropertyWrapperBackingVar: | yes | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | yes | -| param_decls.swift:50:31:50:31 | value | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Bool | getNumberOfAccessors: | 0 | getName: | value | getType: | Bool | hasAttachedPropertyWrapperType: | no | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | no | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | no | -| param_decls.swift:50:31:50:35 | p3 | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Int | getNumberOfAccessors: | 0 | getName: | p3 | getType: | Int | hasAttachedPropertyWrapperType: | yes | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | yes | hasPropertyWrapperProjectionVarBinding: | yes | hasPropertyWrapperProjectionVar: | yes | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | yes | -| param_decls.swift:51:38:51:38 | value | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Bool | getNumberOfAccessors: | 0 | getName: | value | getType: | Bool | hasAttachedPropertyWrapperType: | no | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | no | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | no | -| param_decls.swift:51:38:51:42 | p4 | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Int | getNumberOfAccessors: | 0 | getName: | p4 | getType: | Int | hasAttachedPropertyWrapperType: | yes | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | yes | hasPropertyWrapperProjectionVarBinding: | yes | hasPropertyWrapperProjectionVar: | yes | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | yes | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getAttachedPropertyWrapperType.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getAttachedPropertyWrapperType.expected index 0e5bd101964b..b8a99db3f8fd 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getAttachedPropertyWrapperType.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getAttachedPropertyWrapperType.expected @@ -1,4 +1,2 @@ | param_decls.swift:48:18:48:22 | p1 | Wrapper | | param_decls.swift:49:26:49:30 | p2 | WrapperWithInit | -| param_decls.swift:50:31:50:35 | p3 | WrapperWithProjected | -| param_decls.swift:51:38:51:42 | p4 | WrapperWithProjectedAndInit | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperBackingVar.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperBackingVar.expected index 6595e3ae3ba9..5a58e14fe486 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperBackingVar.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperBackingVar.expected @@ -1,4 +1,2 @@ | param_decls.swift:48:18:48:22 | p1 | param_decls.swift:48:18:48:18 | _p1 | | param_decls.swift:49:26:49:30 | p2 | param_decls.swift:49:26:49:26 | _p2 | -| param_decls.swift:50:31:50:35 | p3 | file://:0:0:0:0 | _p3 | -| param_decls.swift:51:38:51:42 | p4 | file://:0:0:0:0 | _p4 | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperLocalWrappedVar.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperLocalWrappedVar.expected index b58494d1f8dd..e1b555437d39 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperLocalWrappedVar.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperLocalWrappedVar.expected @@ -1,4 +1,2 @@ | param_decls.swift:48:18:48:22 | p1 | param_decls.swift:48:18:48:18 | p1 | | param_decls.swift:49:26:49:30 | p2 | param_decls.swift:49:26:49:26 | p2 | -| param_decls.swift:50:31:50:35 | p3 | param_decls.swift:50:31:50:31 | p3 | -| param_decls.swift:51:38:51:42 | p4 | param_decls.swift:51:38:51:38 | p4 | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVar.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVar.expected index 99679a1c64b0..e69de29bb2d1 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVar.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVar.expected @@ -1,2 +0,0 @@ -| param_decls.swift:50:31:50:35 | p3 | param_decls.swift:50:31:50:31 | $p3 | -| param_decls.swift:51:38:51:42 | p4 | param_decls.swift:51:38:51:38 | $p4 | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVarBinding.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVarBinding.expected index 0ebae7b813a3..e69de29bb2d1 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVarBinding.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVarBinding.expected @@ -1,2 +0,0 @@ -| param_decls.swift:50:31:50:35 | p3 | file://:0:0:0:0 | var ... = ... | -| param_decls.swift:51:38:51:42 | p4 | file://:0:0:0:0 | var ... = ... | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/param_decls.swift b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/param_decls.swift index aa001dfeca71..42d2b4980fa3 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/param_decls.swift +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/param_decls.swift @@ -47,6 +47,6 @@ func closures() { func f2( @Wrapper p1: Int, @WrapperWithInit p2: Int, - @WrapperWithProjected p3: Int, - @WrapperWithProjectedAndInit p4: Int + // @WrapperWithProjected p3: Int, // Disabled causes crashes with Swift 6.1 + // @WrapperWithProjectedAndInit p4: Int // Disabled causes crashes with Swift 6.1 ) {} diff --git a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr.expected b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr.expected index d8f0d8f98c31..e69de29bb2d1 100644 --- a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr.expected +++ b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr.expected @@ -1,3 +0,0 @@ -| applied_property_wrapper.swift:14:8:14:8 | AppliedPropertyWrapperExpr | hasType: | yes | getKind: | 1 | getValue: | applied_property_wrapper.swift:14:8:14:8 | 42 | getParam: | applied_property_wrapper.swift:12:19:12:22 | x | -| applied_property_wrapper.swift:15:9:15:9 | AppliedPropertyWrapperExpr | hasType: | yes | getKind: | 2 | getValue: | applied_property_wrapper.swift:15:9:15:9 | true | getParam: | applied_property_wrapper.swift:12:19:12:22 | x | -| file://:0:0:0:0 | AppliedPropertyWrapperExpr | hasType: | yes | getKind: | 1 | getValue: | file://:0:0:0:0 | y | getParam: | applied_property_wrapper.swift:17:26:17:29 | y | diff --git a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr_getType.expected b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr_getType.expected index 9ccffc695056..e69de29bb2d1 100644 --- a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr_getType.expected +++ b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr_getType.expected @@ -1,3 +0,0 @@ -| applied_property_wrapper.swift:14:8:14:8 | AppliedPropertyWrapperExpr | Wrapper | -| applied_property_wrapper.swift:15:9:15:9 | AppliedPropertyWrapperExpr | Wrapper | -| file://:0:0:0:0 | AppliedPropertyWrapperExpr | Wrapper | diff --git a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/applied_property_wrapper.swift b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/applied_property_wrapper.swift index 4fe83a65c5b5..a90ac69e1d45 100644 --- a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/applied_property_wrapper.swift +++ b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/applied_property_wrapper.swift @@ -9,11 +9,17 @@ init(projectedValue: Bool) {} } -func foo(@Wrapper x: Int) {} +func foo( + // @Wrapper x: Int // Disabled causes crashes with Swift 6.1 +) {} -foo(x: 42) -foo($x: true) +// foo(x: 42) +// foo($x: true) -let closure = {(@Wrapper y: Int) in return } +let closure = { + ( + // @Wrapper y: Int // Disabled causes crashes with Swift 6.1 + ) in return + } -closure(41) +// closure(41) From 59faf9fbdf66e2256a1f92abf5e641e671d6f4af Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 18:07:02 +0200 Subject: [PATCH 164/240] Swift: Update `errors` test The representation of the errors seems to have changed somewhat in Swift 6.1. --- .../extractor-tests/errors/CONSISTENCY/CfgConsistency.expected | 2 -- swift/ql/test/extractor-tests/errors/Errors.expected | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/swift/ql/test/extractor-tests/errors/CONSISTENCY/CfgConsistency.expected b/swift/ql/test/extractor-tests/errors/CONSISTENCY/CfgConsistency.expected index 770537cf684b..16bf95f6bb95 100644 --- a/swift/ql/test/extractor-tests/errors/CONSISTENCY/CfgConsistency.expected +++ b/swift/ql/test/extractor-tests/errors/CONSISTENCY/CfgConsistency.expected @@ -1,5 +1,3 @@ deadEnd -| file://:0:0:0:0 | ... = ... | -| file://:0:0:0:0 | ... = ... | | unspecified.swift:12:20:12:21 | (...) | | unspecified.swift:25:9:28:9 | switch ErrorExpr { ... } | diff --git a/swift/ql/test/extractor-tests/errors/Errors.expected b/swift/ql/test/extractor-tests/errors/Errors.expected index 4ecfbef31da5..50ab8ec658be 100644 --- a/swift/ql/test/extractor-tests/errors/Errors.expected +++ b/swift/ql/test/extractor-tests/errors/Errors.expected @@ -1,4 +1,5 @@ -| file://:0:0:0:0 | ... .combine(_:) | UnresolvedDotExpr | +| file://:0:0:0:0 | <> | ErrorType | +| file://:0:0:0:0 | <> | ErrorType | | file://:0:0:0:0 | <> | ErrorType | | overloaded.swift:6:5:6:5 | OverloadedDeclRefExpr | OverloadedDeclRefExpr | | unresolved.swift:5:1:5:14 | UnresolvedSpecializeExpr | UnresolvedSpecializeExpr | From a74b38c0ec82cbc2627d792fcc032b4bbd0e955d Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 23 Apr 2025 09:48:00 +0200 Subject: [PATCH 165/240] Swift: Replace deprecated `@_moveOnly` in test by `~Copyable` --- .../extractor-tests/generated/stmt/DiscardStmt/test.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swift/ql/test/extractor-tests/generated/stmt/DiscardStmt/test.swift b/swift/ql/test/extractor-tests/generated/stmt/DiscardStmt/test.swift index 517cacc442ed..c4602ebb7241 100644 --- a/swift/ql/test/extractor-tests/generated/stmt/DiscardStmt/test.swift +++ b/swift/ql/test/extractor-tests/generated/stmt/DiscardStmt/test.swift @@ -1,5 +1,5 @@ -@_moveOnly -struct S { + +struct S : ~Copyable { __consuming func f() { discard self } From eea963e3f4fa3a3df04384a3ff3b83b39a77f29d Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 23 Apr 2025 10:01:22 +0200 Subject: [PATCH 166/240] Swift: Add upgrade and downgrade scripts --- .../macro_role_conformances.ql | 21 + .../old.dbscheme | 2810 ++++++++++++++++ .../swift.dbscheme | 2815 +++++++++++++++++ .../upgrade.properties | 3 + .../old.dbscheme | 2815 +++++++++++++++++ .../swift.dbscheme | 2810 ++++++++++++++++ .../upgrade.properties | 2 + 7 files changed, 11276 insertions(+) create mode 100644 swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/macro_role_conformances.ql create mode 100644 swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/old.dbscheme create mode 100644 swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/swift.dbscheme create mode 100644 swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/upgrade.properties create mode 100644 swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme create mode 100644 swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme create mode 100644 swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties diff --git a/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/macro_role_conformances.ql b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/macro_role_conformances.ql new file mode 100644 index 000000000000..898847141ab7 --- /dev/null +++ b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/macro_role_conformances.ql @@ -0,0 +1,21 @@ +class MacroRole extends @macro_role { + string toString() { none() } +} + +class ExprOrNone extends @expr_or_none { + string toString() { none() } +} + +class TypeExpr extends @type_expr { + string toString() { none() } +} + +class UnspecifiedElement extends @unspecified_element { + string toString() { none() } +} + +from MacroRole role, int index, ExprOrNone conformance +where + macro_role_conformances(role, index, conformance) and + (conformance instanceof TypeExpr or conformance instanceof UnspecifiedElement) +select role, index, conformance diff --git a/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/old.dbscheme b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/old.dbscheme new file mode 100644 index 000000000000..4dd3d5ca8a89 --- /dev/null +++ b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/old.dbscheme @@ -0,0 +1,2810 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/swift.dbscheme b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/swift.dbscheme new file mode 100644 index 000000000000..be2357fd0023 --- /dev/null +++ b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/swift.dbscheme @@ -0,0 +1,2815 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/upgrade.properties b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/upgrade.properties new file mode 100644 index 000000000000..823e68c73a1c --- /dev/null +++ b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/upgrade.properties @@ -0,0 +1,3 @@ +description: Upgrade to Swift 6.1 +compatibility: partial +macro_role_conformances.rel: run macro_role_conformances.qlo diff --git a/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme new file mode 100644 index 000000000000..be2357fd0023 --- /dev/null +++ b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme @@ -0,0 +1,2815 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme new file mode 100644 index 000000000000..4dd3d5ca8a89 --- /dev/null +++ b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme @@ -0,0 +1,2810 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties new file mode 100644 index 000000000000..f08bdf097047 --- /dev/null +++ b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties @@ -0,0 +1,2 @@ +description: Upgrade to Swift 6.1 +compatibility: full From 8086ef48c7800f99ddee1bdd3455e027f9eeeefe Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 23 Apr 2025 11:51:01 +0200 Subject: [PATCH 167/240] Swift: Add change note --- swift/ql/lib/change-notes/2025-04-23-swift-6.1.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 swift/ql/lib/change-notes/2025-04-23-swift-6.1.md diff --git a/swift/ql/lib/change-notes/2025-04-23-swift-6.1.md b/swift/ql/lib/change-notes/2025-04-23-swift-6.1.md new file mode 100644 index 000000000000..272c8ce6ca35 --- /dev/null +++ b/swift/ql/lib/change-notes/2025-04-23-swift-6.1.md @@ -0,0 +1,4 @@ +--- +category: majorAnalysis +--- +* Upgraded to allow analysis of Swift 6.1. From cad695868d9d83a9c0f5cb22688da8a36e6b89b3 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 23 Apr 2025 16:54:41 +0200 Subject: [PATCH 168/240] C++: Add change note --- cpp/ql/lib/change-notes/2025-04-23-typeof.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cpp/ql/lib/change-notes/2025-04-23-typeof.md diff --git a/cpp/ql/lib/change-notes/2025-04-23-typeof.md b/cpp/ql/lib/change-notes/2025-04-23-typeof.md new file mode 100644 index 000000000000..eb41e3b52bdf --- /dev/null +++ b/cpp/ql/lib/change-notes/2025-04-23-typeof.md @@ -0,0 +1,5 @@ +--- +category: feature +--- +* New classes `TypeofType`, `TypeofExprType`, and `TypeofTypeType` were introduced, which represent the C23 `typeof` and `typeof_unqual` operators. The `TypeofExprType` class represents the variant taking an expression as its argument. The `TypeofTypeType` class represents the variant taking a type as its argument. +* A new class `IntrinsicTransformedType` was introduced, which represents the type transforming intrinsics supported by clang, gcc, and MSVC. From e72aba76f641458177aa0191497f14b1089b9abc Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 23 Apr 2025 19:28:51 +0200 Subject: [PATCH 169/240] Rust: Path resolution performance tweaks --- .../codeql/rust/internal/PathResolution.qll | 73 ++++++++++++------- 1 file changed, 48 insertions(+), 25 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 6305b3369950..4c8f26143d6c 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -856,41 +856,54 @@ class RelevantPath extends Path { } } +private predicate isModule(ItemNode m) { m instanceof Module } + +/** Holds if root module `root` contains the module `m`. */ +private predicate rootHasModule(ItemNode root, ItemNode m) = + doublyBoundedFastTC(hasChild/2, isRoot/1, isModule/1)(root, m) + +pragma[nomagic] +private ItemNode getOuterScope(ItemNode i) { + // nested modules do not have unqualified access to items from outer modules, + // except for items declared at top-level in the root module + rootHasModule(result, i) + or + not i instanceof Module and + result = i.getImmediateParent() +} + +pragma[nomagic] +private ItemNode getAdjustedEnclosing(ItemNode encl0, Namespace ns) { + // functions in `impl` blocks need to use explicit `Self::` to access other + // functions in the `impl` block + if encl0 instanceof ImplOrTraitItemNode and ns.isValue() + then result = encl0.getImmediateParent() + else result = encl0 +} + /** * Holds if the unqualified path `p` references an item named `name`, and `name` * may be looked up in the `ns` namespace inside enclosing item `encl`. */ pragma[nomagic] -private predicate unqualifiedPathLookup(RelevantPath p, string name, Namespace ns, ItemNode encl) { - exists(ItemNode encl0 | +private predicate unqualifiedPathLookup(ItemNode encl, string name, Namespace ns, RelevantPath p) { + exists(ItemNode encl0 | encl = getAdjustedEnclosing(encl0, ns) | // lookup in the immediately enclosing item p.isUnqualified(name) and encl0.getADescendant() = p and exists(ns) and - not name = ["crate", "$crate"] + not name = ["crate", "$crate", "super", "self"] or // lookup in an outer scope, but only if the item is not declared in inner scope exists(ItemNode mid | - unqualifiedPathLookup(p, name, ns, mid) and + unqualifiedPathLookup(mid, name, ns, p) and not declares(mid, ns, name) and - not name = ["super", "self"] and not ( name = "Self" and mid = any(ImplOrTraitItemNode i).getAnItemInSelfScope() - ) - | - // nested modules do not have unqualified access to items from outer modules, - // except for items declared at top-level in the root module - if mid instanceof Module - then encl0 = mid.getImmediateParent+() and encl0.(ModuleLikeNode).isRoot() - else encl0 = mid.getImmediateParent() + ) and + encl0 = getOuterScope(mid) ) - | - // functions in `impl` blocks need to use explicit `Self::` to access other - // functions in the `impl` block - if encl0 instanceof ImplOrTraitItemNode and ns.isValue() - then encl = encl0.getImmediateParent() - else encl = encl0 ) } @@ -909,10 +922,12 @@ private predicate hasChild(ItemNode parent, ItemNode child) { child.getImmediate private predicate rootHasCratePathTc(ItemNode i1, ItemNode i2) = doublyBoundedFastTC(hasChild/2, isRoot/1, hasCratePath/1)(i1, i2) +/** + * Holds if the unqualified path `p` references a keyword item named `name`, and + * `name` may be looked up in the `ns` namespace inside enclosing item `encl`. + */ pragma[nomagic] -private predicate unqualifiedPathLookup1(RelevantPath p, string name, Namespace ns, ItemNode encl) { - unqualifiedPathLookup(p, name, ns, encl) - or +private predicate keywordLookup(ItemNode encl, string name, Namespace ns, RelevantPath p) { // For `($)crate`, jump directly to the root module exists(ItemNode i | p.isCratePath(name, i) | encl.(ModuleLikeNode).isRoot() and @@ -920,13 +935,21 @@ private predicate unqualifiedPathLookup1(RelevantPath p, string name, Namespace or rootHasCratePathTc(encl, i) ) + or + name = ["super", "self"] and + p.isUnqualified(name) and + exists(ItemNode encl0 | + encl0.getADescendant() = p and + encl = getAdjustedEnclosing(encl0, ns) + ) } pragma[nomagic] -private ItemNode unqualifiedPathLookup(RelevantPath path, Namespace ns) { - exists(ItemNode encl, string name | - result = getASuccessor(encl, name, ns) and - unqualifiedPathLookup1(path, name, ns, encl) +private ItemNode unqualifiedPathLookup(RelevantPath p, Namespace ns) { + exists(ItemNode encl, string name | result = getASuccessor(encl, name, ns) | + unqualifiedPathLookup(encl, name, ns, p) + or + keywordLookup(encl, name, ns, p) ) } From 68f93492b12249716d8c82c67a6745db0afc6ca8 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 28 Mar 2025 15:11:00 +0100 Subject: [PATCH 170/240] C#: Add cs/invalid-string-formatting to the codeql quality suite. --- csharp/ql/src/codeql-suites/csharp-code-quality.qls | 1 + 1 file changed, 1 insertion(+) diff --git a/csharp/ql/src/codeql-suites/csharp-code-quality.qls b/csharp/ql/src/codeql-suites/csharp-code-quality.qls index a7cfd44d7348..64a100acda22 100644 --- a/csharp/ql/src/codeql-suites/csharp-code-quality.qls +++ b/csharp/ql/src/codeql-suites/csharp-code-quality.qls @@ -13,3 +13,4 @@ - cs/useless-gethashcode-call - cs/non-short-circuit - cs/useless-assignment-to-local + - cs/invalid-string-formatting From 9cfd6e30b9b23a1888191cc775b7ac776b8cf837 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Thu, 3 Apr 2025 15:00:04 +0200 Subject: [PATCH 171/240] C#: Convert testing of cs/invalid-string-formatting to inline expectations and adjust some of the testcases. --- .../API Abuse/FormatInvalid/FormatInvalid.cs | 102 ++++++------ .../FormatInvalid/FormatInvalid.expected | 150 +++++++++--------- .../FormatInvalid/FormatInvalid.qlref | 3 +- .../FormatInvalid/FormatInvalidBad.cs | 2 +- .../FormatInvalid/FormatMissingArgument.cs | 10 +- .../FormatInvalid/FormatMissingArgumentBad.cs | 4 +- .../FormatInvalid/FormatUnusedArgument.cs | 14 +- .../FormatInvalid/FormatUnusedArgumentBad.cs | 6 +- 8 files changed, 144 insertions(+), 147 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs index 4789da9cf6b5..d65870f3a32d 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs @@ -24,38 +24,38 @@ void FormatStringTests() String.Format("{0, -10 :0.000}", 1); // BAD: Invalid format string - String.Format("{ 0}", 1); + String.Format("{ 0}", 1); // $ Alert // BAD: Invalid format string - String.Format("{0,--1}", 1); + String.Format("{0,--1}", 1); // $ Alert // BAD: Invalid format string - String.Format("{0:{}}", 1); + String.Format("{0:{}}", 1); // $ Alert // BAD: Invalid format string - String.Format("%d", 1); + String.Format("%d", 1); // $ Alert Sink // BAD: } { in the middle. - String.Format("{{0}-{1}}", 0, 1); + String.Format("{{0}-{1}}", 0, 1); // $ Alert // BAD: This is invalid - String.Format("{0}}", 0, 1); + String.Format("{0}}", 0, 1); // $ Alert // BAD: Invalid - string.Format("{foo{0}}", 0); + string.Format("{foo{0}}", 0); // $ Alert // GOOD: {{ is output as { - String.Format("{{sdc}}", 0); + String.Format("{{sdc}}{0}", 0); // BAD: Invalid: Stray } - String.Format("}", 0); + String.Format("}{0}", 0); // $ Alert // GOOD: {{ output as { - String.Format("new {0} ({1} => {{", 0); + String.Format("new {0} ({1} => {{", 0, 1); // GOOD: Literal {{ and }} - String.Format("{{", ""); - String.Format("{{{{}}", ""); + String.Format("{0}{{", 0); + String.Format("{0}{{{{}}", 0); } IFormatProvider fp; @@ -72,49 +72,49 @@ void FormatMethodTests() Format("}", 0); // BAD: All of these are format methods with an invalid string. - String.Format("}", 0); - String.Format("}", ps); - String.Format(fp, "}", ps); - String.Format("}", 0, 1); - String.Format("}", 0, 1, 2); - String.Format("}", 0, 1, 2, 3); - - sb.AppendFormat("}", 0); - sb.AppendFormat("}", ps); - sb.AppendFormat(fp, "}", ps); - sb.AppendFormat("}", 0, 1); - sb.AppendFormat("}", 0, 1, 2); - sb.AppendFormat("}", 0, 1, 2, 3); - - Console.WriteLine("}", 0); - Console.WriteLine("}", ps); - Console.WriteLine("}", 0, 1); - Console.WriteLine("}", 0, 1, 2); - Console.WriteLine("}", 0, 1, 2, 3); - - tw.WriteLine("}", 0); - tw.WriteLine("}", ps); - tw.WriteLine("}", 0, 1); - tw.WriteLine("}", 0, 1, 2); - tw.WriteLine("}", 0, 1, 2, 3); - - System.Diagnostics.Debug.WriteLine("}", ps); - System.Diagnostics.Trace.TraceError("}", 0); - System.Diagnostics.Trace.TraceInformation("}", 0); - System.Diagnostics.Trace.TraceWarning("}", 0); - ts.TraceInformation("}", 0); - - Console.Write("}", 0); - Console.Write("}", 0, 1); - Console.Write("}", 0, 1, 2); - Console.Write("}", 0, 1, 2, 3); + String.Format("}", 0); // $ Alert + String.Format("}", ps); // $ Alert + String.Format(fp, "}", ps); // $ Alert + String.Format("}", 0, 1); // $ Alert + String.Format("}", 0, 1, 2); // $ Alert + String.Format("}", 0, 1, 2, 3); // $ Alert + + sb.AppendFormat("}", 0); // $ Alert + sb.AppendFormat("}", ps); // $ Alert + sb.AppendFormat(fp, "}", ps); // $ Alert + sb.AppendFormat("}", 0, 1); // $ Alert + sb.AppendFormat("}", 0, 1, 2); // $ Alert + sb.AppendFormat("}", 0, 1, 2, 3); // $ Alert + + Console.WriteLine("}", 0); // $ Alert + Console.WriteLine("}", ps); // $ Alert + Console.WriteLine("}", 0, 1); // $ Alert + Console.WriteLine("}", 0, 1, 2); // $ Alert + Console.WriteLine("}", 0, 1, 2, 3); // $ Alert + + tw.WriteLine("}", 0); // $ Alert + tw.WriteLine("}", ps); // $ Alert + tw.WriteLine("}", 0, 1); // $ Alert + tw.WriteLine("}", 0, 1, 2); // $ Alert + tw.WriteLine("}", 0, 1, 2, 3); // $ Alert + + System.Diagnostics.Debug.WriteLine("}", ps); // $ Alert + System.Diagnostics.Trace.TraceError("}", 0); // $ Alert + System.Diagnostics.Trace.TraceInformation("}", 0); // $ Alert + System.Diagnostics.Trace.TraceWarning("}", 0); // $ Alert + ts.TraceInformation("}", 0); // $ Alert + + Console.Write("}", 0); // $ Alert + Console.Write("}", 0, 1); // $ Alert + Console.Write("}", 0, 1, 2); // $ Alert + Console.Write("}", 0, 1, 2, 3); // $ Alert System.Diagnostics.Debug.WriteLine("}", ""); // GOOD System.Diagnostics.Debug.Write("}", ""); // GOOD - System.Diagnostics.Debug.Assert(true, "Error", "}", ps); - sw.Write("}", 0); - System.Diagnostics.Debug.Print("}", ps); + System.Diagnostics.Debug.Assert(true, "Error", "}", ps); // $ Alert + sw.Write("}", 0); // $ Alert + System.Diagnostics.Debug.Print("}", ps); // $ Alert Console.WriteLine("}"); // GOOD } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index a1c5e9254370..b23ee42559b9 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -1,3 +1,72 @@ +#select +| FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:27:9:27:32 | call to method Format | this | FormatInvalid.cs:27:9:27:32 | call to method Format | this | +| FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:30:9:30:35 | call to method Format | this | FormatInvalid.cs:30:9:30:35 | call to method Format | this | +| FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:33:9:33:34 | call to method Format | this | FormatInvalid.cs:33:9:33:34 | call to method Format | this | +| FormatInvalid.cs:36:9:36:30 | call to method Format | FormatInvalid.cs:36:23:36:26 | "%d" | FormatInvalid.cs:36:23:36:26 | "%d" | The $@ ignores $@. | FormatInvalid.cs:36:23:36:26 | "%d" | format string | FormatInvalid.cs:36:29:36:29 | (...) ... | this supplied value | +| FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:39:9:39:40 | call to method Format | this | FormatInvalid.cs:39:9:39:40 | call to method Format | this | +| FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | +| FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | +| FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:32 | call to method Format | this | FormatInvalid.cs:51:9:51:32 | call to method Format | this | +| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:29 | call to method Format | this | FormatInvalid.cs:75:9:75:29 | call to method Format | this | +| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:30 | call to method Format | this | FormatInvalid.cs:76:9:76:30 | call to method Format | this | +| FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:34 | call to method Format | this | FormatInvalid.cs:77:9:77:34 | call to method Format | this | +| FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:32 | call to method Format | this | FormatInvalid.cs:78:9:78:32 | call to method Format | this | +| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:35 | call to method Format | this | FormatInvalid.cs:79:9:79:35 | call to method Format | this | +| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:38 | call to method Format | this | FormatInvalid.cs:80:9:80:38 | call to method Format | this | +| FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | +| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | +| FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | +| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | +| FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | +| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | +| FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | +| FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | +| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | +| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | +| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | +| FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | +| FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | +| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | +| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | +| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | +| FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | +| FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | +| FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | +| FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | +| FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | +| FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:29 | call to method Write | this | FormatInvalid.cs:107:9:107:29 | call to method Write | this | +| FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:108:9:108:32 | call to method Write | this | FormatInvalid.cs:108:9:108:32 | call to method Write | this | +| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:35 | call to method Write | this | FormatInvalid.cs:109:9:109:35 | call to method Write | this | +| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:38 | call to method Write | this | FormatInvalid.cs:110:9:110:38 | call to method Write | this | +| FormatInvalid.cs:115:56:115:58 | "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | +| FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:116:9:116:24 | call to method Write | this | FormatInvalid.cs:116:9:116:24 | call to method Write | this | +| FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:47 | call to method Print | this | FormatInvalid.cs:117:9:117:47 | call to method Print | this | +| FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | +| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | +| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | +| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | +| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | +| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:34:14:34 | (...) ... | this supplied value | +| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:37:14:37 | (...) ... | this supplied value | +| FormatMissingArgument.cs:25:9:25:32 | call to method WriteLine | FormatMissingArgument.cs:25:27:25:31 | "{0}" | FormatMissingArgument.cs:25:27:25:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | +| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | +| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:31:31:31:31 | (...) ... | this supplied value | +| FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | +| FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | +| FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | +| FormatUnusedArgument.cs:11:9:11:29 | call to method Format | FormatUnusedArgument.cs:11:23:11:25 | "X" | FormatUnusedArgument.cs:11:23:11:25 | "X" | The $@ ignores $@. | FormatUnusedArgument.cs:11:23:11:25 | "X" | format string | FormatUnusedArgument.cs:11:28:11:28 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:14:9:14:34 | call to method Format | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | The $@ ignores $@. | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | format string | FormatUnusedArgument.cs:14:33:14:33 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:17:9:17:38 | call to method Format | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | The $@ ignores $@. | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | format string | FormatUnusedArgument.cs:17:37:17:37 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:20:9:20:38 | call to method Format | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | The $@ ignores $@. | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | format string | FormatUnusedArgument.cs:20:34:20:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:34:23:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:37:23:37 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:40:23:40 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:26:9:26:35 | call to method Format | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:26:34:26:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:38:9:38:33 | call to method Format | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | format string | FormatUnusedArgument.cs:38:32:38:32 | (...) ... | this supplied value | +| FormatUnusedArgumentBad.cs:7:9:7:71 | call to method WriteLine | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | format string | FormatUnusedArgumentBad.cs:7:61:7:70 | (...) ... | this supplied value | +| FormatUnusedArgumentBad.cs:8:9:8:77 | call to method WriteLine | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | format string | FormatUnusedArgumentBad.cs:8:63:8:64 | access to parameter ex | this supplied value | +| FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | +| FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | edges | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:24:28:29 | format : String | provenance | | | FormatMissingArgument.cs:28:24:28:29 | format : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | provenance | | @@ -15,11 +84,11 @@ nodes | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | | FormatInvalid.cs:42:23:42:28 | "{0}}" | semmle.label | "{0}}" | | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | -| FormatInvalid.cs:48:23:48:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | -| FormatInvalid.cs:51:23:51:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:48:23:48:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | +| FormatInvalid.cs:51:23:51:28 | "}{0}" | semmle.label | "}{0}" | | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | -| FormatInvalid.cs:57:23:57:26 | "{{" | semmle.label | "{{" | -| FormatInvalid.cs:58:23:58:30 | "{{{{}}" | semmle.label | "{{{{}}" | +| FormatInvalid.cs:57:23:57:29 | "{0}{{" | semmle.label | "{0}{{" | +| FormatInvalid.cs:58:23:58:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | | FormatInvalid.cs:75:23:75:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:77:27:77:29 | "}" | semmle.label | "}" | @@ -85,76 +154,3 @@ nodes | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths -#select -| FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:27:9:27:32 | call to method Format | this | FormatInvalid.cs:27:9:27:32 | call to method Format | this | -| FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:30:9:30:35 | call to method Format | this | FormatInvalid.cs:30:9:30:35 | call to method Format | this | -| FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:33:9:33:34 | call to method Format | this | FormatInvalid.cs:33:9:33:34 | call to method Format | this | -| FormatInvalid.cs:36:9:36:30 | call to method Format | FormatInvalid.cs:36:23:36:26 | "%d" | FormatInvalid.cs:36:23:36:26 | "%d" | The $@ ignores $@. | FormatInvalid.cs:36:23:36:26 | "%d" | format string | FormatInvalid.cs:36:29:36:29 | (...) ... | this supplied value | -| FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:39:9:39:40 | call to method Format | this | FormatInvalid.cs:39:9:39:40 | call to method Format | this | -| FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | -| FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | -| FormatInvalid.cs:48:9:48:35 | call to method Format | FormatInvalid.cs:48:23:48:31 | "{{sdc}}" | FormatInvalid.cs:48:23:48:31 | "{{sdc}}" | The $@ ignores $@. | FormatInvalid.cs:48:23:48:31 | "{{sdc}}" | format string | FormatInvalid.cs:48:34:48:34 | (...) ... | this supplied value | -| FormatInvalid.cs:51:23:51:25 | "}" | FormatInvalid.cs:51:23:51:25 | "}" | FormatInvalid.cs:51:23:51:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:29 | call to method Format | this | FormatInvalid.cs:51:9:51:29 | call to method Format | this | -| FormatInvalid.cs:54:9:54:46 | call to method Format | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | Argument '{1}' has not been supplied to $@ format string. | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | this | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | this | -| FormatInvalid.cs:57:9:57:31 | call to method Format | FormatInvalid.cs:57:23:57:26 | "{{" | FormatInvalid.cs:57:23:57:26 | "{{" | The $@ ignores $@. | FormatInvalid.cs:57:23:57:26 | "{{" | format string | FormatInvalid.cs:57:29:57:30 | "" | this supplied value | -| FormatInvalid.cs:58:9:58:35 | call to method Format | FormatInvalid.cs:58:23:58:30 | "{{{{}}" | FormatInvalid.cs:58:23:58:30 | "{{{{}}" | The $@ ignores $@. | FormatInvalid.cs:58:23:58:30 | "{{{{}}" | format string | FormatInvalid.cs:58:33:58:34 | "" | this supplied value | -| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:29 | call to method Format | this | FormatInvalid.cs:75:9:75:29 | call to method Format | this | -| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:30 | call to method Format | this | FormatInvalid.cs:76:9:76:30 | call to method Format | this | -| FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:34 | call to method Format | this | FormatInvalid.cs:77:9:77:34 | call to method Format | this | -| FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:32 | call to method Format | this | FormatInvalid.cs:78:9:78:32 | call to method Format | this | -| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:35 | call to method Format | this | FormatInvalid.cs:79:9:79:35 | call to method Format | this | -| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:38 | call to method Format | this | FormatInvalid.cs:80:9:80:38 | call to method Format | this | -| FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | -| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | -| FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | -| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | -| FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | -| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | -| FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | -| FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | -| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | -| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | -| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | -| FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | -| FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | -| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | -| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | -| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | -| FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | -| FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | -| FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | -| FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | -| FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | -| FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:29 | call to method Write | this | FormatInvalid.cs:107:9:107:29 | call to method Write | this | -| FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:108:9:108:32 | call to method Write | this | FormatInvalid.cs:108:9:108:32 | call to method Write | this | -| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:35 | call to method Write | this | FormatInvalid.cs:109:9:109:35 | call to method Write | this | -| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:38 | call to method Write | this | FormatInvalid.cs:110:9:110:38 | call to method Write | this | -| FormatInvalid.cs:115:56:115:58 | "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | -| FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:116:9:116:24 | call to method Write | this | FormatInvalid.cs:116:9:116:24 | call to method Write | this | -| FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:47 | call to method Print | this | FormatInvalid.cs:117:9:117:47 | call to method Print | this | -| FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | -| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | -| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:34:14:34 | (...) ... | this supplied value | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:37:14:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:25:9:25:32 | call to method WriteLine | FormatMissingArgument.cs:25:27:25:31 | "{0}" | FormatMissingArgument.cs:25:27:25:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | -| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | -| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:31:31:31:31 | (...) ... | this supplied value | -| FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | -| FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | -| FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | -| FormatUnusedArgument.cs:11:9:11:29 | call to method Format | FormatUnusedArgument.cs:11:23:11:25 | "X" | FormatUnusedArgument.cs:11:23:11:25 | "X" | The $@ ignores $@. | FormatUnusedArgument.cs:11:23:11:25 | "X" | format string | FormatUnusedArgument.cs:11:28:11:28 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:14:9:14:34 | call to method Format | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | The $@ ignores $@. | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | format string | FormatUnusedArgument.cs:14:33:14:33 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:17:9:17:38 | call to method Format | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | The $@ ignores $@. | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | format string | FormatUnusedArgument.cs:17:37:17:37 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:20:9:20:38 | call to method Format | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | The $@ ignores $@. | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | format string | FormatUnusedArgument.cs:20:34:20:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:34:23:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:37:23:37 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:40:23:40 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:26:9:26:35 | call to method Format | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:26:34:26:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:38:9:38:33 | call to method Format | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | format string | FormatUnusedArgument.cs:38:32:38:32 | (...) ... | this supplied value | -| FormatUnusedArgumentBad.cs:7:9:7:71 | call to method WriteLine | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | format string | FormatUnusedArgumentBad.cs:7:61:7:70 | (...) ... | this supplied value | -| FormatUnusedArgumentBad.cs:8:9:8:77 | call to method WriteLine | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | format string | FormatUnusedArgumentBad.cs:8:63:8:64 | access to parameter ex | this supplied value | -| FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | -| FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.qlref b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.qlref index 75f1d04fe147..9c660b69de53 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.qlref +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.qlref @@ -1 +1,2 @@ -API Abuse/FormatInvalid.ql \ No newline at end of file +query: API Abuse/FormatInvalid.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalidBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalidBad.cs index ec3df72655de..424781b80bc7 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalidBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalidBad.cs @@ -4,6 +4,6 @@ class Bad1 { string GenerateEmptyClass(string c) { - return string.Format("class {0} { }", "C"); + return string.Format("class {0} { }", "C"); // $ Alert } } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index 94201c0ddf8e..fa046a6fc7c6 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -8,10 +8,10 @@ void TestFormatMissingArgument() String.Format("{0}", 0); // BAD: Missing {1} - String.Format("{1}", 0); + String.Format("{1}", 0); // $ Alert Sink // BAD: Missing {2} and {3} - String.Format("{2} {3}", 0, 1); + String.Format("{2} {3}", 0, 1); // $ Alert Sink // GOOD: An array has been supplied. String.Format("{0} {1} {2}", args); @@ -19,16 +19,16 @@ void TestFormatMissingArgument() // GOOD: All arguments supplied to params String.Format("{0} {1} {2} {3}", 0, 1, 2, 3); - helper("{1}"); + helper("{1}"); // $ Source // BAD: Missing {0} - Console.WriteLine("{0}"); + Console.WriteLine("{0}"); // $ Alert Sink } void helper(string format) { // BAD: Missing {1} - String.Format(format, 0); + String.Format(format, 0); // $ Alert Sink } object[] args; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs index a66eea4cf323..a3614a881b9a 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs @@ -4,7 +4,7 @@ class Bad3 { void Hello(string first, string last) { - Console.WriteLine("Hello {0} {1}", first); - Console.WriteLine("Hello {1} {2}", first, last); + Console.WriteLine("Hello {0} {1}", first); // $ Alert Sink + Console.WriteLine("Hello {1} {2}", first, last); // $ Alert Sink } } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs index 81842d1e19de..61f691840870 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs @@ -8,22 +8,22 @@ void FormatTests() String.Format("{0} {1} {2}", 0, 1, 2); // BAD: Missing arg {0} - String.Format("X", 1); + String.Format("X", 1); // $ Alert Sink // BAD: Missing {1} - String.Format("{0}", 1, 2); + String.Format("{0}", 1, 2); // $ Alert Sink // BAD: Missing {1} - String.Format("{0} {0}", 1, 2); + String.Format("{0} {0}", 1, 2); // $ Alert Sink // BAD: Missing {0} - String.Format("{1} {1}", 1, 2); + String.Format("{1} {1}", 1, 2); // $ Alert Sink // BAD: Missing {0}, {1} and {2} - String.Format("abcdefg", 0, 1, 2); + String.Format("abcdefg", 0, 1, 2); // $ Alert Sink // BAD: {0} is unused - String.Format("{{sdc}}", 0); + String.Format("{{sdc}}", 0); // $ Alert Sink // GOOD: {0} is used String.Format("{{{0:D}}}", 0); @@ -35,7 +35,7 @@ void FormatTests() String.Format("{0} {1} {2}", ps); // BAD: Would display "{0}" - String.Format("{{0}}", 1); + String.Format("{{0}}", 1); // $ Alert Sink // GOOD: Ignore the empty string as it's often used as the default value // of GetResource(). diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs index 25bce1a742e9..5a951efa4320 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs @@ -4,8 +4,8 @@ class Bad2 { void M(Exception ex) { - Console.WriteLine("Error processing file: {0}", ex, ex.HResult); - Console.WriteLine("Error processing file: {1} ({1})", ex, ex.HResult); - Console.WriteLine("Error processing file: %s (%d)", ex, ex.HResult); + Console.WriteLine("Error processing file: {0}", ex, ex.HResult); // $ Alert Sink + Console.WriteLine("Error processing file: {1} ({1})", ex, ex.HResult); // $ Alert Sink + Console.WriteLine("Error processing file: %s (%d)", ex, ex.HResult); // $ Alert Sink } } From 327ddb07a173f827c0316933a97472bac6ccdac5 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 12:59:17 +0200 Subject: [PATCH 172/240] C#: Re-factor FormatMethod. --- .../semmle/code/csharp/frameworks/Format.qll | 122 +++++++++++------- 1 file changed, 73 insertions(+), 49 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index f54476b9e4fc..4fd273014eb8 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -8,67 +8,91 @@ private import semmle.code.csharp.frameworks.System private import semmle.code.csharp.frameworks.system.Text /** A method that formats a string, for example `string.Format()`. */ -class FormatMethod extends Method { - FormatMethod() { - exists(Class declType | declType = this.getDeclaringType() | +abstract class FormatMethod extends Method { + /** + * Gets the argument containing the format string. For example, the argument of + * `string.Format(IFormatProvider, String, Object)` is `1`. + */ + abstract int getFormatArgument(); +} + +private class StringAndStringBuilderFormatMethods extends FormatMethod { + StringAndStringBuilderFormatMethods() { + ( this.getParameter(0).getType() instanceof SystemIFormatProviderInterface and - this.getParameter(1).getType() instanceof StringType and + this.getParameter(1).getType() instanceof StringType + or + this.getParameter(0).getType() instanceof StringType + ) and + ( + this = any(SystemStringClass c).getFormatMethod() + or + this = any(SystemTextStringBuilderClass c).getAppendFormatMethod() + ) + } + + override int getFormatArgument() { + if this.getParameter(0).getType() instanceof SystemIFormatProviderInterface + then result = 1 + else result = 0 + } +} + +private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod { + SystemConsoleAndSystemIoTextWriterFormatMethods() { + this.getParameter(0).getType() instanceof StringType and + exists(Class declType | declType = this.getDeclaringType() | + this.hasName(["Write", "WriteLine"]) and ( - this = any(SystemStringClass c).getFormatMethod() + declType.hasFullyQualifiedName("System", "Console") or - this = any(SystemTextStringBuilderClass c).getAppendFormatMethod() + declType.hasFullyQualifiedName("System.IO", "TextWriter") ) - or - this.getParameter(0).getType() instanceof StringType and + ) + } + + override int getFormatArgument() { result = 0 } +} + +private class SystemDiagnosticsDebugAssert extends FormatMethod { + SystemDiagnosticsDebugAssert() { + this.hasName("Assert") and + this.getDeclaringType().hasFullyQualifiedName("System.Diagnostics", "Debug") and + this.getNumberOfParameters() = 4 + } + + override int getFormatArgument() { result = 2 } +} + +private class SystemDiagnosticsFormatMethods extends FormatMethod { + SystemDiagnosticsFormatMethods() { + this.getParameter(0).getType() instanceof StringType and + exists(Class declType | + declType = this.getDeclaringType() and + declType.getNamespace().getFullName() = "System.Diagnostics" + | + declType.hasName("Trace") and ( - this = any(SystemStringClass c).getFormatMethod() - or - this = any(SystemTextStringBuilderClass c).getAppendFormatMethod() - or - (this.hasName("Write") or this.hasName("WriteLine")) and - ( - declType.hasFullyQualifiedName("System", "Console") - or - declType.hasFullyQualifiedName("System.IO", "TextWriter") - or - declType.hasFullyQualifiedName("System.Diagnostics", "Debug") and - this.getParameter(1).getType() instanceof ArrayType - ) + this.hasName("TraceError") or - declType.hasFullyQualifiedName("System.Diagnostics", "Trace") and - ( - this.hasName("TraceError") or - this.hasName("TraceInformation") or - this.hasName("TraceWarning") - ) + this.hasName("TraceInformation") or - this.hasName("TraceInformation") and - declType.hasFullyQualifiedName("System.Diagnostics", "TraceSource") - or - this.hasName("Print") and - declType.hasFullyQualifiedName("System.Diagnostics", "Debug") + this.hasName("TraceWarning") ) or - this.hasName("Assert") and - declType.hasFullyQualifiedName("System.Diagnostics", "Debug") and - this.getNumberOfParameters() = 4 + declType.hasName("TraceSource") and this.hasName("TraceInformation") + or + declType.hasName("Debug") and + ( + this.hasName("Print") + or + this.hasName(["Write", "WriteLine"]) and + this.getParameter(1).getType() instanceof ArrayType + ) ) } - /** - * Gets the argument containing the format string. For example, the argument of - * `string.Format(IFormatProvider, String, Object)` is `1`. - */ - int getFormatArgument() { - if this.getParameter(0).getType() instanceof SystemIFormatProviderInterface - then result = 1 - else - if - this.hasName("Assert") and - this.getDeclaringType().hasFullyQualifiedName("System.Diagnostics", "Debug") - then result = 2 - else result = 0 - } + override int getFormatArgument() { result = 0 } } pragma[nomagic] From 175e4ecb743442e571dde3bf9769448144e2e41d Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 15:48:43 +0200 Subject: [PATCH 173/240] C#: Add more format testcases. --- .../API Abuse/FormatInvalid/FormatInvalid.cs | 15 ++ .../FormatInvalid/FormatInvalid.expected | 158 ++++++++++++------ 2 files changed, 119 insertions(+), 54 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs index d65870f3a32d..4072dfbd6881 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs @@ -72,6 +72,7 @@ void FormatMethodTests() Format("}", 0); // BAD: All of these are format methods with an invalid string. + String.Format("}"); // $ Alert String.Format("}", 0); // $ Alert String.Format("}", ps); // $ Alert String.Format(fp, "}", ps); // $ Alert @@ -79,6 +80,7 @@ void FormatMethodTests() String.Format("}", 0, 1, 2); // $ Alert String.Format("}", 0, 1, 2, 3); // $ Alert + sb.AppendFormat("}"); // $ Alert sb.AppendFormat("}", 0); // $ Alert sb.AppendFormat("}", ps); // $ Alert sb.AppendFormat(fp, "}", ps); // $ Alert @@ -117,6 +119,19 @@ void FormatMethodTests() System.Diagnostics.Debug.Print("}", ps); // $ Alert Console.WriteLine("}"); // GOOD + + // The Following methods are not recognised as format methods. + Console.WriteLine("{0}"); // GOOD + Console.Write("{0}"); // GOOD + tw.WriteLine("{0}"); // GOOD + tw.Write("{0}"); // GOOD + System.Diagnostics.Debug.Print("{0}"); // GOOD + System.Diagnostics.Debug.WriteLine("{0}"); // GOOD + System.Diagnostics.Debug.Write("{0}"); // GOOD + System.Diagnostics.Trace.TraceError("{0}"); // GOOD + System.Diagnostics.Trace.TraceInformation("{0}"); // GOOD + System.Diagnostics.Trace.TraceWarning("{0}"); // GOOD + ts.TraceInformation("{0}"); // GOOD } System.IO.StringWriter sw; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index b23ee42559b9..4a7730a26e8f 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -7,40 +7,49 @@ | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:32 | call to method Format | this | FormatInvalid.cs:51:9:51:32 | call to method Format | this | -| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:29 | call to method Format | this | FormatInvalid.cs:75:9:75:29 | call to method Format | this | -| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:30 | call to method Format | this | FormatInvalid.cs:76:9:76:30 | call to method Format | this | -| FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:34 | call to method Format | this | FormatInvalid.cs:77:9:77:34 | call to method Format | this | -| FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:32 | call to method Format | this | FormatInvalid.cs:78:9:78:32 | call to method Format | this | -| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:35 | call to method Format | this | FormatInvalid.cs:79:9:79:35 | call to method Format | this | -| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:38 | call to method Format | this | FormatInvalid.cs:80:9:80:38 | call to method Format | this | -| FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | -| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | -| FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | -| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | -| FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | -| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | -| FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | -| FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | -| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | -| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | -| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | -| FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | -| FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | -| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | -| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | -| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | -| FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | -| FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | -| FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | -| FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | -| FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | -| FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:29 | call to method Write | this | FormatInvalid.cs:107:9:107:29 | call to method Write | this | -| FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:108:9:108:32 | call to method Write | this | FormatInvalid.cs:108:9:108:32 | call to method Write | this | -| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:35 | call to method Write | this | FormatInvalid.cs:109:9:109:35 | call to method Write | this | -| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:38 | call to method Write | this | FormatInvalid.cs:110:9:110:38 | call to method Write | this | -| FormatInvalid.cs:115:56:115:58 | "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | -| FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:116:9:116:24 | call to method Write | this | FormatInvalid.cs:116:9:116:24 | call to method Write | this | -| FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:47 | call to method Print | this | FormatInvalid.cs:117:9:117:47 | call to method Print | this | +| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:29 | call to method Format | this | FormatInvalid.cs:76:9:76:29 | call to method Format | this | +| FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:30 | call to method Format | this | FormatInvalid.cs:77:9:77:30 | call to method Format | this | +| FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:34 | call to method Format | this | FormatInvalid.cs:78:9:78:34 | call to method Format | this | +| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:32 | call to method Format | this | FormatInvalid.cs:79:9:79:32 | call to method Format | this | +| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:35 | call to method Format | this | FormatInvalid.cs:80:9:80:35 | call to method Format | this | +| FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:81:9:81:38 | call to method Format | this | FormatInvalid.cs:81:9:81:38 | call to method Format | this | +| FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | +| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | +| FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | +| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this | +| FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this | +| FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this | +| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this | +| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this | +| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this | +| FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this | +| FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this | +| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this | +| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this | +| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this | +| FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this | +| FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this | +| FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this | +| FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this | +| FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this | +| FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this | +| FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this | +| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:29 | call to method Write | this | FormatInvalid.cs:109:9:109:29 | call to method Write | this | +| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:32 | call to method Write | this | FormatInvalid.cs:110:9:110:32 | call to method Write | this | +| FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:111:9:111:35 | call to method Write | this | FormatInvalid.cs:111:9:111:35 | call to method Write | this | +| FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:112:9:112:38 | call to method Write | this | FormatInvalid.cs:112:9:112:38 | call to method Write | this | +| FormatInvalid.cs:117:56:117:58 | "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | +| FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:24 | call to method Write | this | FormatInvalid.cs:118:9:118:24 | call to method Write | this | +| FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:47 | call to method Print | this | FormatInvalid.cs:119:9:119:47 | call to method Print | this | +| FormatInvalid.cs:124:9:124:32 | call to method WriteLine | FormatInvalid.cs:124:27:124:31 | "{0}" | FormatInvalid.cs:124:27:124:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:124:27:124:31 | "{0}" | this | FormatInvalid.cs:124:27:124:31 | "{0}" | this | +| FormatInvalid.cs:125:9:125:28 | call to method Write | FormatInvalid.cs:125:23:125:27 | "{0}" | FormatInvalid.cs:125:23:125:27 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:125:23:125:27 | "{0}" | this | FormatInvalid.cs:125:23:125:27 | "{0}" | this | +| FormatInvalid.cs:126:9:126:27 | call to method WriteLine | FormatInvalid.cs:126:22:126:26 | "{0}" | FormatInvalid.cs:126:22:126:26 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:126:22:126:26 | "{0}" | this | FormatInvalid.cs:126:22:126:26 | "{0}" | this | +| FormatInvalid.cs:127:9:127:23 | call to method Write | FormatInvalid.cs:127:18:127:22 | "{0}" | FormatInvalid.cs:127:18:127:22 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:127:18:127:22 | "{0}" | this | FormatInvalid.cs:127:18:127:22 | "{0}" | this | +| FormatInvalid.cs:128:9:128:45 | call to method Print | FormatInvalid.cs:128:40:128:44 | "{0}" | FormatInvalid.cs:128:40:128:44 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:128:40:128:44 | "{0}" | this | FormatInvalid.cs:128:40:128:44 | "{0}" | this | +| FormatInvalid.cs:131:9:131:50 | call to method TraceError | FormatInvalid.cs:131:45:131:49 | "{0}" | FormatInvalid.cs:131:45:131:49 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:131:45:131:49 | "{0}" | this | FormatInvalid.cs:131:45:131:49 | "{0}" | this | +| FormatInvalid.cs:132:9:132:56 | call to method TraceInformation | FormatInvalid.cs:132:51:132:55 | "{0}" | FormatInvalid.cs:132:51:132:55 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:132:51:132:55 | "{0}" | this | FormatInvalid.cs:132:51:132:55 | "{0}" | this | +| FormatInvalid.cs:133:9:133:52 | call to method TraceWarning | FormatInvalid.cs:133:47:133:51 | "{0}" | FormatInvalid.cs:133:47:133:51 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:133:47:133:51 | "{0}" | this | FormatInvalid.cs:133:47:133:51 | "{0}" | this | +| FormatInvalid.cs:134:9:134:34 | call to method TraceInformation | FormatInvalid.cs:134:29:134:33 | "{0}" | FormatInvalid.cs:134:29:134:33 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:134:29:134:33 | "{0}" | this | FormatInvalid.cs:134:29:134:33 | "{0}" | this | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | | FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | | FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | @@ -91,39 +100,50 @@ nodes | FormatInvalid.cs:58:23:58:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | | FormatInvalid.cs:75:23:75:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:77:27:77:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:78:23:78:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:77:23:77:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:78:27:78:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:79:23:79:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:80:23:80:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:82:25:82:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:81:23:81:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:83:25:83:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:84:29:84:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:84:25:84:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:85:25:85:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:86:25:86:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:86:29:86:31 | "}" | semmle.label | "}" | | FormatInvalid.cs:87:25:87:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:89:27:89:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:90:27:90:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:88:25:88:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:89:25:89:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:91:27:91:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:92:27:92:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:93:27:93:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:95:22:95:24 | "}" | semmle.label | "}" | -| FormatInvalid.cs:96:22:96:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:94:27:94:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:95:27:95:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:97:22:97:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:98:22:98:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:99:22:99:24 | "}" | semmle.label | "}" | -| FormatInvalid.cs:101:44:101:46 | "}" | semmle.label | "}" | -| FormatInvalid.cs:102:45:102:47 | "}" | semmle.label | "}" | -| FormatInvalid.cs:103:51:103:53 | "}" | semmle.label | "}" | -| FormatInvalid.cs:104:47:104:49 | "}" | semmle.label | "}" | -| FormatInvalid.cs:105:29:105:31 | "}" | semmle.label | "}" | -| FormatInvalid.cs:107:23:107:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:108:23:108:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:100:22:100:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:101:22:101:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:103:44:103:46 | "}" | semmle.label | "}" | +| FormatInvalid.cs:104:45:104:47 | "}" | semmle.label | "}" | +| FormatInvalid.cs:105:51:105:53 | "}" | semmle.label | "}" | +| FormatInvalid.cs:106:47:106:49 | "}" | semmle.label | "}" | +| FormatInvalid.cs:107:29:107:31 | "}" | semmle.label | "}" | | FormatInvalid.cs:109:23:109:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:110:23:110:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | -| FormatInvalid.cs:116:18:116:20 | "}" | semmle.label | "}" | -| FormatInvalid.cs:117:40:117:42 | "}" | semmle.label | "}" | -| FormatInvalid.cs:119:27:119:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:111:23:111:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:112:23:112:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | +| FormatInvalid.cs:118:18:118:20 | "}" | semmle.label | "}" | +| FormatInvalid.cs:119:40:119:42 | "}" | semmle.label | "}" | +| FormatInvalid.cs:121:27:121:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:124:27:124:31 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:125:23:125:27 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:126:22:126:26 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:127:18:127:22 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:128:40:128:44 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:131:45:131:49 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:132:51:132:55 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:133:47:133:51 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:134:29:134:33 | "{0}" | semmle.label | "{0}" | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | | FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | | FormatMissingArgument.cs:8:23:8:27 | "{0}" | semmle.label | "{0}" | @@ -154,3 +174,33 @@ nodes | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths +testFailures +| FormatInvalid.cs:75:29:75:38 | // ... | Missing result: Alert | +| FormatInvalid.cs:83:31:83:40 | // ... | Missing result: Alert | +| FormatInvalid.cs:124:9:124:32 | FormatInvalid.cs:124:27:124:31 | Unexpected result: Alert | +| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:125:9:125:28 | FormatInvalid.cs:125:23:125:27 | Unexpected result: Alert | +| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:126:9:126:27 | FormatInvalid.cs:126:22:126:26 | Unexpected result: Alert | +| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:127:9:127:23 | FormatInvalid.cs:127:18:127:22 | Unexpected result: Alert | +| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:128:9:128:45 | FormatInvalid.cs:128:40:128:44 | Unexpected result: Alert | +| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:131:9:131:50 | FormatInvalid.cs:131:45:131:49 | Unexpected result: Alert | +| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:132:9:132:56 | FormatInvalid.cs:132:51:132:55 | Unexpected result: Alert | +| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:133:9:133:52 | FormatInvalid.cs:133:47:133:51 | Unexpected result: Alert | +| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:134:9:134:34 | FormatInvalid.cs:134:29:134:33 | Unexpected result: Alert | +| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Sink | From f73b7429c6dce48e45db5e6c737401722eca0b17 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 15:53:38 +0200 Subject: [PATCH 174/240] C#: Remove false positive example. --- .../API Abuse/FormatInvalid/FormatInvalid.expected | 14 ++++++-------- .../FormatInvalid/FormatMissingArgument.cs | 3 --- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 4a7730a26e8f..57523031ece4 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -57,9 +57,8 @@ | FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | | FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:34:14:34 | (...) ... | this supplied value | | FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:37:14:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:25:9:25:32 | call to method WriteLine | FormatMissingArgument.cs:25:27:25:31 | "{0}" | FormatMissingArgument.cs:25:27:25:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | -| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | -| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:31:31:31:31 | (...) ... | this supplied value | +| FormatMissingArgument.cs:28:9:28:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | +| FormatMissingArgument.cs:28:9:28:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:28:31:28:31 | (...) ... | this supplied value | | FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | @@ -77,8 +76,8 @@ | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | edges -| FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:24:28:29 | format : String | provenance | | -| FormatMissingArgument.cs:28:24:28:29 | format : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:25:24:25:29 | format : String | provenance | | +| FormatMissingArgument.cs:25:24:25:29 | format : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | provenance | | nodes | FormatInvalid.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | | FormatInvalid.cs:12:23:12:29 | "{0,1}" | semmle.label | "{0,1}" | @@ -152,9 +151,8 @@ nodes | FormatMissingArgument.cs:17:23:17:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | | FormatMissingArgument.cs:20:23:20:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:25:27:25:31 | "{0}" | semmle.label | "{0}" | -| FormatMissingArgument.cs:28:24:28:29 | format : String | semmle.label | format : String | -| FormatMissingArgument.cs:31:23:31:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:25:24:25:29 | format : String | semmle.label | format : String | +| FormatMissingArgument.cs:28:23:28:28 | access to parameter format | semmle.label | access to parameter format | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | | FormatMissingArgumentGood.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index fa046a6fc7c6..fabe7b239e4a 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -20,9 +20,6 @@ void TestFormatMissingArgument() String.Format("{0} {1} {2} {3}", 0, 1, 2, 3); helper("{1}"); // $ Source - - // BAD: Missing {0} - Console.WriteLine("{0}"); // $ Alert Sink } void helper(string format) From 1d9d8780b388e308d71dce43f885927b540f1e65 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 15:55:49 +0200 Subject: [PATCH 175/240] C#: Remove some false positives and add more true positives for cs/invalid-string-format. --- csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll | 2 ++ csharp/ql/src/API Abuse/FormatInvalid.ql | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index 4fd273014eb8..db1d4e42d74a 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -41,6 +41,7 @@ private class StringAndStringBuilderFormatMethods extends FormatMethod { private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod { SystemConsoleAndSystemIoTextWriterFormatMethods() { this.getParameter(0).getType() instanceof StringType and + this.getNumberOfParameters() > 1 and exists(Class declType | declType = this.getDeclaringType() | this.hasName(["Write", "WriteLine"]) and ( @@ -67,6 +68,7 @@ private class SystemDiagnosticsDebugAssert extends FormatMethod { private class SystemDiagnosticsFormatMethods extends FormatMethod { SystemDiagnosticsFormatMethods() { this.getParameter(0).getType() instanceof StringType and + this.getNumberOfParameters() > 1 and exists(Class declType | declType = this.getDeclaringType() and declType.getNamespace().getFullName() = "System.Diagnostics" diff --git a/csharp/ql/src/API Abuse/FormatInvalid.ql b/csharp/ql/src/API Abuse/FormatInvalid.ql index 235daa1ecc25..17923d5bc355 100644 --- a/csharp/ql/src/API Abuse/FormatInvalid.ql +++ b/csharp/ql/src/API Abuse/FormatInvalid.ql @@ -29,7 +29,6 @@ private predicate invalidFormatString( source.getNode().asExpr() = src and sink.getNode().asExpr() = call.getFormatExpr() and FormatInvalid::flowPath(source, sink) and - call.hasInsertions() and msg = "Invalid format string used in $@ formatting call." and callString = "this" } From 8fb5fe97aaa8c07ee70fd8452936216f11709434 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 15:57:00 +0200 Subject: [PATCH 176/240] C#: Update test expected output. --- .../FormatInvalid/FormatInvalid.expected | 51 +------------------ 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 57523031ece4..798102dc350d 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -7,12 +7,14 @@ | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:32 | call to method Format | this | FormatInvalid.cs:51:9:51:32 | call to method Format | this | +| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:26 | call to method Format | this | FormatInvalid.cs:75:9:75:26 | call to method Format | this | | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:29 | call to method Format | this | FormatInvalid.cs:76:9:76:29 | call to method Format | this | | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:30 | call to method Format | this | FormatInvalid.cs:77:9:77:30 | call to method Format | this | | FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:34 | call to method Format | this | FormatInvalid.cs:78:9:78:34 | call to method Format | this | | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:32 | call to method Format | this | FormatInvalid.cs:79:9:79:32 | call to method Format | this | | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:35 | call to method Format | this | FormatInvalid.cs:80:9:80:35 | call to method Format | this | | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:81:9:81:38 | call to method Format | this | FormatInvalid.cs:81:9:81:38 | call to method Format | this | +| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:28 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:28 | call to method AppendFormat | this | | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | | FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | @@ -41,15 +43,6 @@ | FormatInvalid.cs:117:56:117:58 | "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | | FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:24 | call to method Write | this | FormatInvalid.cs:118:9:118:24 | call to method Write | this | | FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:47 | call to method Print | this | FormatInvalid.cs:119:9:119:47 | call to method Print | this | -| FormatInvalid.cs:124:9:124:32 | call to method WriteLine | FormatInvalid.cs:124:27:124:31 | "{0}" | FormatInvalid.cs:124:27:124:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:124:27:124:31 | "{0}" | this | FormatInvalid.cs:124:27:124:31 | "{0}" | this | -| FormatInvalid.cs:125:9:125:28 | call to method Write | FormatInvalid.cs:125:23:125:27 | "{0}" | FormatInvalid.cs:125:23:125:27 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:125:23:125:27 | "{0}" | this | FormatInvalid.cs:125:23:125:27 | "{0}" | this | -| FormatInvalid.cs:126:9:126:27 | call to method WriteLine | FormatInvalid.cs:126:22:126:26 | "{0}" | FormatInvalid.cs:126:22:126:26 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:126:22:126:26 | "{0}" | this | FormatInvalid.cs:126:22:126:26 | "{0}" | this | -| FormatInvalid.cs:127:9:127:23 | call to method Write | FormatInvalid.cs:127:18:127:22 | "{0}" | FormatInvalid.cs:127:18:127:22 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:127:18:127:22 | "{0}" | this | FormatInvalid.cs:127:18:127:22 | "{0}" | this | -| FormatInvalid.cs:128:9:128:45 | call to method Print | FormatInvalid.cs:128:40:128:44 | "{0}" | FormatInvalid.cs:128:40:128:44 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:128:40:128:44 | "{0}" | this | FormatInvalid.cs:128:40:128:44 | "{0}" | this | -| FormatInvalid.cs:131:9:131:50 | call to method TraceError | FormatInvalid.cs:131:45:131:49 | "{0}" | FormatInvalid.cs:131:45:131:49 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:131:45:131:49 | "{0}" | this | FormatInvalid.cs:131:45:131:49 | "{0}" | this | -| FormatInvalid.cs:132:9:132:56 | call to method TraceInformation | FormatInvalid.cs:132:51:132:55 | "{0}" | FormatInvalid.cs:132:51:132:55 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:132:51:132:55 | "{0}" | this | FormatInvalid.cs:132:51:132:55 | "{0}" | this | -| FormatInvalid.cs:133:9:133:52 | call to method TraceWarning | FormatInvalid.cs:133:47:133:51 | "{0}" | FormatInvalid.cs:133:47:133:51 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:133:47:133:51 | "{0}" | this | FormatInvalid.cs:133:47:133:51 | "{0}" | this | -| FormatInvalid.cs:134:9:134:34 | call to method TraceInformation | FormatInvalid.cs:134:29:134:33 | "{0}" | FormatInvalid.cs:134:29:134:33 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:134:29:134:33 | "{0}" | this | FormatInvalid.cs:134:29:134:33 | "{0}" | this | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | | FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | | FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | @@ -133,16 +126,6 @@ nodes | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | | FormatInvalid.cs:118:18:118:20 | "}" | semmle.label | "}" | | FormatInvalid.cs:119:40:119:42 | "}" | semmle.label | "}" | -| FormatInvalid.cs:121:27:121:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:124:27:124:31 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:125:23:125:27 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:126:22:126:26 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:127:18:127:22 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:128:40:128:44 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:131:45:131:49 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:132:51:132:55 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:133:47:133:51 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:134:29:134:33 | "{0}" | semmle.label | "{0}" | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | | FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | | FormatMissingArgument.cs:8:23:8:27 | "{0}" | semmle.label | "{0}" | @@ -172,33 +155,3 @@ nodes | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths -testFailures -| FormatInvalid.cs:75:29:75:38 | // ... | Missing result: Alert | -| FormatInvalid.cs:83:31:83:40 | // ... | Missing result: Alert | -| FormatInvalid.cs:124:9:124:32 | FormatInvalid.cs:124:27:124:31 | Unexpected result: Alert | -| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:125:9:125:28 | FormatInvalid.cs:125:23:125:27 | Unexpected result: Alert | -| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:126:9:126:27 | FormatInvalid.cs:126:22:126:26 | Unexpected result: Alert | -| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:127:9:127:23 | FormatInvalid.cs:127:18:127:22 | Unexpected result: Alert | -| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:128:9:128:45 | FormatInvalid.cs:128:40:128:44 | Unexpected result: Alert | -| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:131:9:131:50 | FormatInvalid.cs:131:45:131:49 | Unexpected result: Alert | -| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:132:9:132:56 | FormatInvalid.cs:132:51:132:55 | Unexpected result: Alert | -| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:133:9:133:52 | FormatInvalid.cs:133:47:133:51 | Unexpected result: Alert | -| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:134:9:134:34 | FormatInvalid.cs:134:29:134:33 | Unexpected result: Alert | -| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Sink | From 11dffc6647736598bd0957d9dcbf82d1214d9091 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 14:41:21 +0200 Subject: [PATCH 177/240] C#: Add more invalid-string-formatting testcases. --- .../API Abuse/FormatInvalid/FormatInvalid.cs | 23 ++ .../FormatInvalid/FormatInvalid.expected | 281 ++++++++++-------- .../FormatInvalid/FormatMissingArgument.cs | 55 ++++ .../FormatInvalid/FormatUnusedArgument.cs | 42 +++ 4 files changed, 283 insertions(+), 118 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs index 4072dfbd6881..2690ec50890a 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using System.Text; class FormatInvalid @@ -134,5 +135,27 @@ void FormatMethodTests() ts.TraceInformation("{0}"); // GOOD } + void CompositeFormatMethods() + { + var format = CompositeFormat.Parse("}"); // $ Alert + + // GOOD: Format is invalid and this flagged during parsing. + String.Format(null, format, ""); + String.Format(null, format, "", ""); + String.Format(null, format, "", "", ""); + + sb.AppendFormat(null, format, ""); + sb.AppendFormat(null, format, ""); + sb.AppendFormat(null, format, "", ""); + sb.AppendFormat(null, format, "", "", ""); + + + var span = new Span(); + span.TryWrite(null, format, out _); + span.TryWrite(null, format, out _, new object()); + span.TryWrite(null, format, out _, new object(), new object()); + span.TryWrite(null, format, out _, "", "", ""); + } + System.IO.StringWriter sw; } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 798102dc350d..3d23145b406e 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -1,157 +1,202 @@ #select -| FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:27:9:27:32 | call to method Format | this | FormatInvalid.cs:27:9:27:32 | call to method Format | this | -| FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:30:9:30:35 | call to method Format | this | FormatInvalid.cs:30:9:30:35 | call to method Format | this | -| FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:33:9:33:34 | call to method Format | this | FormatInvalid.cs:33:9:33:34 | call to method Format | this | -| FormatInvalid.cs:36:9:36:30 | call to method Format | FormatInvalid.cs:36:23:36:26 | "%d" | FormatInvalid.cs:36:23:36:26 | "%d" | The $@ ignores $@. | FormatInvalid.cs:36:23:36:26 | "%d" | format string | FormatInvalid.cs:36:29:36:29 | (...) ... | this supplied value | -| FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:39:9:39:40 | call to method Format | this | FormatInvalid.cs:39:9:39:40 | call to method Format | this | -| FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | -| FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | -| FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:32 | call to method Format | this | FormatInvalid.cs:51:9:51:32 | call to method Format | this | -| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:26 | call to method Format | this | FormatInvalid.cs:75:9:75:26 | call to method Format | this | -| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:29 | call to method Format | this | FormatInvalid.cs:76:9:76:29 | call to method Format | this | -| FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:30 | call to method Format | this | FormatInvalid.cs:77:9:77:30 | call to method Format | this | -| FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:34 | call to method Format | this | FormatInvalid.cs:78:9:78:34 | call to method Format | this | -| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:32 | call to method Format | this | FormatInvalid.cs:79:9:79:32 | call to method Format | this | -| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:35 | call to method Format | this | FormatInvalid.cs:80:9:80:35 | call to method Format | this | -| FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:81:9:81:38 | call to method Format | this | FormatInvalid.cs:81:9:81:38 | call to method Format | this | -| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:28 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:28 | call to method AppendFormat | this | -| FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | -| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | -| FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | -| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this | -| FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this | -| FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this | -| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this | -| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this | -| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this | -| FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this | -| FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this | -| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this | -| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this | -| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this | -| FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this | -| FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this | -| FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this | -| FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this | -| FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this | -| FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this | -| FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this | -| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:29 | call to method Write | this | FormatInvalid.cs:109:9:109:29 | call to method Write | this | -| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:32 | call to method Write | this | FormatInvalid.cs:110:9:110:32 | call to method Write | this | -| FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:111:9:111:35 | call to method Write | this | FormatInvalid.cs:111:9:111:35 | call to method Write | this | -| FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:112:9:112:38 | call to method Write | this | FormatInvalid.cs:112:9:112:38 | call to method Write | this | -| FormatInvalid.cs:117:56:117:58 | "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | -| FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:24 | call to method Write | this | FormatInvalid.cs:118:9:118:24 | call to method Write | this | -| FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:47 | call to method Print | this | FormatInvalid.cs:119:9:119:47 | call to method Print | this | +| FormatInvalid.cs:28:23:28:28 | "{ 0}" | FormatInvalid.cs:28:23:28:28 | "{ 0}" | FormatInvalid.cs:28:23:28:28 | "{ 0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:28:9:28:32 | call to method Format | this | FormatInvalid.cs:28:9:28:32 | call to method Format | this | +| FormatInvalid.cs:31:23:31:31 | "{0,--1}" | FormatInvalid.cs:31:23:31:31 | "{0,--1}" | FormatInvalid.cs:31:23:31:31 | "{0,--1}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:31:9:31:35 | call to method Format | this | FormatInvalid.cs:31:9:31:35 | call to method Format | this | +| FormatInvalid.cs:34:23:34:30 | "{0:{}}" | FormatInvalid.cs:34:23:34:30 | "{0:{}}" | FormatInvalid.cs:34:23:34:30 | "{0:{}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:34:9:34:34 | call to method Format | this | FormatInvalid.cs:34:9:34:34 | call to method Format | this | +| FormatInvalid.cs:37:9:37:30 | call to method Format | FormatInvalid.cs:37:23:37:26 | "%d" | FormatInvalid.cs:37:23:37:26 | "%d" | The $@ ignores $@. | FormatInvalid.cs:37:23:37:26 | "%d" | format string | FormatInvalid.cs:37:29:37:29 | (...) ... | this supplied value | +| FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:40:9:40:40 | call to method Format | this | FormatInvalid.cs:40:9:40:40 | call to method Format | this | +| FormatInvalid.cs:43:23:43:28 | "{0}}" | FormatInvalid.cs:43:23:43:28 | "{0}}" | FormatInvalid.cs:43:23:43:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:43:9:43:35 | call to method Format | this | FormatInvalid.cs:43:9:43:35 | call to method Format | this | +| FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:46:9:46:36 | call to method Format | this | FormatInvalid.cs:46:9:46:36 | call to method Format | this | +| FormatInvalid.cs:52:23:52:28 | "}{0}" | FormatInvalid.cs:52:23:52:28 | "}{0}" | FormatInvalid.cs:52:23:52:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:52:9:52:32 | call to method Format | this | FormatInvalid.cs:52:9:52:32 | call to method Format | this | +| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:26 | call to method Format | this | FormatInvalid.cs:76:9:76:26 | call to method Format | this | +| FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:29 | call to method Format | this | FormatInvalid.cs:77:9:77:29 | call to method Format | this | +| FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:30 | call to method Format | this | FormatInvalid.cs:78:9:78:30 | call to method Format | this | +| FormatInvalid.cs:79:27:79:29 | "}" | FormatInvalid.cs:79:27:79:29 | "}" | FormatInvalid.cs:79:27:79:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:34 | call to method Format | this | FormatInvalid.cs:79:9:79:34 | call to method Format | this | +| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:32 | call to method Format | this | FormatInvalid.cs:80:9:80:32 | call to method Format | this | +| FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:81:9:81:35 | call to method Format | this | FormatInvalid.cs:81:9:81:35 | call to method Format | this | +| FormatInvalid.cs:82:23:82:25 | "}" | FormatInvalid.cs:82:23:82:25 | "}" | FormatInvalid.cs:82:23:82:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:82:9:82:38 | call to method Format | this | FormatInvalid.cs:82:9:82:38 | call to method Format | this | +| FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:28 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:28 | call to method AppendFormat | this | +| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:31 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:31 | call to method AppendFormat | this | +| FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:32 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:32 | call to method AppendFormat | this | +| FormatInvalid.cs:87:29:87:31 | "}" | FormatInvalid.cs:87:29:87:31 | "}" | FormatInvalid.cs:87:29:87:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:36 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:36 | call to method AppendFormat | this | +| FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:88:9:88:34 | call to method AppendFormat | this | FormatInvalid.cs:88:9:88:34 | call to method AppendFormat | this | +| FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:37 | call to method AppendFormat | this | FormatInvalid.cs:89:9:89:37 | call to method AppendFormat | this | +| FormatInvalid.cs:90:25:90:27 | "}" | FormatInvalid.cs:90:25:90:27 | "}" | FormatInvalid.cs:90:25:90:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:90:9:90:40 | call to method AppendFormat | this | FormatInvalid.cs:90:9:90:40 | call to method AppendFormat | this | +| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:33 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:33 | call to method WriteLine | this | +| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:34 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:34 | call to method WriteLine | this | +| FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:94:9:94:36 | call to method WriteLine | this | FormatInvalid.cs:94:9:94:36 | call to method WriteLine | this | +| FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:39 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:39 | call to method WriteLine | this | +| FormatInvalid.cs:96:27:96:29 | "}" | FormatInvalid.cs:96:27:96:29 | "}" | FormatInvalid.cs:96:27:96:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:96:9:96:42 | call to method WriteLine | this | FormatInvalid.cs:96:9:96:42 | call to method WriteLine | this | +| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:28 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:28 | call to method WriteLine | this | +| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:29 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:29 | call to method WriteLine | this | +| FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:100:9:100:31 | call to method WriteLine | this | FormatInvalid.cs:100:9:100:31 | call to method WriteLine | this | +| FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:34 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:34 | call to method WriteLine | this | +| FormatInvalid.cs:102:22:102:24 | "}" | FormatInvalid.cs:102:22:102:24 | "}" | FormatInvalid.cs:102:22:102:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:102:9:102:37 | call to method WriteLine | this | FormatInvalid.cs:102:9:102:37 | call to method WriteLine | this | +| FormatInvalid.cs:104:44:104:46 | "}" | FormatInvalid.cs:104:44:104:46 | "}" | FormatInvalid.cs:104:44:104:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:51 | call to method WriteLine | this | FormatInvalid.cs:104:9:104:51 | call to method WriteLine | this | +| FormatInvalid.cs:105:45:105:47 | "}" | FormatInvalid.cs:105:45:105:47 | "}" | FormatInvalid.cs:105:45:105:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:51 | call to method TraceError | this | FormatInvalid.cs:105:9:105:51 | call to method TraceError | this | +| FormatInvalid.cs:106:51:106:53 | "}" | FormatInvalid.cs:106:51:106:53 | "}" | FormatInvalid.cs:106:51:106:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:106:9:106:57 | call to method TraceInformation | this | FormatInvalid.cs:106:9:106:57 | call to method TraceInformation | this | +| FormatInvalid.cs:107:47:107:49 | "}" | FormatInvalid.cs:107:47:107:49 | "}" | FormatInvalid.cs:107:47:107:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:53 | call to method TraceWarning | this | FormatInvalid.cs:107:9:107:53 | call to method TraceWarning | this | +| FormatInvalid.cs:108:29:108:31 | "}" | FormatInvalid.cs:108:29:108:31 | "}" | FormatInvalid.cs:108:29:108:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:108:9:108:35 | call to method TraceInformation | this | FormatInvalid.cs:108:9:108:35 | call to method TraceInformation | this | +| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:29 | call to method Write | this | FormatInvalid.cs:110:9:110:29 | call to method Write | this | +| FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:111:9:111:32 | call to method Write | this | FormatInvalid.cs:111:9:111:32 | call to method Write | this | +| FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:112:9:112:35 | call to method Write | this | FormatInvalid.cs:112:9:112:35 | call to method Write | this | +| FormatInvalid.cs:113:23:113:25 | "}" | FormatInvalid.cs:113:23:113:25 | "}" | FormatInvalid.cs:113:23:113:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:113:9:113:38 | call to method Write | this | FormatInvalid.cs:113:9:113:38 | call to method Write | this | +| FormatInvalid.cs:118:56:118:58 | "}" | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:63 | call to method Assert | this | FormatInvalid.cs:118:9:118:63 | call to method Assert | this | +| FormatInvalid.cs:119:18:119:20 | "}" | FormatInvalid.cs:119:18:119:20 | "}" | FormatInvalid.cs:119:18:119:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:24 | call to method Write | this | FormatInvalid.cs:119:9:119:24 | call to method Write | this | +| FormatInvalid.cs:120:40:120:42 | "}" | FormatInvalid.cs:120:40:120:42 | "}" | FormatInvalid.cs:120:40:120:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:120:9:120:47 | call to method Print | this | FormatInvalid.cs:120:9:120:47 | call to method Print | this | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | -| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | -| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:34:14:34 | (...) ... | this supplied value | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:37:14:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:28:9:28:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | -| FormatMissingArgument.cs:28:9:28:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:28:31:28:31 | (...) ... | this supplied value | +| FormatMissingArgument.cs:12:9:12:31 | call to method Format | FormatMissingArgument.cs:12:23:12:27 | "{1}" | FormatMissingArgument.cs:12:23:12:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:12:23:12:27 | "{1}" | this | FormatMissingArgument.cs:12:23:12:27 | "{1}" | this | +| FormatMissingArgument.cs:12:9:12:31 | call to method Format | FormatMissingArgument.cs:12:23:12:27 | "{1}" | FormatMissingArgument.cs:12:23:12:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:12:23:12:27 | "{1}" | format string | FormatMissingArgument.cs:12:30:12:30 | (...) ... | this supplied value | +| FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | +| FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | +| FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:34:15:34 | (...) ... | this supplied value | +| FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:37:15:37 | (...) ... | this supplied value | +| FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | +| FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | format string | FormatMissingArgument.cs:29:31:29:31 | (...) ... | this supplied value | | FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | -| FormatUnusedArgument.cs:11:9:11:29 | call to method Format | FormatUnusedArgument.cs:11:23:11:25 | "X" | FormatUnusedArgument.cs:11:23:11:25 | "X" | The $@ ignores $@. | FormatUnusedArgument.cs:11:23:11:25 | "X" | format string | FormatUnusedArgument.cs:11:28:11:28 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:14:9:14:34 | call to method Format | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | The $@ ignores $@. | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | format string | FormatUnusedArgument.cs:14:33:14:33 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:17:9:17:38 | call to method Format | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | The $@ ignores $@. | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | format string | FormatUnusedArgument.cs:17:37:17:37 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:20:9:20:38 | call to method Format | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | The $@ ignores $@. | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | format string | FormatUnusedArgument.cs:20:34:20:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:34:23:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:37:23:37 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:40:23:40 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:26:9:26:35 | call to method Format | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:26:34:26:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:38:9:38:33 | call to method Format | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | format string | FormatUnusedArgument.cs:38:32:38:32 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:12:9:12:29 | call to method Format | FormatUnusedArgument.cs:12:23:12:25 | "X" | FormatUnusedArgument.cs:12:23:12:25 | "X" | The $@ ignores $@. | FormatUnusedArgument.cs:12:23:12:25 | "X" | format string | FormatUnusedArgument.cs:12:28:12:28 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:15:9:15:34 | call to method Format | FormatUnusedArgument.cs:15:23:15:27 | "{0}" | FormatUnusedArgument.cs:15:23:15:27 | "{0}" | The $@ ignores $@. | FormatUnusedArgument.cs:15:23:15:27 | "{0}" | format string | FormatUnusedArgument.cs:15:33:15:33 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:18:9:18:38 | call to method Format | FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | The $@ ignores $@. | FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | format string | FormatUnusedArgument.cs:18:37:18:37 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:21:9:21:38 | call to method Format | FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | The $@ ignores $@. | FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | format string | FormatUnusedArgument.cs:21:34:21:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:24:9:24:41 | call to method Format | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | format string | FormatUnusedArgument.cs:24:34:24:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:24:9:24:41 | call to method Format | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | format string | FormatUnusedArgument.cs:24:37:24:37 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:24:9:24:41 | call to method Format | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | format string | FormatUnusedArgument.cs:24:40:24:40 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:27:9:27:35 | call to method Format | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:27:34:27:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:39:9:39:33 | call to method Format | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | format string | FormatUnusedArgument.cs:39:32:39:32 | (...) ... | this supplied value | | FormatUnusedArgumentBad.cs:7:9:7:71 | call to method WriteLine | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | format string | FormatUnusedArgumentBad.cs:7:61:7:70 | (...) ... | this supplied value | | FormatUnusedArgumentBad.cs:8:9:8:77 | call to method WriteLine | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | format string | FormatUnusedArgumentBad.cs:8:63:8:64 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | edges -| FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:25:24:25:29 | format : String | provenance | | -| FormatMissingArgument.cs:25:24:25:29 | format : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | +| FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | nodes -| FormatInvalid.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:12:23:12:29 | "{0,1}" | semmle.label | "{0,1}" | -| FormatInvalid.cs:15:23:15:31 | "{0, 1}" | semmle.label | "{0, 1}" | -| FormatInvalid.cs:18:23:18:30 | "{0,-1}" | semmle.label | "{0,-1}" | -| FormatInvalid.cs:21:23:21:33 | "{0:0.000}" | semmle.label | "{0:0.000}" | -| FormatInvalid.cs:24:23:24:39 | "{0, -10 :0.000}" | semmle.label | "{0, -10 :0.000}" | -| FormatInvalid.cs:27:23:27:28 | "{ 0}" | semmle.label | "{ 0}" | -| FormatInvalid.cs:30:23:30:31 | "{0,--1}" | semmle.label | "{0,--1}" | -| FormatInvalid.cs:33:23:33:30 | "{0:{}}" | semmle.label | "{0:{}}" | -| FormatInvalid.cs:36:23:36:26 | "%d" | semmle.label | "%d" | -| FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | -| FormatInvalid.cs:42:23:42:28 | "{0}}" | semmle.label | "{0}}" | -| FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | -| FormatInvalid.cs:48:23:48:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | -| FormatInvalid.cs:51:23:51:28 | "}{0}" | semmle.label | "}{0}" | -| FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | -| FormatInvalid.cs:57:23:57:29 | "{0}{{" | semmle.label | "{0}{{" | -| FormatInvalid.cs:58:23:58:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | -| FormatInvalid.cs:75:23:75:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:10:23:10:27 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:13:23:13:29 | "{0,1}" | semmle.label | "{0,1}" | +| FormatInvalid.cs:16:23:16:31 | "{0, 1}" | semmle.label | "{0, 1}" | +| FormatInvalid.cs:19:23:19:30 | "{0,-1}" | semmle.label | "{0,-1}" | +| FormatInvalid.cs:22:23:22:33 | "{0:0.000}" | semmle.label | "{0:0.000}" | +| FormatInvalid.cs:25:23:25:39 | "{0, -10 :0.000}" | semmle.label | "{0, -10 :0.000}" | +| FormatInvalid.cs:28:23:28:28 | "{ 0}" | semmle.label | "{ 0}" | +| FormatInvalid.cs:31:23:31:31 | "{0,--1}" | semmle.label | "{0,--1}" | +| FormatInvalid.cs:34:23:34:30 | "{0:{}}" | semmle.label | "{0:{}}" | +| FormatInvalid.cs:37:23:37:26 | "%d" | semmle.label | "%d" | +| FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | +| FormatInvalid.cs:43:23:43:28 | "{0}}" | semmle.label | "{0}}" | +| FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | +| FormatInvalid.cs:49:23:49:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | +| FormatInvalid.cs:52:23:52:28 | "}{0}" | semmle.label | "}{0}" | +| FormatInvalid.cs:55:23:55:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | +| FormatInvalid.cs:58:23:58:29 | "{0}{{" | semmle.label | "{0}{{" | +| FormatInvalid.cs:59:23:59:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | | FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:77:23:77:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:78:27:78:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:79:23:79:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:78:23:78:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:79:27:79:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:80:23:80:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:81:23:81:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:83:25:83:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:82:23:82:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:84:25:84:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:85:25:85:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:86:29:86:31 | "}" | semmle.label | "}" | -| FormatInvalid.cs:87:25:87:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:86:25:86:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:87:29:87:31 | "}" | semmle.label | "}" | | FormatInvalid.cs:88:25:88:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:89:25:89:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:91:27:91:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:90:25:90:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:92:27:92:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:93:27:93:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:94:27:94:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:95:27:95:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:97:22:97:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:96:27:96:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:98:22:98:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:99:22:99:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:100:22:100:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:101:22:101:24 | "}" | semmle.label | "}" | -| FormatInvalid.cs:103:44:103:46 | "}" | semmle.label | "}" | -| FormatInvalid.cs:104:45:104:47 | "}" | semmle.label | "}" | -| FormatInvalid.cs:105:51:105:53 | "}" | semmle.label | "}" | -| FormatInvalid.cs:106:47:106:49 | "}" | semmle.label | "}" | -| FormatInvalid.cs:107:29:107:31 | "}" | semmle.label | "}" | -| FormatInvalid.cs:109:23:109:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:102:22:102:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:104:44:104:46 | "}" | semmle.label | "}" | +| FormatInvalid.cs:105:45:105:47 | "}" | semmle.label | "}" | +| FormatInvalid.cs:106:51:106:53 | "}" | semmle.label | "}" | +| FormatInvalid.cs:107:47:107:49 | "}" | semmle.label | "}" | +| FormatInvalid.cs:108:29:108:31 | "}" | semmle.label | "}" | | FormatInvalid.cs:110:23:110:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:111:23:111:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:112:23:112:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | -| FormatInvalid.cs:118:18:118:20 | "}" | semmle.label | "}" | -| FormatInvalid.cs:119:40:119:42 | "}" | semmle.label | "}" | +| FormatInvalid.cs:113:23:113:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | +| FormatInvalid.cs:119:18:119:20 | "}" | semmle.label | "}" | +| FormatInvalid.cs:120:40:120:42 | "}" | semmle.label | "}" | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | | FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | -| FormatMissingArgument.cs:8:23:8:27 | "{0}" | semmle.label | "{0}" | -| FormatMissingArgument.cs:11:23:11:27 | "{1}" | semmle.label | "{1}" | -| FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | semmle.label | "{2} {3}" | -| FormatMissingArgument.cs:17:23:17:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | -| FormatMissingArgument.cs:20:23:20:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | -| FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:25:24:25:29 | format : String | semmle.label | format : String | -| FormatMissingArgument.cs:28:23:28:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | +| FormatMissingArgument.cs:12:23:12:27 | "{1}" | semmle.label | "{1}" | +| FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | semmle.label | "{2} {3}" | +| FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | +| FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | | FormatMissingArgumentGood.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | -| FormatUnusedArgument.cs:8:23:8:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | -| FormatUnusedArgument.cs:11:23:11:25 | "X" | semmle.label | "X" | -| FormatUnusedArgument.cs:14:23:14:27 | "{0}" | semmle.label | "{0}" | -| FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | semmle.label | "{0} {0}" | -| FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | semmle.label | "{1} {1}" | -| FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | semmle.label | "abcdefg" | -| FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | -| FormatUnusedArgument.cs:29:23:29:33 | "{{{0:D}}}" | semmle.label | "{{{0:D}}}" | -| FormatUnusedArgument.cs:32:23:32:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | -| FormatUnusedArgument.cs:35:23:35:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | -| FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | semmle.label | "{{0}}" | -| FormatUnusedArgument.cs:42:23:42:24 | "" | semmle.label | "" | +| FormatUnusedArgument.cs:9:23:9:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatUnusedArgument.cs:12:23:12:25 | "X" | semmle.label | "X" | +| FormatUnusedArgument.cs:15:23:15:27 | "{0}" | semmle.label | "{0}" | +| FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | semmle.label | "{0} {0}" | +| FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | semmle.label | "{1} {1}" | +| FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | semmle.label | "abcdefg" | +| FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | +| FormatUnusedArgument.cs:30:23:30:33 | "{{{0:D}}}" | semmle.label | "{{{0:D}}}" | +| FormatUnusedArgument.cs:33:23:33:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatUnusedArgument.cs:36:23:36:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | semmle.label | "{{0}}" | +| FormatUnusedArgument.cs:43:23:43:24 | "" | semmle.label | "" | | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | semmle.label | "Error processing file: {0}" | | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths +testFailures +| FormatInvalid.cs:140:50:140:59 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:35:53:35:63 | // ... | Missing result: Source | +| FormatMissingArgument.cs:37:57:37:67 | // ... | Missing result: Source | +| FormatMissingArgument.cs:43:51:43:65 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:43:51:43:65 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:49:64:49:78 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:49:64:49:78 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:57:45:57:59 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:57:45:57:59 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:58:53:58:67 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:58:53:58:67 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:64:66:64:80 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:64:66:64:80 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:74:50:74:64 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:74:50:74:64 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:75:58:75:72 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:75:58:75:72 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:81:71:81:85 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:81:71:81:85 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:48:50:48:60 | // ... | Missing result: Source | +| FormatUnusedArgument.cs:49:57:49:67 | // ... | Missing result: Source | +| FormatUnusedArgument.cs:50:57:50:67 | // ... | Missing result: Source | +| FormatUnusedArgument.cs:53:50:53:64 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:53:50:53:64 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:56:64:56:78 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:56:64:56:78 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:59:64:59:78 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:59:64:59:78 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:62:44:62:58 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:62:44:62:58 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:63:52:63:66 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:63:52:63:66 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:66:66:66:80 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:66:66:66:80 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:69:66:69:80 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:69:66:69:80 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:74:49:74:63 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:74:49:74:63 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:75:57:75:71 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:75:57:75:71 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:78:71:78:85 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:78:71:78:85 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:81:71:81:85 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:81:71:81:85 | // ... | Missing result: Sink | diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index fabe7b239e4a..d059e7a5400c 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -1,4 +1,5 @@ using System; +using System.Text; class Class1 { @@ -28,5 +29,59 @@ void helper(string format) String.Format(format, 0); // $ Alert Sink } + void TestCompositeFormatMissingArgument() + { + var format0 = CompositeFormat.Parse("{0}"); + var format1 = CompositeFormat.Parse("{1}"); // $ Source + var format01 = CompositeFormat.Parse("{0}{1}"); + var format23 = CompositeFormat.Parse("{2}{3}"); // $ Source + + // GOOD: All args supplied + String.Format(null, format0, ""); + + // BAD: Missing {1} + String.Format(null, format1, ""); // $ Alert Sink + + // GOOD: All args supplied + String.Format(null, format01, "", ""); + + // BAD: Missing {2} and {3} + String.Format(null, format23, "", ""); // $ Alert Sink + + + // GOOD: All arguments supplied + sb.AppendFormat(null, format0, ""); + sb.AppendFormat(null, format0, ""); + + // BAD: Missing {1} + sb.AppendFormat(null, format1, ""); // $ Alert Sink + sb.AppendFormat(null, format1, ""); // $ Alert Sink + + // GOOD: All args supplied + sb.AppendFormat(null, format01, "", ""); + + // BAD: Missing {2} and {3} + sb.AppendFormat(null, format23, "", ""); // $ Alert Sink + + + var span = new Span(); + + // GOOD: All args supplied + span.TryWrite(null, format0, out _, ""); + span.TryWrite(null, format0, out _, ""); + + // BAD: Missing {1} + span.TryWrite(null, format1, out _, ""); // $ Alert Sink + span.TryWrite(null, format1, out _, ""); // $ Alert Sink + + // GOOD: All args supplied + span.TryWrite(null, format01, out _, "", ""); + + // BAD: Missing {2} and {3} + span.TryWrite(null, format23, out _, "", ""); // $ Alert Sink + } + object[] args; + + StringBuilder sb; } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs index 61f691840870..77ef70338dbc 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs @@ -1,4 +1,5 @@ using System; +using System.Text; class C { @@ -42,5 +43,46 @@ void FormatTests() String.Format("", 1); } + void CompositeFormatTests() + { + var format = CompositeFormat.Parse("X"); // $ Source + var format00 = CompositeFormat.Parse("{0}{0}"); // $ Source + var format11 = CompositeFormat.Parse("{1}{1}"); // $ Source + + // BAD: Unused arg {0} + String.Format(null, format, ""); // $ Alert Sink + + // BAD: Unused arg {1} + String.Format(null, format00, "", ""); // $ Alert Sink + + // BAD: Unused arg {0} + String.Format(null, format11, "", ""); // $ Alert Sink + + // BAD: Unused arg {0} + sb.AppendFormat(null, format, ""); // $ Alert Sink + sb.AppendFormat(null, format, ""); // $ Alert Sink + + // BAD: Unused arg {1} + sb.AppendFormat(null, format00, "", ""); // $ Alert Sink + + // BAD: Unused arg {0} + sb.AppendFormat(null, format11, "", ""); // $ Alert Sink + + var span = new Span(); + + // BAD: Unused arg {0} + span.TryWrite(null, format, out _, ""); // $ Alert Sink + span.TryWrite(null, format, out _, ""); // $ Alert Sink + + // BAD: Unused arg {1} + span.TryWrite(null, format00, out _, "", ""); // $ Alert Sink + + // BAD: Unused arg {0} + span.TryWrite(null, format11, out _, "", ""); // $ Alert Sink + + } + object[] ps; + + StringBuilder sb; } From f31235db437487454f40650be843a987e031a44e Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 8 Apr 2025 16:46:14 +0200 Subject: [PATCH 178/240] C#: Improve format logic to take CompositeFormat and generics into account. --- .../semmle/code/csharp/frameworks/Format.qll | 29 ++++++++- .../semmle/code/csharp/frameworks/System.qll | 14 +++- .../code/csharp/frameworks/system/Text.qll | 15 ++++- csharp/ql/src/API Abuse/FormatInvalid.ql | 64 +++++++++++++++---- 4 files changed, 106 insertions(+), 16 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index db1d4e42d74a..7bccf3e0e6bd 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -14,13 +14,26 @@ abstract class FormatMethod extends Method { * `string.Format(IFormatProvider, String, Object)` is `1`. */ abstract int getFormatArgument(); + + /** + * Gets the argument number of the first supplied insert. + */ + int getFirstArgument() { result = this.getFormatArgument() + 1 } +} + +/** A class of types used for formatting. */ +private class FormatType extends Type { + FormatType() { + this instanceof StringType or + this instanceof SystemTextCompositeFormatClass + } } private class StringAndStringBuilderFormatMethods extends FormatMethod { StringAndStringBuilderFormatMethods() { ( this.getParameter(0).getType() instanceof SystemIFormatProviderInterface and - this.getParameter(1).getType() instanceof StringType + this.getParameter(1).getType() instanceof FormatType or this.getParameter(0).getType() instanceof StringType ) and @@ -38,6 +51,18 @@ private class StringAndStringBuilderFormatMethods extends FormatMethod { } } +private class SystemMemoryExtensionsFormatMethods extends FormatMethod { + SystemMemoryExtensionsFormatMethods() { + this = any(SystemMemoryExtensionsClass c).getTryWriteMethod() and + this.getParameter(1).getType() instanceof SystemIFormatProviderInterface and + this.getParameter(2).getType() instanceof SystemTextCompositeFormatClass + } + + override int getFormatArgument() { result = 2 } + + override int getFirstArgument() { result = this.getFormatArgument() + 2 } +} + private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod { SystemConsoleAndSystemIoTextWriterFormatMethods() { this.getParameter(0).getType() instanceof StringType and @@ -220,7 +245,7 @@ class FormatCall extends MethodCall { int getFormatArgument() { result = this.getTarget().(FormatMethod).getFormatArgument() } /** Gets the argument number of the first supplied insert. */ - int getFirstArgument() { result = this.getFormatArgument() + 1 } + int getFirstArgument() { result = this.getTarget().(FormatMethod).getFirstArgument() } /** Holds if this call has one or more insertions. */ predicate hasInsertions() { exists(this.getArgument(this.getFirstArgument())) } diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/System.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/System.qll index 678563589e8a..2681b9437b69 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/System.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/System.qll @@ -365,7 +365,7 @@ class SystemStringClass extends StringType { /** Gets a `Format(...)` method. */ Method getFormatMethod() { result.getDeclaringType() = this and - result.hasName("Format") and + result.getName().regexpMatch("Format(<.*>)?") and result.getNumberOfParameters() in [2 .. 5] and result.getReturnType() instanceof StringType } @@ -751,6 +751,18 @@ class SystemNotImplementedExceptionClass extends SystemClass { SystemNotImplementedExceptionClass() { this.hasName("NotImplementedException") } } +/** The `System.MemoryExtensions` class. */ +class SystemMemoryExtensionsClass extends SystemClass { + SystemMemoryExtensionsClass() { this.hasName("MemoryExtensions") } + + /** Gets a `TryWrite` method. */ + Method getTryWriteMethod() { + result.getDeclaringType() = this and + result.getName().regexpMatch("TryWrite(<.*>)?") and + result.getParameter(0).getType().getUnboundDeclaration() instanceof SystemSpanStruct + } +} + /** The `System.DateTime` struct. */ class SystemDateTimeStruct extends SystemStruct { SystemDateTimeStruct() { this.hasName("DateTime") } diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/system/Text.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/system/Text.qll index fb4c37489af6..c5d44c7c9add 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/system/Text.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/system/Text.qll @@ -22,7 +22,12 @@ class SystemTextStringBuilderClass extends SystemTextClass { SystemTextStringBuilderClass() { this.hasName("StringBuilder") } /** Gets the `AppendFormat` method. */ - Method getAppendFormatMethod() { result = this.getAMethod("AppendFormat") } + Method getAppendFormatMethod() { + exists(string name | + name.regexpMatch("AppendFormat(<.*>)?") and + result = this.getAMethod(name) + ) + } } /** The `System.Text.Encoding` class. */ @@ -38,3 +43,11 @@ class SystemTextEncodingClass extends SystemTextClass { /** Gets the `GetChars` method. */ Method getGetCharsMethod() { result = this.getAMethod("GetChars") } } + +/** The `System.Text.CompositeFormat` class */ +class SystemTextCompositeFormatClass extends SystemTextClass { + SystemTextCompositeFormatClass() { this.hasName("CompositeFormat") } + + /** Gets the `Parse` method. */ + Method getParseMethod() { result = this.getAMethod("Parse") } +} diff --git a/csharp/ql/src/API Abuse/FormatInvalid.ql b/csharp/ql/src/API Abuse/FormatInvalid.ql index 17923d5bc355..a2b8ef5e2220 100644 --- a/csharp/ql/src/API Abuse/FormatInvalid.ql +++ b/csharp/ql/src/API Abuse/FormatInvalid.ql @@ -11,20 +11,59 @@ */ import csharp +import semmle.code.csharp.frameworks.system.Text import semmle.code.csharp.frameworks.Format -import FormatInvalid::PathGraph +import FormatFlow::PathGraph + +abstract class FormatStringParseCall extends MethodCall { + abstract Expr getFormatExpr(); +} + +class OrdinaryFormatCall extends FormatStringParseCall instanceof FormatCall { + override Expr getFormatExpr() { result = FormatCall.super.getFormatExpr() } +} + +class ParseFormatStringCall extends FormatStringParseCall { + ParseFormatStringCall() { + this.getTarget() = any(SystemTextCompositeFormatClass x).getParseMethod() + } + + override Expr getFormatExpr() { result = this.getArgument(0) } +} module FormatInvalidConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node n) { n.asExpr() instanceof StringLiteral } - predicate isSink(DataFlow::Node n) { exists(FormatCall c | n.asExpr() = c.getFormatExpr()) } + predicate isSink(DataFlow::Node n) { + exists(FormatStringParseCall c | n.asExpr() = c.getFormatExpr()) + } } module FormatInvalid = DataFlow::Global; +module FormatLiteralConfig implements DataFlow::ConfigSig { + predicate isSource(DataFlow::Node n) { n.asExpr() instanceof StringLiteral } + + predicate isAdditionalFlowStep(DataFlow::Node pred, DataFlow::Node succ) { + // Add flow via `System.Text.CompositeFormat.Parse`. + exists(ParseFormatStringCall call | + pred.asExpr() = call.getFormatExpr() and + succ.asExpr() = call + ) + } + + predicate isSink(DataFlow::Node n) { exists(FormatCall c | n.asExpr() = c.getFormatExpr()) } +} + +module FormatLiteral = DataFlow::Global; + +module FormatFlow = + DataFlow::MergePathGraph; + private predicate invalidFormatString( InvalidFormatString src, FormatInvalid::PathNode source, FormatInvalid::PathNode sink, string msg, - FormatCall call, string callString + FormatStringParseCall call, string callString ) { source.getNode().asExpr() = src and sink.getNode().asExpr() = call.getFormatExpr() and @@ -34,13 +73,13 @@ private predicate invalidFormatString( } private predicate unusedArgument( - FormatCall call, FormatInvalid::PathNode source, FormatInvalid::PathNode sink, string msg, + FormatCall call, FormatLiteral::PathNode source, FormatLiteral::PathNode sink, string msg, ValidFormatString src, string srcString, Expr unusedExpr, string unusedString ) { exists(int unused | source.getNode().asExpr() = src and sink.getNode().asExpr() = call.getFormatExpr() and - FormatInvalid::flowPath(source, sink) and + FormatLiteral::flowPath(source, sink) and unused = call.getASuppliedArgument() and not unused = src.getAnInsert() and not src.getValue() = "" and @@ -52,13 +91,13 @@ private predicate unusedArgument( } private predicate missingArgument( - FormatCall call, FormatInvalid::PathNode source, FormatInvalid::PathNode sink, string msg, + FormatCall call, FormatLiteral::PathNode source, FormatLiteral::PathNode sink, string msg, ValidFormatString src, string srcString ) { exists(int used, int supplied | source.getNode().asExpr() = src and sink.getNode().asExpr() = call.getFormatExpr() and - FormatInvalid::flowPath(source, sink) and + FormatLiteral::flowPath(source, sink) and used = src.getAnInsert() and supplied = call.getSuppliedArguments() and used >= supplied and @@ -68,16 +107,17 @@ private predicate missingArgument( } from - Element alert, FormatInvalid::PathNode source, FormatInvalid::PathNode sink, string msg, - Element extra1, string extra1String, Element extra2, string extra2String + Element alert, FormatFlow::PathNode source, FormatFlow::PathNode sink, string msg, Element extra1, + string extra1String, Element extra2, string extra2String where - invalidFormatString(alert, source, sink, msg, extra1, extra1String) and + invalidFormatString(alert, source.asPathNode1(), sink.asPathNode1(), msg, extra1, extra1String) and extra2 = extra1 and extra2String = extra1String or - unusedArgument(alert, source, sink, msg, extra1, extra1String, extra2, extra2String) + unusedArgument(alert, source.asPathNode2(), sink.asPathNode2(), msg, extra1, extra1String, extra2, + extra2String) or - missingArgument(alert, source, sink, msg, extra1, extra1String) and + missingArgument(alert, source.asPathNode2(), sink.asPathNode2(), msg, extra1, extra1String) and extra2 = extra1 and extra2String = extra1String select alert, source, sink, msg, extra1, extra1String, extra2, extra2String From 39abd5c0047cf9219565f200799f76ddb1f6730c Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 14:42:44 +0200 Subject: [PATCH 179/240] C#: Update test expected output. --- .../FormatInvalid/FormatInvalid.expected | 287 +++++++++++++++--- 1 file changed, 242 insertions(+), 45 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 3d23145b406e..ddbdd5c4fb5a 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -43,6 +43,7 @@ | FormatInvalid.cs:118:56:118:58 | "}" | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:63 | call to method Assert | this | FormatInvalid.cs:118:9:118:63 | call to method Assert | this | | FormatInvalid.cs:119:18:119:20 | "}" | FormatInvalid.cs:119:18:119:20 | "}" | FormatInvalid.cs:119:18:119:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:24 | call to method Write | this | FormatInvalid.cs:119:9:119:24 | call to method Write | this | | FormatInvalid.cs:120:40:120:42 | "}" | FormatInvalid.cs:120:40:120:42 | "}" | FormatInvalid.cs:120:40:120:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:120:9:120:47 | call to method Print | this | FormatInvalid.cs:120:9:120:47 | call to method Print | this | +| FormatInvalid.cs:140:44:140:46 | "}" | FormatInvalid.cs:140:44:140:46 | "}" | FormatInvalid.cs:140:44:140:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:140:22:140:47 | call to method Parse | this | FormatInvalid.cs:140:22:140:47 | call to method Parse | this | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | | FormatMissingArgument.cs:12:9:12:31 | call to method Format | FormatMissingArgument.cs:12:23:12:27 | "{1}" | FormatMissingArgument.cs:12:23:12:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:12:23:12:27 | "{1}" | this | FormatMissingArgument.cs:12:23:12:27 | "{1}" | this | | FormatMissingArgument.cs:12:9:12:31 | call to method Format | FormatMissingArgument.cs:12:23:12:27 | "{1}" | FormatMissingArgument.cs:12:23:12:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:12:23:12:27 | "{1}" | format string | FormatMissingArgument.cs:12:30:12:30 | (...) ... | this supplied value | @@ -52,6 +53,28 @@ | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:37:15:37 | (...) ... | this supplied value | | FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | | FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | format string | FormatMissingArgument.cs:29:31:29:31 | (...) ... | this supplied value | +| FormatMissingArgument.cs:43:9:43:48 | call to method Format | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:43:9:43:48 | call to method Format | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:43:46:43:47 | "" | this supplied value | +| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:49:55:49:56 | "" | this supplied value | +| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:49:59:49:60 | "" | this supplied value | +| FormatMissingArgument.cs:57:9:57:42 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:57:9:57:42 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:57:40:57:41 | "" | this supplied value | +| FormatMissingArgument.cs:58:9:58:50 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:58:9:58:50 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:58:48:58:49 | "" | this supplied value | +| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:64:57:64:58 | "" | this supplied value | +| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:64:61:64:62 | "" | this supplied value | +| FormatMissingArgument.cs:74:9:74:47 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:74:9:74:47 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:74:45:74:46 | "" | this supplied value | +| FormatMissingArgument.cs:75:9:75:55 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:75:9:75:55 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:75:53:75:54 | "" | this supplied value | +| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:81:62:81:63 | "" | this supplied value | +| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:81:66:81:67 | "" | this supplied value | | FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | @@ -64,139 +87,313 @@ | FormatUnusedArgument.cs:24:9:24:41 | call to method Format | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | format string | FormatUnusedArgument.cs:24:40:24:40 | (...) ... | this supplied value | | FormatUnusedArgument.cs:27:9:27:35 | call to method Format | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:27:34:27:34 | (...) ... | this supplied value | | FormatUnusedArgument.cs:39:9:39:33 | call to method Format | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | format string | FormatUnusedArgument.cs:39:32:39:32 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:53:9:53:47 | call to method Format | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:53:37:53:42 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:53:45:53:46 | "" | this supplied value | +| FormatUnusedArgument.cs:56:9:56:61 | call to method Format | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | FormatUnusedArgument.cs:56:45:56:52 | access to local variable format00 | The $@ ignores $@. | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" | format string | FormatUnusedArgument.cs:56:59:56:60 | "" | this supplied value | +| FormatUnusedArgument.cs:59:9:59:61 | call to method Format | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | FormatUnusedArgument.cs:59:45:59:52 | access to local variable format11 | The $@ ignores $@. | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" | format string | FormatUnusedArgument.cs:59:55:59:56 | "" | this supplied value | +| FormatUnusedArgument.cs:62:9:62:41 | call to method AppendFormat | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:62:31:62:36 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:62:39:62:40 | "" | this supplied value | +| FormatUnusedArgument.cs:63:9:63:49 | call to method AppendFormat | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:63:39:63:44 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:63:47:63:48 | "" | this supplied value | +| FormatUnusedArgument.cs:66:9:66:63 | call to method AppendFormat | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | FormatUnusedArgument.cs:66:47:66:54 | access to local variable format00 | The $@ ignores $@. | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" | format string | FormatUnusedArgument.cs:66:61:66:62 | "" | this supplied value | +| FormatUnusedArgument.cs:69:9:69:63 | call to method AppendFormat | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | FormatUnusedArgument.cs:69:47:69:54 | access to local variable format11 | The $@ ignores $@. | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" | format string | FormatUnusedArgument.cs:69:57:69:58 | "" | this supplied value | +| FormatUnusedArgument.cs:74:9:74:46 | call to method TryWrite | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:74:29:74:34 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:74:44:74:45 | "" | this supplied value | +| FormatUnusedArgument.cs:75:9:75:54 | call to method TryWrite | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:75:37:75:42 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:75:52:75:53 | "" | this supplied value | +| FormatUnusedArgument.cs:78:9:78:68 | call to method TryWrite | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | FormatUnusedArgument.cs:78:45:78:52 | access to local variable format00 | The $@ ignores $@. | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" | format string | FormatUnusedArgument.cs:78:66:78:67 | "" | this supplied value | +| FormatUnusedArgument.cs:81:9:81:68 | call to method TryWrite | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | FormatUnusedArgument.cs:81:45:81:52 | access to local variable format11 | The $@ ignores $@. | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" | format string | FormatUnusedArgument.cs:81:62:81:63 | "" | this supplied value | | FormatUnusedArgumentBad.cs:7:9:7:71 | call to method WriteLine | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | format string | FormatUnusedArgumentBad.cs:7:61:7:70 | (...) ... | this supplied value | | FormatUnusedArgumentBad.cs:8:9:8:77 | call to method WriteLine | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | format string | FormatUnusedArgumentBad.cs:8:63:8:64 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | edges +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:143:37:143:42 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:144:45:144:50 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:145:53:145:58 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:147:31:147:36 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:148:39:148:44 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:149:47:149:52 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:150:55:150:60 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:154:29:154:34 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:155:37:155:42 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:156:45:156:50 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:157:53:157:58 | access to local variable format | provenance | | +| FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | provenance | | +| FormatInvalid.cs:140:44:140:46 | "}" : String | FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | provenance | Config | | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | +| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | +| FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | | FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:40:37:40:43 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:53:31:53:37 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:54:39:54:45 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:70:29:70:35 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:71:37:71:43 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:34:45:34:49 | "{0}" : String | FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:46:45:46:52 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:61:47:61:54 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:78:45:78:52 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" : String | FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:53:37:53:42 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:62:31:62:36 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:63:39:63:44 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:74:29:74:34 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:75:37:75:42 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:22:48:47 | call to method Parse : CompositeFormat | FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | provenance | | +| FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:48:22:48:47 | call to method Parse : CompositeFormat | provenance | Config | +| FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | FormatUnusedArgument.cs:56:45:56:52 | access to local variable format00 | provenance | | +| FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | FormatUnusedArgument.cs:66:47:66:54 | access to local variable format00 | provenance | | +| FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | FormatUnusedArgument.cs:78:45:78:52 | access to local variable format00 | provenance | | +| FormatUnusedArgument.cs:49:24:49:54 | call to method Parse : CompositeFormat | FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | provenance | | +| FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | FormatUnusedArgument.cs:49:24:49:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | FormatUnusedArgument.cs:59:45:59:52 | access to local variable format11 | provenance | | +| FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | FormatUnusedArgument.cs:69:47:69:54 | access to local variable format11 | provenance | | +| FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | FormatUnusedArgument.cs:81:45:81:52 | access to local variable format11 | provenance | | +| FormatUnusedArgument.cs:50:24:50:54 | call to method Parse : CompositeFormat | FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | provenance | | +| FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | FormatUnusedArgument.cs:50:24:50:54 | call to method Parse : CompositeFormat | provenance | Config | nodes | FormatInvalid.cs:10:23:10:27 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:10:23:10:27 | "{0}" | semmle.label | "{0}" | | FormatInvalid.cs:13:23:13:29 | "{0,1}" | semmle.label | "{0,1}" | +| FormatInvalid.cs:13:23:13:29 | "{0,1}" | semmle.label | "{0,1}" | +| FormatInvalid.cs:16:23:16:31 | "{0, 1}" | semmle.label | "{0, 1}" | | FormatInvalid.cs:16:23:16:31 | "{0, 1}" | semmle.label | "{0, 1}" | | FormatInvalid.cs:19:23:19:30 | "{0,-1}" | semmle.label | "{0,-1}" | +| FormatInvalid.cs:19:23:19:30 | "{0,-1}" | semmle.label | "{0,-1}" | | FormatInvalid.cs:22:23:22:33 | "{0:0.000}" | semmle.label | "{0:0.000}" | +| FormatInvalid.cs:22:23:22:33 | "{0:0.000}" | semmle.label | "{0:0.000}" | +| FormatInvalid.cs:25:23:25:39 | "{0, -10 :0.000}" | semmle.label | "{0, -10 :0.000}" | | FormatInvalid.cs:25:23:25:39 | "{0, -10 :0.000}" | semmle.label | "{0, -10 :0.000}" | | FormatInvalid.cs:28:23:28:28 | "{ 0}" | semmle.label | "{ 0}" | +| FormatInvalid.cs:28:23:28:28 | "{ 0}" | semmle.label | "{ 0}" | | FormatInvalid.cs:31:23:31:31 | "{0,--1}" | semmle.label | "{0,--1}" | +| FormatInvalid.cs:31:23:31:31 | "{0,--1}" | semmle.label | "{0,--1}" | +| FormatInvalid.cs:34:23:34:30 | "{0:{}}" | semmle.label | "{0:{}}" | | FormatInvalid.cs:34:23:34:30 | "{0:{}}" | semmle.label | "{0:{}}" | | FormatInvalid.cs:37:23:37:26 | "%d" | semmle.label | "%d" | +| FormatInvalid.cs:37:23:37:26 | "%d" | semmle.label | "%d" | +| FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | | FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | | FormatInvalid.cs:43:23:43:28 | "{0}}" | semmle.label | "{0}}" | +| FormatInvalid.cs:43:23:43:28 | "{0}}" | semmle.label | "{0}}" | | FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | +| FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | +| FormatInvalid.cs:49:23:49:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | | FormatInvalid.cs:49:23:49:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | | FormatInvalid.cs:52:23:52:28 | "}{0}" | semmle.label | "}{0}" | +| FormatInvalid.cs:52:23:52:28 | "}{0}" | semmle.label | "}{0}" | +| FormatInvalid.cs:55:23:55:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | | FormatInvalid.cs:55:23:55:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | | FormatInvalid.cs:58:23:58:29 | "{0}{{" | semmle.label | "{0}{{" | +| FormatInvalid.cs:58:23:58:29 | "{0}{{" | semmle.label | "{0}{{" | | FormatInvalid.cs:59:23:59:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | +| FormatInvalid.cs:59:23:59:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | +| FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:77:23:77:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:77:23:77:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:78:23:78:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:78:23:78:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:79:27:79:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:79:27:79:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:80:23:80:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:80:23:80:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:81:23:81:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:81:23:81:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:82:23:82:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:82:23:82:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:84:25:84:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:84:25:84:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:85:25:85:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:85:25:85:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:86:25:86:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:86:25:86:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:87:29:87:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:87:29:87:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:88:25:88:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:88:25:88:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:89:25:89:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:89:25:89:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:90:25:90:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:90:25:90:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:92:27:92:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:92:27:92:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:93:27:93:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:93:27:93:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:94:27:94:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:94:27:94:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:95:27:95:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:95:27:95:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:96:27:96:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:96:27:96:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:98:22:98:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:98:22:98:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:99:22:99:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:99:22:99:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:100:22:100:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:100:22:100:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:101:22:101:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:101:22:101:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:102:22:102:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:102:22:102:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:104:44:104:46 | "}" | semmle.label | "}" | +| FormatInvalid.cs:104:44:104:46 | "}" | semmle.label | "}" | | FormatInvalid.cs:105:45:105:47 | "}" | semmle.label | "}" | +| FormatInvalid.cs:105:45:105:47 | "}" | semmle.label | "}" | +| FormatInvalid.cs:106:51:106:53 | "}" | semmle.label | "}" | | FormatInvalid.cs:106:51:106:53 | "}" | semmle.label | "}" | | FormatInvalid.cs:107:47:107:49 | "}" | semmle.label | "}" | +| FormatInvalid.cs:107:47:107:49 | "}" | semmle.label | "}" | | FormatInvalid.cs:108:29:108:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:108:29:108:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:110:23:110:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:110:23:110:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:111:23:111:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:111:23:111:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:112:23:112:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:112:23:112:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:113:23:113:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:113:23:113:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | +| FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | +| FormatInvalid.cs:119:18:119:20 | "}" | semmle.label | "}" | | FormatInvalid.cs:119:18:119:20 | "}" | semmle.label | "}" | | FormatInvalid.cs:120:40:120:42 | "}" | semmle.label | "}" | +| FormatInvalid.cs:120:40:120:42 | "}" | semmle.label | "}" | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | semmle.label | access to local variable format : CompositeFormat | +| FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatInvalid.cs:140:44:140:46 | "}" | semmle.label | "}" | +| FormatInvalid.cs:140:44:140:46 | "}" : String | semmle.label | "}" : String | +| FormatInvalid.cs:143:37:143:42 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:144:45:144:50 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:145:53:145:58 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:147:31:147:36 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:148:39:148:44 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:149:47:149:52 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:150:55:150:60 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:154:29:154:34 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:155:37:155:42 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:156:45:156:50 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:157:53:157:58 | access to local variable format | semmle.label | access to local variable format | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | +| FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | +| FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | | FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | | FormatMissingArgument.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | +| FormatMissingArgument.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | +| FormatMissingArgument.cs:12:23:12:27 | "{1}" | semmle.label | "{1}" | | FormatMissingArgument.cs:12:23:12:27 | "{1}" | semmle.label | "{1}" | | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | semmle.label | "{2} {3}" | +| FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | semmle.label | "{2} {3}" | | FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | | FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | | FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | semmle.label | access to local variable format0 : CompositeFormat | +| FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:34:45:34:49 | "{0}" | semmle.label | "{0}" | +| FormatMissingArgument.cs:34:45:34:49 | "{0}" : String | semmle.label | "{0}" : String | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | semmle.label | access to local variable format1 : CompositeFormat | +| FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:35:45:35:49 | "{1}" | semmle.label | "{1}" | +| FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | semmle.label | access to local variable format01 : CompositeFormat | +| FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" | semmle.label | "{0}{1}" | +| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" : String | semmle.label | "{0}{1}" : String | +| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | semmle.label | access to local variable format23 : CompositeFormat | +| FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | semmle.label | "{2}{3}" | +| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | semmle.label | "{2}{3}" : String | +| FormatMissingArgument.cs:40:37:40:43 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:46:45:46:52 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:53:31:53:37 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:54:39:54:45 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:61:47:61:54 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:70:29:70:35 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:71:37:71:43 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:78:45:78:52 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | semmle.label | access to local variable format23 | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | +| FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | +| FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | | FormatMissingArgumentGood.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | +| FormatMissingArgumentGood.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatUnusedArgument.cs:9:23:9:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatUnusedArgument.cs:9:23:9:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatUnusedArgument.cs:12:23:12:25 | "X" | semmle.label | "X" | | FormatUnusedArgument.cs:12:23:12:25 | "X" | semmle.label | "X" | | FormatUnusedArgument.cs:15:23:15:27 | "{0}" | semmle.label | "{0}" | +| FormatUnusedArgument.cs:15:23:15:27 | "{0}" | semmle.label | "{0}" | | FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | semmle.label | "{0} {0}" | +| FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | semmle.label | "{0} {0}" | +| FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | semmle.label | "{1} {1}" | | FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | semmle.label | "{1} {1}" | | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | semmle.label | "abcdefg" | +| FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | semmle.label | "abcdefg" | +| FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | | FormatUnusedArgument.cs:30:23:30:33 | "{{{0:D}}}" | semmle.label | "{{{0:D}}}" | +| FormatUnusedArgument.cs:30:23:30:33 | "{{{0:D}}}" | semmle.label | "{{{0:D}}}" | | FormatUnusedArgument.cs:33:23:33:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatUnusedArgument.cs:33:23:33:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatUnusedArgument.cs:36:23:36:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | | FormatUnusedArgument.cs:36:23:36:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | semmle.label | "{{0}}" | +| FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | semmle.label | "{{0}}" | +| FormatUnusedArgument.cs:43:23:43:24 | "" | semmle.label | "" | | FormatUnusedArgument.cs:43:23:43:24 | "" | semmle.label | "" | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | semmle.label | access to local variable format : CompositeFormat | +| FormatUnusedArgument.cs:48:22:48:47 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatUnusedArgument.cs:48:44:48:46 | "X" | semmle.label | "X" | +| FormatUnusedArgument.cs:48:44:48:46 | "X" : String | semmle.label | "X" : String | +| FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | semmle.label | access to local variable format00 : CompositeFormat | +| FormatUnusedArgument.cs:49:24:49:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" | semmle.label | "{0}{0}" | +| FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | semmle.label | "{0}{0}" : String | +| FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | semmle.label | access to local variable format11 : CompositeFormat | +| FormatUnusedArgument.cs:50:24:50:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" | semmle.label | "{1}{1}" | +| FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | semmle.label | "{1}{1}" : String | +| FormatUnusedArgument.cs:53:37:53:42 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:56:45:56:52 | access to local variable format00 | semmle.label | access to local variable format00 | +| FormatUnusedArgument.cs:59:45:59:52 | access to local variable format11 | semmle.label | access to local variable format11 | +| FormatUnusedArgument.cs:62:31:62:36 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:63:39:63:44 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:66:47:66:54 | access to local variable format00 | semmle.label | access to local variable format00 | +| FormatUnusedArgument.cs:69:47:69:54 | access to local variable format11 | semmle.label | access to local variable format11 | +| FormatUnusedArgument.cs:74:29:74:34 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:75:37:75:42 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:78:45:78:52 | access to local variable format00 | semmle.label | access to local variable format00 | +| FormatUnusedArgument.cs:81:45:81:52 | access to local variable format11 | semmle.label | access to local variable format11 | +| FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | semmle.label | "Error processing file: {0}" | | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | semmle.label | "Error processing file: {0}" | | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | +| FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | +| FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths -testFailures -| FormatInvalid.cs:140:50:140:59 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:35:53:35:63 | // ... | Missing result: Source | -| FormatMissingArgument.cs:37:57:37:67 | // ... | Missing result: Source | -| FormatMissingArgument.cs:43:51:43:65 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:43:51:43:65 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:49:64:49:78 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:49:64:49:78 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:57:45:57:59 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:57:45:57:59 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:58:53:58:67 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:58:53:58:67 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:64:66:64:80 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:64:66:64:80 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:74:50:74:64 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:74:50:74:64 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:75:58:75:72 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:75:58:75:72 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:81:71:81:85 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:81:71:81:85 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:48:50:48:60 | // ... | Missing result: Source | -| FormatUnusedArgument.cs:49:57:49:67 | // ... | Missing result: Source | -| FormatUnusedArgument.cs:50:57:50:67 | // ... | Missing result: Source | -| FormatUnusedArgument.cs:53:50:53:64 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:53:50:53:64 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:56:64:56:78 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:56:64:56:78 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:59:64:59:78 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:59:64:59:78 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:62:44:62:58 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:62:44:62:58 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:63:52:63:66 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:63:52:63:66 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:66:66:66:80 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:66:66:66:80 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:69:66:69:80 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:69:66:69:80 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:74:49:74:63 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:74:49:74:63 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:75:57:75:71 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:75:57:75:71 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:78:71:78:85 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:78:71:78:85 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:81:71:81:85 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:81:71:81:85 | // ... | Missing result: Sink | From 930bb6b515e43a311fac91c33254d331833dbbd1 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:16:35 +0200 Subject: [PATCH 180/240] C#: Add FP for string.Format using params collection. --- .../FormatInvalid/FormatInvalid.expected | 192 +++++++++--------- .../FormatInvalid/FormatMissingArgument.cs | 3 + 2 files changed, 103 insertions(+), 92 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index ddbdd5c4fb5a..566e47ac0e06 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -51,30 +51,32 @@ | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:34:15:34 | (...) ... | this supplied value | | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:37:15:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | -| FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | format string | FormatMissingArgument.cs:29:31:29:31 | (...) ... | this supplied value | -| FormatMissingArgument.cs:43:9:43:48 | call to method Format | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:43:9:43:48 | call to method Format | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:43:46:43:47 | "" | this supplied value | -| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:49:55:49:56 | "" | this supplied value | -| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:49:59:49:60 | "" | this supplied value | -| FormatMissingArgument.cs:57:9:57:42 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:57:9:57:42 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:57:40:57:41 | "" | this supplied value | -| FormatMissingArgument.cs:58:9:58:50 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:58:9:58:50 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:58:48:58:49 | "" | this supplied value | -| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:64:57:64:58 | "" | this supplied value | -| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:64:61:64:62 | "" | this supplied value | -| FormatMissingArgument.cs:74:9:74:47 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:74:9:74:47 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:74:45:74:46 | "" | this supplied value | -| FormatMissingArgument.cs:75:9:75:55 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:75:9:75:55 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:75:53:75:54 | "" | this supplied value | -| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:81:62:81:63 | "" | this supplied value | -| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:81:66:81:67 | "" | this supplied value | +| FormatMissingArgument.cs:21:9:21:47 | call to method Format | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | +| FormatMissingArgument.cs:21:9:21:47 | call to method Format | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | +| FormatMissingArgument.cs:32:9:32:32 | call to method Format | FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:26:16:26:20 | "{1}" | this | FormatMissingArgument.cs:26:16:26:20 | "{1}" | this | +| FormatMissingArgument.cs:32:9:32:32 | call to method Format | FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:26:16:26:20 | "{1}" | format string | FormatMissingArgument.cs:32:31:32:31 | (...) ... | this supplied value | +| FormatMissingArgument.cs:46:9:46:48 | call to method Format | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:46:9:46:48 | call to method Format | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:46:46:46:47 | "" | this supplied value | +| FormatMissingArgument.cs:52:9:52:61 | call to method Format | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:52:9:52:61 | call to method Format | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:52:9:52:61 | call to method Format | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:52:55:52:56 | "" | this supplied value | +| FormatMissingArgument.cs:52:9:52:61 | call to method Format | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:52:59:52:60 | "" | this supplied value | +| FormatMissingArgument.cs:60:9:60:42 | call to method AppendFormat | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:60:31:60:37 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:60:9:60:42 | call to method AppendFormat | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:60:31:60:37 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:60:40:60:41 | "" | this supplied value | +| FormatMissingArgument.cs:61:9:61:50 | call to method AppendFormat | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:61:39:61:45 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:61:9:61:50 | call to method AppendFormat | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:61:39:61:45 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:61:48:61:49 | "" | this supplied value | +| FormatMissingArgument.cs:67:9:67:63 | call to method AppendFormat | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:67:9:67:63 | call to method AppendFormat | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:67:9:67:63 | call to method AppendFormat | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:67:57:67:58 | "" | this supplied value | +| FormatMissingArgument.cs:67:9:67:63 | call to method AppendFormat | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:67:61:67:62 | "" | this supplied value | +| FormatMissingArgument.cs:77:9:77:47 | call to method TryWrite | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:77:29:77:35 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:77:9:77:47 | call to method TryWrite | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:77:29:77:35 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:77:45:77:46 | "" | this supplied value | +| FormatMissingArgument.cs:78:9:78:55 | call to method TryWrite | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:78:37:78:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:78:9:78:55 | call to method TryWrite | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:78:37:78:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:78:53:78:54 | "" | this supplied value | +| FormatMissingArgument.cs:84:9:84:68 | call to method TryWrite | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:84:9:84:68 | call to method TryWrite | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:84:9:84:68 | call to method TryWrite | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:84:62:84:63 | "" | this supplied value | +| FormatMissingArgument.cs:84:9:84:68 | call to method TryWrite | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:84:66:84:67 | "" | this supplied value | | FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | @@ -116,34 +118,34 @@ edges | FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:157:53:157:58 | access to local variable format | provenance | | | FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | provenance | | | FormatInvalid.cs:140:44:140:46 | "}" : String | FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | provenance | Config | -| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | -| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | -| FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | -| FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:40:37:40:43 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:53:31:53:37 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:54:39:54:45 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:70:29:70:35 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:71:37:71:43 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | provenance | | -| FormatMissingArgument.cs:34:45:34:49 | "{0}" : String | FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | provenance | Config | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | provenance | | -| FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | provenance | Config | -| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:46:45:46:52 | access to local variable format01 | provenance | | -| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:61:47:61:54 | access to local variable format01 | provenance | | -| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:78:45:78:52 | access to local variable format01 | provenance | | -| FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | provenance | | -| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" : String | FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | provenance | Config | -| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | provenance | | -| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | provenance | | -| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | provenance | | -| FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | provenance | | -| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:29:24:29:29 | format : String | provenance | | +| FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:29:24:29:29 | format : String | provenance | | +| FormatMissingArgument.cs:29:24:29:29 | format : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:29:24:29:29 | format : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:43:37:43:43 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:56:31:56:37 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:57:39:57:45 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:73:29:73:35 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:74:37:74:43 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:23:37:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:37:45:37:49 | "{0}" : String | FormatMissingArgument.cs:37:23:37:50 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:60:31:60:37 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:61:39:61:45 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:77:29:77:35 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:78:37:78:43 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:23:38:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:38:23:38:50 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:49:45:49:52 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:64:47:64:54 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:81:45:81:52 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:39:24:39:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:39:46:39:53 | "{0}{1}" : String | FormatMissingArgument.cs:39:24:39:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:40:24:40:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:40:24:40:54 | call to method Parse : CompositeFormat | provenance | Config | | FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:53:37:53:42 | access to local variable format | provenance | | | FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:62:31:62:36 | access to local variable format | provenance | | | FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:63:39:63:44 | access to local variable format | provenance | | @@ -297,46 +299,48 @@ nodes | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | semmle.label | "{2} {3}" | | FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | | FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | -| FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | -| FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | -| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | -| FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | -| FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | -| FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | semmle.label | access to local variable format0 : CompositeFormat | -| FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | -| FormatMissingArgument.cs:34:45:34:49 | "{0}" | semmle.label | "{0}" | -| FormatMissingArgument.cs:34:45:34:49 | "{0}" : String | semmle.label | "{0}" : String | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | semmle.label | access to local variable format1 : CompositeFormat | -| FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | -| FormatMissingArgument.cs:35:45:35:49 | "{1}" | semmle.label | "{1}" | -| FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | semmle.label | access to local variable format01 : CompositeFormat | -| FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | -| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" | semmle.label | "{0}{1}" | -| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" : String | semmle.label | "{0}{1}" : String | -| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | semmle.label | access to local variable format23 : CompositeFormat | -| FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | -| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | semmle.label | "{2}{3}" | -| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | semmle.label | "{2}{3}" : String | -| FormatMissingArgument.cs:40:37:40:43 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:46:45:46:52 | access to local variable format01 | semmle.label | access to local variable format01 | -| FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | semmle.label | access to local variable format23 | -| FormatMissingArgument.cs:53:31:53:37 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:54:39:54:45 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:61:47:61:54 | access to local variable format01 | semmle.label | access to local variable format01 | -| FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | semmle.label | access to local variable format23 | -| FormatMissingArgument.cs:70:29:70:35 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:71:37:71:43 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:78:45:78:52 | access to local variable format01 | semmle.label | access to local variable format01 | -| FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:24:23:24:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatMissingArgument.cs:24:23:24:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:29:24:29:29 | format : String | semmle.label | format : String | +| FormatMissingArgument.cs:29:24:29:29 | format : String | semmle.label | format : String | +| FormatMissingArgument.cs:32:23:32:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:32:23:32:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | semmle.label | access to local variable format0 : CompositeFormat | +| FormatMissingArgument.cs:37:23:37:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:37:45:37:49 | "{0}" | semmle.label | "{0}" | +| FormatMissingArgument.cs:37:45:37:49 | "{0}" : String | semmle.label | "{0}" : String | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | semmle.label | access to local variable format1 : CompositeFormat | +| FormatMissingArgument.cs:38:23:38:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:38:45:38:49 | "{1}" | semmle.label | "{1}" | +| FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | semmle.label | access to local variable format01 : CompositeFormat | +| FormatMissingArgument.cs:39:24:39:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:39:46:39:53 | "{0}{1}" | semmle.label | "{0}{1}" | +| FormatMissingArgument.cs:39:46:39:53 | "{0}{1}" : String | semmle.label | "{0}{1}" : String | +| FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | semmle.label | access to local variable format23 : CompositeFormat | +| FormatMissingArgument.cs:40:24:40:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | semmle.label | "{2}{3}" | +| FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | semmle.label | "{2}{3}" : String | +| FormatMissingArgument.cs:43:37:43:43 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:49:45:49:52 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:56:31:56:37 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:57:39:57:45 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:60:31:60:37 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:61:39:61:45 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:64:47:64:54 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:73:29:73:35 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:74:37:74:43 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:77:29:77:35 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:78:37:78:43 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:81:45:81:52 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | semmle.label | access to local variable format23 | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | @@ -397,3 +401,7 @@ nodes | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths +testFailures +| FormatMissingArgument.cs:21:9:21:47 | FormatMissingArgument.cs:21:23:21:35 | Unexpected result: Alert | +| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Unexpected result: Alert | +| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Unexpected result: Sink | diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index d059e7a5400c..52aabd8cf2bd 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -17,6 +17,9 @@ void TestFormatMissingArgument() // GOOD: An array has been supplied. String.Format("{0} {1} {2}", args); + // GOOD: A collection has been supplied. + String.Format("{0} {1} {2}", [0, 1, 2]); + // GOOD: All arguments supplied to params String.Format("{0} {1} {2} {3}", 0, 1, 2, 3); From 042c7e518639fc62d4e3c48ac4745d00b3ad8c94 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:18:04 +0200 Subject: [PATCH 181/240] C#: Generalize array logic to params collection like types. --- .../semmle/code/csharp/commons/Collections.qll | 3 ++- .../semmle/code/csharp/frameworks/Format.qll | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/commons/Collections.qll b/csharp/ql/lib/semmle/code/csharp/commons/Collections.qll index 7a881981c1c1..b33c0f73d60d 100644 --- a/csharp/ql/lib/semmle/code/csharp/commons/Collections.qll +++ b/csharp/ql/lib/semmle/code/csharp/commons/Collections.qll @@ -97,7 +97,8 @@ private class ParamsConstructedCollectionTypes extends ParamsCollectionTypeImpl unboundbase instanceof SystemCollectionsGenericIReadOnlyListTInterface or unboundbase instanceof SystemSpanStruct or unboundbase instanceof SystemReadOnlySpanStruct - ) + ) and + not this instanceof SystemStringClass } override Type getElementType() { result = base.getTypeArgument(0) } diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index 7bccf3e0e6bd..eb9d52702631 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -250,19 +250,31 @@ class FormatCall extends MethodCall { /** Holds if this call has one or more insertions. */ predicate hasInsertions() { exists(this.getArgument(this.getFirstArgument())) } - /** Holds if the arguments are supplied in an array, not individually. */ - predicate hasArrayExpr() { + /** + * DEPRECATED: use `hasCollectionExpr` instead. + * + * Holds if the arguments are supplied in an array, not individually. + */ + deprecated predicate hasArrayExpr() { this.getNumberOfArguments() = this.getFirstArgument() + 1 and this.getArgument(this.getFirstArgument()).getType() instanceof ArrayType } + /** + * Holds if the arguments are supplied in a collection, not individually. + */ + predicate hasCollectionExpr() { + this.getNumberOfArguments() = this.getFirstArgument() + 1 and + this.getArgument(this.getFirstArgument()).getType() instanceof ParamsCollectionType + } + /** * Gets the number of supplied arguments (excluding the format string and format * provider). Does not return a value if the arguments are supplied in an array, * in which case we generally can't assess the size of the array. */ int getSuppliedArguments() { - not this.hasArrayExpr() and + not this.hasCollectionExpr() and result = this.getNumberOfArguments() - this.getFirstArgument() } From 6de5920172486837c16be70c405e9f4726209597 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:19:08 +0200 Subject: [PATCH 182/240] C#: Update test expected output. --- .../API Abuse/FormatInvalid/FormatInvalid.expected | 6 ------ 1 file changed, 6 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 566e47ac0e06..a33793ae461a 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -51,8 +51,6 @@ | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:34:15:34 | (...) ... | this supplied value | | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:37:15:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:21:9:21:47 | call to method Format | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | -| FormatMissingArgument.cs:21:9:21:47 | call to method Format | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | | FormatMissingArgument.cs:32:9:32:32 | call to method Format | FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:26:16:26:20 | "{1}" | this | FormatMissingArgument.cs:26:16:26:20 | "{1}" | this | | FormatMissingArgument.cs:32:9:32:32 | call to method Format | FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:26:16:26:20 | "{1}" | format string | FormatMissingArgument.cs:32:31:32:31 | (...) ... | this supplied value | | FormatMissingArgument.cs:46:9:46:48 | call to method Format | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | @@ -401,7 +399,3 @@ nodes | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths -testFailures -| FormatMissingArgument.cs:21:9:21:47 | FormatMissingArgument.cs:21:23:21:35 | Unexpected result: Alert | -| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Unexpected result: Alert | -| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Unexpected result: Sink | From f2dddd6d5c6d94e39113339dbf689eef69e32a18 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:23:37 +0200 Subject: [PATCH 183/240] C#: Hide the abstract FormatMethod class. --- .../lib/semmle/code/csharp/frameworks/Format.qll | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index eb9d52702631..cf61a5d75aab 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -8,7 +8,7 @@ private import semmle.code.csharp.frameworks.System private import semmle.code.csharp.frameworks.system.Text /** A method that formats a string, for example `string.Format()`. */ -abstract class FormatMethod extends Method { +abstract private class FormatMethodImpl extends Method { /** * Gets the argument containing the format string. For example, the argument of * `string.Format(IFormatProvider, String, Object)` is `1`. @@ -21,6 +21,8 @@ abstract class FormatMethod extends Method { int getFirstArgument() { result = this.getFormatArgument() + 1 } } +final class FormatMethod = FormatMethodImpl; + /** A class of types used for formatting. */ private class FormatType extends Type { FormatType() { @@ -29,7 +31,7 @@ private class FormatType extends Type { } } -private class StringAndStringBuilderFormatMethods extends FormatMethod { +private class StringAndStringBuilderFormatMethods extends FormatMethodImpl { StringAndStringBuilderFormatMethods() { ( this.getParameter(0).getType() instanceof SystemIFormatProviderInterface and @@ -51,7 +53,7 @@ private class StringAndStringBuilderFormatMethods extends FormatMethod { } } -private class SystemMemoryExtensionsFormatMethods extends FormatMethod { +private class SystemMemoryExtensionsFormatMethods extends FormatMethodImpl { SystemMemoryExtensionsFormatMethods() { this = any(SystemMemoryExtensionsClass c).getTryWriteMethod() and this.getParameter(1).getType() instanceof SystemIFormatProviderInterface and @@ -63,7 +65,7 @@ private class SystemMemoryExtensionsFormatMethods extends FormatMethod { override int getFirstArgument() { result = this.getFormatArgument() + 2 } } -private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod { +private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethodImpl { SystemConsoleAndSystemIoTextWriterFormatMethods() { this.getParameter(0).getType() instanceof StringType and this.getNumberOfParameters() > 1 and @@ -80,7 +82,7 @@ private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMeth override int getFormatArgument() { result = 0 } } -private class SystemDiagnosticsDebugAssert extends FormatMethod { +private class SystemDiagnosticsDebugAssert extends FormatMethodImpl { SystemDiagnosticsDebugAssert() { this.hasName("Assert") and this.getDeclaringType().hasFullyQualifiedName("System.Diagnostics", "Debug") and @@ -90,7 +92,7 @@ private class SystemDiagnosticsDebugAssert extends FormatMethod { override int getFormatArgument() { result = 2 } } -private class SystemDiagnosticsFormatMethods extends FormatMethod { +private class SystemDiagnosticsFormatMethods extends FormatMethodImpl { SystemDiagnosticsFormatMethods() { this.getParameter(0).getType() instanceof StringType and this.getNumberOfParameters() > 1 and From 22ae3e799255a1c27386a28027aaba5a49e43c5b Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:55:46 +0200 Subject: [PATCH 184/240] C#: Update string format item parameter expected test case. --- .../frameworks/format/StringFormatItemParameter.expected | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/csharp/ql/test/library-tests/frameworks/format/StringFormatItemParameter.expected b/csharp/ql/test/library-tests/frameworks/format/StringFormatItemParameter.expected index 692ec0529bb0..dc3017a5f6f2 100644 --- a/csharp/ql/test/library-tests/frameworks/format/StringFormatItemParameter.expected +++ b/csharp/ql/test/library-tests/frameworks/format/StringFormatItemParameter.expected @@ -17,6 +17,12 @@ | Debug | Assert(bool, string, string, params Object[]) | args | | Debug | Print(string, params Object[]) | args | | Debug | WriteLine(string, params Object[]) | args | +| MemoryExtensions | TryWrite(Span, IFormatProvider, CompositeFormat, out int, params Object[]) | args | +| MemoryExtensions | TryWrite(Span, IFormatProvider, CompositeFormat, out int, params Object[]) | charsWritten | +| MemoryExtensions | TryWrite(Span, IFormatProvider, CompositeFormat, out int, params ReadOnlySpan) | args | +| MemoryExtensions | TryWrite(Span, IFormatProvider, CompositeFormat, out int, params ReadOnlySpan) | charsWritten | +| StringBuilder | AppendFormat(IFormatProvider, CompositeFormat, params Object[]) | args | +| StringBuilder | AppendFormat(IFormatProvider, CompositeFormat, params ReadOnlySpan) | args | | StringBuilder | AppendFormat(IFormatProvider, string, object) | arg0 | | StringBuilder | AppendFormat(IFormatProvider, string, object, object) | arg0 | | StringBuilder | AppendFormat(IFormatProvider, string, object, object) | arg1 | @@ -51,6 +57,8 @@ | TextWriter | WriteLine(string, object, object, object) | arg2 | | TextWriter | WriteLine(string, params Object[]) | arg | | TextWriter | WriteLine(string, params ReadOnlySpan) | arg | +| string | Format(IFormatProvider, CompositeFormat, params Object[]) | args | +| string | Format(IFormatProvider, CompositeFormat, params ReadOnlySpan) | args | | string | Format(IFormatProvider, string, object) | arg0 | | string | Format(IFormatProvider, string, object, object) | arg0 | | string | Format(IFormatProvider, string, object, object) | arg1 | From b6d2f14b9b191e73e52a670118ebcc946759d430 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Thu, 10 Apr 2025 08:47:41 +0200 Subject: [PATCH 185/240] C#: Add change note. --- .../ql/src/change-notes/2025-04-10-invalid-string-format.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md diff --git a/csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md b/csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md new file mode 100644 index 000000000000..1d1d424d985f --- /dev/null +++ b/csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The precision of the query `cs/invalid-string-formatting` has been improved. More methods and more overloads of existing format like methods are taken into account by the query. From dcf11c2d4b6d4d34bd269e8ca4a63c752ae699cc Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 23 Apr 2025 11:42:45 +0200 Subject: [PATCH 186/240] C#: Match up sources, alerts and sinks in the tests. --- .../FormatInvalid/FormatMissingArgument.cs | 24 +++++++-------- .../FormatInvalid/FormatUnusedArgument.cs | 29 +++++++++---------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index 52aabd8cf2bd..8460a4565750 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -23,33 +23,33 @@ void TestFormatMissingArgument() // GOOD: All arguments supplied to params String.Format("{0} {1} {2} {3}", 0, 1, 2, 3); - helper("{1}"); // $ Source + helper("{1}"); // $ Source=source1 } void helper(string format) { // BAD: Missing {1} - String.Format(format, 0); // $ Alert Sink + String.Format(format, 0); // $ Alert=source1 Sink=source1 } void TestCompositeFormatMissingArgument() { var format0 = CompositeFormat.Parse("{0}"); - var format1 = CompositeFormat.Parse("{1}"); // $ Source + var format1 = CompositeFormat.Parse("{1}"); // $ Source=source2 var format01 = CompositeFormat.Parse("{0}{1}"); - var format23 = CompositeFormat.Parse("{2}{3}"); // $ Source + var format23 = CompositeFormat.Parse("{2}{3}"); // $ Source=source3 // GOOD: All args supplied String.Format(null, format0, ""); // BAD: Missing {1} - String.Format(null, format1, ""); // $ Alert Sink + String.Format(null, format1, ""); // $ Alert=source2 Sink=source2 // GOOD: All args supplied String.Format(null, format01, "", ""); // BAD: Missing {2} and {3} - String.Format(null, format23, "", ""); // $ Alert Sink + String.Format(null, format23, "", ""); // $ Alert=source3 Sink=source3 // GOOD: All arguments supplied @@ -57,14 +57,14 @@ void TestCompositeFormatMissingArgument() sb.AppendFormat(null, format0, ""); // BAD: Missing {1} - sb.AppendFormat(null, format1, ""); // $ Alert Sink - sb.AppendFormat(null, format1, ""); // $ Alert Sink + sb.AppendFormat(null, format1, ""); // $ Alert=source2 Sink=source2 + sb.AppendFormat(null, format1, ""); // $ Alert=source2 Sink=source2 // GOOD: All args supplied sb.AppendFormat(null, format01, "", ""); // BAD: Missing {2} and {3} - sb.AppendFormat(null, format23, "", ""); // $ Alert Sink + sb.AppendFormat(null, format23, "", ""); // $ Alert=source3 Sink=source3 var span = new Span(); @@ -74,14 +74,14 @@ void TestCompositeFormatMissingArgument() span.TryWrite(null, format0, out _, ""); // BAD: Missing {1} - span.TryWrite(null, format1, out _, ""); // $ Alert Sink - span.TryWrite(null, format1, out _, ""); // $ Alert Sink + span.TryWrite(null, format1, out _, ""); // $ Alert=source2 Sink=source2 + span.TryWrite(null, format1, out _, ""); // $ Alert=source2 Sink=source2 // GOOD: All args supplied span.TryWrite(null, format01, out _, "", ""); // BAD: Missing {2} and {3} - span.TryWrite(null, format23, out _, "", ""); // $ Alert Sink + span.TryWrite(null, format23, out _, "", ""); // $ Alert=source3 Sink=source3 } object[] args; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs index 77ef70338dbc..e1c7aa6bf156 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs @@ -45,41 +45,40 @@ void FormatTests() void CompositeFormatTests() { - var format = CompositeFormat.Parse("X"); // $ Source - var format00 = CompositeFormat.Parse("{0}{0}"); // $ Source - var format11 = CompositeFormat.Parse("{1}{1}"); // $ Source + var format = CompositeFormat.Parse("X"); // $ Source=source4 + var format00 = CompositeFormat.Parse("{0}{0}"); // $ Source=source5 + var format11 = CompositeFormat.Parse("{1}{1}"); // $ Source=source6 // BAD: Unused arg {0} - String.Format(null, format, ""); // $ Alert Sink + String.Format(null, format, ""); // $ Alert=source4 Sink=source4 // BAD: Unused arg {1} - String.Format(null, format00, "", ""); // $ Alert Sink + String.Format(null, format00, "", ""); // $ Alert=source5 Sink=source5 // BAD: Unused arg {0} - String.Format(null, format11, "", ""); // $ Alert Sink + String.Format(null, format11, "", ""); // $ Alert=source6 Sink=source6 // BAD: Unused arg {0} - sb.AppendFormat(null, format, ""); // $ Alert Sink - sb.AppendFormat(null, format, ""); // $ Alert Sink + sb.AppendFormat(null, format, ""); // $ Alert=source4 Sink=source4 + sb.AppendFormat(null, format, ""); // $ Alert=source4 Sink=source4 // BAD: Unused arg {1} - sb.AppendFormat(null, format00, "", ""); // $ Alert Sink + sb.AppendFormat(null, format00, "", ""); // $ Alert=source5 Sink=source5 // BAD: Unused arg {0} - sb.AppendFormat(null, format11, "", ""); // $ Alert Sink + sb.AppendFormat(null, format11, "", ""); // $ Alert=source6 Sink=source6 var span = new Span(); // BAD: Unused arg {0} - span.TryWrite(null, format, out _, ""); // $ Alert Sink - span.TryWrite(null, format, out _, ""); // $ Alert Sink + span.TryWrite(null, format, out _, ""); // $ Alert=source4 Sink=source4 + span.TryWrite(null, format, out _, ""); // $ Alert=source4 Sink=source4 // BAD: Unused arg {1} - span.TryWrite(null, format00, out _, "", ""); // $ Alert Sink + span.TryWrite(null, format00, out _, "", ""); // $ Alert=source5 Sink=source5 // BAD: Unused arg {0} - span.TryWrite(null, format11, out _, "", ""); // $ Alert Sink - + span.TryWrite(null, format11, out _, "", ""); // $ Alert=source6 Sink=source6 } object[] ps; From 65ac951964a4c7d678ab2e1bd882fdfb9812a5d8 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 23 Apr 2025 12:59:29 +0200 Subject: [PATCH 187/240] C#: Remove all Sink tags after rebase. --- .../API Abuse/FormatInvalid/FormatInvalid.cs | 2 +- .../FormatInvalid/FormatMissingArgument.cs | 22 ++++++------ .../FormatInvalid/FormatMissingArgumentBad.cs | 4 +-- .../FormatInvalid/FormatUnusedArgument.cs | 36 +++++++++---------- .../FormatInvalid/FormatUnusedArgumentBad.cs | 6 ++-- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs index 2690ec50890a..75fc5e4ec236 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs @@ -34,7 +34,7 @@ void FormatStringTests() String.Format("{0:{}}", 1); // $ Alert // BAD: Invalid format string - String.Format("%d", 1); // $ Alert Sink + String.Format("%d", 1); // $ Alert // BAD: } { in the middle. String.Format("{{0}-{1}}", 0, 1); // $ Alert diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index 8460a4565750..b5ff280d86df 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -9,10 +9,10 @@ void TestFormatMissingArgument() String.Format("{0}", 0); // BAD: Missing {1} - String.Format("{1}", 0); // $ Alert Sink + String.Format("{1}", 0); // $ Alert // BAD: Missing {2} and {3} - String.Format("{2} {3}", 0, 1); // $ Alert Sink + String.Format("{2} {3}", 0, 1); // $ Alert // GOOD: An array has been supplied. String.Format("{0} {1} {2}", args); @@ -29,7 +29,7 @@ void TestFormatMissingArgument() void helper(string format) { // BAD: Missing {1} - String.Format(format, 0); // $ Alert=source1 Sink=source1 + String.Format(format, 0); // $ Alert=source1 } void TestCompositeFormatMissingArgument() @@ -43,13 +43,13 @@ void TestCompositeFormatMissingArgument() String.Format(null, format0, ""); // BAD: Missing {1} - String.Format(null, format1, ""); // $ Alert=source2 Sink=source2 + String.Format(null, format1, ""); // $ Alert=source2 // GOOD: All args supplied String.Format(null, format01, "", ""); // BAD: Missing {2} and {3} - String.Format(null, format23, "", ""); // $ Alert=source3 Sink=source3 + String.Format(null, format23, "", ""); // $ Alert=source3 // GOOD: All arguments supplied @@ -57,14 +57,14 @@ void TestCompositeFormatMissingArgument() sb.AppendFormat(null, format0, ""); // BAD: Missing {1} - sb.AppendFormat(null, format1, ""); // $ Alert=source2 Sink=source2 - sb.AppendFormat(null, format1, ""); // $ Alert=source2 Sink=source2 + sb.AppendFormat(null, format1, ""); // $ Alert=source2 + sb.AppendFormat(null, format1, ""); // $ Alert=source2 // GOOD: All args supplied sb.AppendFormat(null, format01, "", ""); // BAD: Missing {2} and {3} - sb.AppendFormat(null, format23, "", ""); // $ Alert=source3 Sink=source3 + sb.AppendFormat(null, format23, "", ""); // $ Alert=source3 var span = new Span(); @@ -74,14 +74,14 @@ void TestCompositeFormatMissingArgument() span.TryWrite(null, format0, out _, ""); // BAD: Missing {1} - span.TryWrite(null, format1, out _, ""); // $ Alert=source2 Sink=source2 - span.TryWrite(null, format1, out _, ""); // $ Alert=source2 Sink=source2 + span.TryWrite(null, format1, out _, ""); // $ Alert=source2 + span.TryWrite(null, format1, out _, ""); // $ Alert=source2 // GOOD: All args supplied span.TryWrite(null, format01, out _, "", ""); // BAD: Missing {2} and {3} - span.TryWrite(null, format23, out _, "", ""); // $ Alert=source3 Sink=source3 + span.TryWrite(null, format23, out _, "", ""); // $ Alert=source3 } object[] args; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs index a3614a881b9a..74c2ffd627a0 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs @@ -4,7 +4,7 @@ class Bad3 { void Hello(string first, string last) { - Console.WriteLine("Hello {0} {1}", first); // $ Alert Sink - Console.WriteLine("Hello {1} {2}", first, last); // $ Alert Sink + Console.WriteLine("Hello {0} {1}", first); // $ Alert + Console.WriteLine("Hello {1} {2}", first, last); // $ Alert } } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs index e1c7aa6bf156..c064025ed686 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs @@ -9,22 +9,22 @@ void FormatTests() String.Format("{0} {1} {2}", 0, 1, 2); // BAD: Missing arg {0} - String.Format("X", 1); // $ Alert Sink + String.Format("X", 1); // $ Alert // BAD: Missing {1} - String.Format("{0}", 1, 2); // $ Alert Sink + String.Format("{0}", 1, 2); // $ Alert // BAD: Missing {1} - String.Format("{0} {0}", 1, 2); // $ Alert Sink + String.Format("{0} {0}", 1, 2); // $ Alert // BAD: Missing {0} - String.Format("{1} {1}", 1, 2); // $ Alert Sink + String.Format("{1} {1}", 1, 2); // $ Alert // BAD: Missing {0}, {1} and {2} - String.Format("abcdefg", 0, 1, 2); // $ Alert Sink + String.Format("abcdefg", 0, 1, 2); // $ Alert // BAD: {0} is unused - String.Format("{{sdc}}", 0); // $ Alert Sink + String.Format("{{sdc}}", 0); // $ Alert // GOOD: {0} is used String.Format("{{{0:D}}}", 0); @@ -36,7 +36,7 @@ void FormatTests() String.Format("{0} {1} {2}", ps); // BAD: Would display "{0}" - String.Format("{{0}}", 1); // $ Alert Sink + String.Format("{{0}}", 1); // $ Alert // GOOD: Ignore the empty string as it's often used as the default value // of GetResource(). @@ -50,35 +50,35 @@ void CompositeFormatTests() var format11 = CompositeFormat.Parse("{1}{1}"); // $ Source=source6 // BAD: Unused arg {0} - String.Format(null, format, ""); // $ Alert=source4 Sink=source4 + String.Format(null, format, ""); // $ Alert=source4 // BAD: Unused arg {1} - String.Format(null, format00, "", ""); // $ Alert=source5 Sink=source5 + String.Format(null, format00, "", ""); // $ Alert=source5 // BAD: Unused arg {0} - String.Format(null, format11, "", ""); // $ Alert=source6 Sink=source6 + String.Format(null, format11, "", ""); // $ Alert=source6 // BAD: Unused arg {0} - sb.AppendFormat(null, format, ""); // $ Alert=source4 Sink=source4 - sb.AppendFormat(null, format, ""); // $ Alert=source4 Sink=source4 + sb.AppendFormat(null, format, ""); // $ Alert=source4 + sb.AppendFormat(null, format, ""); // $ Alert=source4 // BAD: Unused arg {1} - sb.AppendFormat(null, format00, "", ""); // $ Alert=source5 Sink=source5 + sb.AppendFormat(null, format00, "", ""); // $ Alert=source5 // BAD: Unused arg {0} - sb.AppendFormat(null, format11, "", ""); // $ Alert=source6 Sink=source6 + sb.AppendFormat(null, format11, "", ""); // $ Alert=source6 var span = new Span(); // BAD: Unused arg {0} - span.TryWrite(null, format, out _, ""); // $ Alert=source4 Sink=source4 - span.TryWrite(null, format, out _, ""); // $ Alert=source4 Sink=source4 + span.TryWrite(null, format, out _, ""); // $ Alert=source4 + span.TryWrite(null, format, out _, ""); // $ Alert=source4 // BAD: Unused arg {1} - span.TryWrite(null, format00, out _, "", ""); // $ Alert=source5 Sink=source5 + span.TryWrite(null, format00, out _, "", ""); // $ Alert=source5 // BAD: Unused arg {0} - span.TryWrite(null, format11, out _, "", ""); // $ Alert=source6 Sink=source6 + span.TryWrite(null, format11, out _, "", ""); // $ Alert=source6 } object[] ps; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs index 5a951efa4320..969c2b86e9f6 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs @@ -4,8 +4,8 @@ class Bad2 { void M(Exception ex) { - Console.WriteLine("Error processing file: {0}", ex, ex.HResult); // $ Alert Sink - Console.WriteLine("Error processing file: {1} ({1})", ex, ex.HResult); // $ Alert Sink - Console.WriteLine("Error processing file: %s (%d)", ex, ex.HResult); // $ Alert Sink + Console.WriteLine("Error processing file: {0}", ex, ex.HResult); // $ Alert + Console.WriteLine("Error processing file: {1} ({1})", ex, ex.HResult); // $ Alert + Console.WriteLine("Error processing file: %s (%d)", ex, ex.HResult); // $ Alert } } From 46b21af3ef7fea4a15991aadc790f9c404113d3e Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 24 Apr 2025 10:58:02 +0200 Subject: [PATCH 188/240] Dataflow: Make default field flow branch limit configurable per language --- shared/dataflow/codeql/dataflow/DataFlow.qll | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shared/dataflow/codeql/dataflow/DataFlow.qll b/shared/dataflow/codeql/dataflow/DataFlow.qll index 0d78d13c8848..93327f5ad6a3 100644 --- a/shared/dataflow/codeql/dataflow/DataFlow.qll +++ b/shared/dataflow/codeql/dataflow/DataFlow.qll @@ -342,6 +342,9 @@ signature module InputSig { any() } + /** Gets the default value for the `fieldFlowBranchLimit` */ + default int defaultFieldFlowBranchLimit() { result = 2 } + /** Holds if `fieldFlowBranchLimit` should be ignored for flow going into/out of `c`. */ default predicate ignoreFieldFlowBranchLimit(DataFlowCallable c) { none() } } @@ -399,7 +402,7 @@ module Configs Lang> { * This can be overridden to a smaller value to improve performance (a * value of 0 disables field flow), or a larger value to get more results. */ - default int fieldFlowBranchLimit() { result = 2 } + default int fieldFlowBranchLimit() { result = Lang::defaultFieldFlowBranchLimit() } /** Gets the access path limit. */ default int accessPathLimit() { result = Lang::accessPathLimit() } @@ -548,7 +551,7 @@ module Configs Lang> { * This can be overridden to a smaller value to improve performance (a * value of 0 disables field flow), or a larger value to get more results. */ - default int fieldFlowBranchLimit() { result = 2 } + default int fieldFlowBranchLimit() { result = Lang::defaultFieldFlowBranchLimit() } /** Gets the access path limit. */ default int accessPathLimit() { result = Lang::accessPathLimit() } From 0357f3959b61cc806905741500a7725161963ae0 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 24 Apr 2025 11:28:09 +0200 Subject: [PATCH 189/240] Update list of supported platforms I've effectively sync'ed this with the list of runners that are publicly available. I did not yet add Windows 2025, as it is my understanding is that we haven't really done any testing on that yet. --- docs/codeql/reusables/supported-platforms.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/codeql/reusables/supported-platforms.rst b/docs/codeql/reusables/supported-platforms.rst index 78a8215bffcb..216e4c6a7c2a 100644 --- a/docs/codeql/reusables/supported-platforms.rst +++ b/docs/codeql/reusables/supported-platforms.rst @@ -4,17 +4,17 @@ :stub-columns: 1 Operating system,Supported versions,Supported CPU architectures - Linux,"Ubuntu 20.04 + Linux,"Ubuntu 22.04 - Ubuntu 21.04 - - Ubuntu 22.04","x86-64" + Ubuntu 24.04","x86-64" Windows,"Windows 10 / Windows Server 2019 Windows 11 / Windows Server 2022","x86-64" macOS,"macOS 13 Ventura - macOS 14 Sonoma","x86-64, arm64 (Apple Silicon) [1]_" + macOS 14 Sonoma + + macOS 15 Sequoia","x86-64, arm64 (Apple Silicon) [1]_" .. container:: footnote-group From 42c4252a3d1f7db54b6626e479b517fb691fe805 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 24 Apr 2025 11:35:53 +0200 Subject: [PATCH 190/240] C++: Claim beta support for C23 and C++23 All features we can support, we currently do support. --- .../supported-versions-compilers.rst | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/codeql/reusables/supported-versions-compilers.rst b/docs/codeql/reusables/supported-versions-compilers.rst index bbefaf79ccef..bb2d4a7416a9 100644 --- a/docs/codeql/reusables/supported-versions-compilers.rst +++ b/docs/codeql/reusables/supported-versions-compilers.rst @@ -4,13 +4,13 @@ :stub-columns: 1 Language,Variants,Compilers,Extensions - C/C++,"C89, C99, C11, C17, C++98, C++03, C++11, C++14, C++17, C++20 [1]_ [2]_","Clang (including clang-cl [3]_ and armclang) extensions (up to Clang 17.0), + C/C++,"C89, C99, C11, C17, C23, C++98, C++03, C++11, C++14, C++17, C++20, C++23 [1]_ [2]_ [3]_","Clang (including clang-cl [4]_ and armclang) extensions (up to Clang 17.0), GNU extensions (up to GCC 13.2), Microsoft extensions (up to VS 2022), - Arm Compiler 5 [4]_","``.cpp``, ``.c++``, ``.cxx``, ``.hpp``, ``.hh``, ``.h++``, ``.hxx``, ``.c``, ``.cc``, ``.h``" + Arm Compiler 5 [5]_","``.cpp``, ``.c++``, ``.cxx``, ``.hpp``, ``.hh``, ``.h++``, ``.hxx``, ``.c``, ``.cc``, ``.h``" C#,C# up to 13,"Microsoft Visual Studio up to 2019 with .NET up to 4.8, .NET Core up to 3.1 @@ -18,26 +18,27 @@ .NET 5, .NET 6, .NET 7, .NET 8, .NET 9","``.sln``, ``.csproj``, ``.cs``, ``.cshtml``, ``.xaml``" GitHub Actions,"Not applicable",Not applicable,"``.github/workflows/*.yml``, ``.github/workflows/*.yaml``, ``**/action.yml``, ``**/action.yaml``" Go (aka Golang), "Go up to 1.24", "Go 1.11 or more recent", ``.go`` - Java,"Java 7 to 24 [5]_","javac (OpenJDK and Oracle JDK), + Java,"Java 7 to 24 [6]_","javac (OpenJDK and Oracle JDK), - Eclipse compiler for Java (ECJ) [6]_",``.java`` + Eclipse compiler for Java (ECJ) [7]_",``.java`` Kotlin,"Kotlin 1.5.0 to 2.1.2\ *x*","kotlinc",``.kt`` - JavaScript,ECMAScript 2022 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhtm``, ``.xhtml``, ``.vue``, ``.hbs``, ``.ejs``, ``.njk``, ``.json``, ``.yaml``, ``.yml``, ``.raml``, ``.xml`` [7]_" - Python [8]_,"2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13",Not applicable,``.py`` - Ruby [9]_,"up to 3.3",Not applicable,"``.rb``, ``.erb``, ``.gemspec``, ``Gemfile``" - Swift [10]_,"Swift 5.4-6.0","Swift compiler","``.swift``" - TypeScript [11]_,"2.6-5.8",Standard TypeScript compiler,"``.ts``, ``.tsx``, ``.mts``, ``.cts``" + JavaScript,ECMAScript 2022 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhtm``, ``.xhtml``, ``.vue``, ``.hbs``, ``.ejs``, ``.njk``, ``.json``, ``.yaml``, ``.yml``, ``.raml``, ``.xml`` [8]_" + Python [9]_,"2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13",Not applicable,``.py`` + Ruby [10]_,"up to 3.3",Not applicable,"``.rb``, ``.erb``, ``.gemspec``, ``Gemfile``" + Swift [11]_,"Swift 5.4-6.0","Swift compiler","``.swift``" + TypeScript [12]_,"2.6-5.8",Standard TypeScript compiler,"``.ts``, ``.tsx``, ``.mts``, ``.cts``" .. container:: footnote-group .. [1] C++20 modules are *not* supported. - .. [2] Objective-C, Objective-C++, C++/CLI, and C++/CX are not supported. - .. [3] Support for the clang-cl compiler is preliminary. - .. [4] Support for the Arm Compiler (armcc) is preliminary. - .. [5] Builds that execute on Java 7 to 24 can be analyzed. The analysis understands standard language features in Java 8 to 24; "preview" and "incubator" features are not supported. Source code using Java language versions older than Java 8 are analyzed as Java 8 code. - .. [6] ECJ is supported when the build invokes it via the Maven Compiler plugin or the Takari Lifecycle plugin. - .. [7] JSX and Flow code, YAML, JSON, HTML, and XML files may also be analyzed with JavaScript files. - .. [8] The extractor requires Python 3 to run. To analyze Python 2.7 you should install both versions of Python. - .. [9] Requires glibc 2.17. - .. [10] Support for the analysis of Swift requires macOS. - .. [11] TypeScript analysis is performed by running the JavaScript extractor with TypeScript enabled. This is the default. + .. [2] C23 and C++23 support is currently in beta. + .. [3] Objective-C, Objective-C++, C++/CLI, and C++/CX are not supported. + .. [4] Support for the clang-cl compiler is preliminary. + .. [5] Support for the Arm Compiler (armcc) is preliminary. + .. [6] Builds that execute on Java 7 to 24 can be analyzed. The analysis understands standard language features in Java 8 to 24; "preview" and "incubator" features are not supported. Source code using Java language versions older than Java 8 are analyzed as Java 8 code. + .. [7] ECJ is supported when the build invokes it via the Maven Compiler plugin or the Takari Lifecycle plugin. + .. [8] JSX and Flow code, YAML, JSON, HTML, and XML files may also be analyzed with JavaScript files. + .. [9] The extractor requires Python 3 to run. To analyze Python 2.7 you should install both versions of Python. + .. [10] Requires glibc 2.17. + .. [11] Support for the analysis of Swift requires macOS. + .. [12] TypeScript analysis is performed by running the JavaScript extractor with TypeScript enabled. This is the default. From 063bff073be875a9cc907b773d4b6a7cbea90648 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 24 Apr 2025 12:15:31 +0100 Subject: [PATCH 191/240] C++: Add checks for build mode in various queries Adds a check for the absence of build-mode-none in cpp/wrong-type-format-argument cpp/comparison-with-wider-type cpp/integer-multiplication-cast-to-long cpp/implicit-function-declaration cpp/suspicious-add-sizeof --- cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql | 1 + cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql | 1 + .../Underspecified Functions/ImplicitFunctionDeclaration.ql | 1 + cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql | 1 + cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql | 1 + 5 files changed, 5 insertions(+) diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql b/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql index ba7a6b58aa01..7eb465d35a92 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql @@ -179,6 +179,7 @@ predicate overflows(MulExpr me, Type t) { from MulExpr me, Type t1, Type t2 where + not any(Compilation c).buildModeNone() and t1 = me.getType().getUnderlyingType() and t2 = me.getConversion().getType().getUnderlyingType() and t1.getSize() < t2.getSize() and diff --git a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql index 75fe855c6f91..02975d2bdcab 100644 --- a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql +++ b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql @@ -154,6 +154,7 @@ int sizeof_IntType() { exists(IntType it | result = it.getSize()) } from FormattingFunctionCall ffc, int n, Expr arg, Type expected, Type actual where + not any(Compilation c).buildModeNone() and ( formattingFunctionCallExpectedType(ffc, n, expected) and formattingFunctionCallActualType(ffc, n, arg, actual) and diff --git a/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql b/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql index a361a3401f36..aa9d5d43c738 100644 --- a/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql +++ b/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql @@ -38,6 +38,7 @@ predicate isCompiledAsC(File f) { from FunctionDeclarationEntry fdeIm, FunctionCall fc where + not any(Compilation c).buildModeNone() and isCompiledAsC(fdeIm.getFile()) and not isFromMacroDefinition(fc) and fdeIm.isImplicit() and diff --git a/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql b/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql index 7d9ef88adea1..021be5d091b3 100644 --- a/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql +++ b/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql @@ -51,6 +51,7 @@ int getComparisonSizeAdjustment(Expr e) { from Loop l, RelationalOperation rel, VariableAccess small, Expr large where + not any(Compilation c).buildModeNone() and small = rel.getLesserOperand() and large = rel.getGreaterOperand() and rel = l.getCondition().getAChild*() and diff --git a/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql b/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql index 4ac00fc42c6d..11b7779118fc 100644 --- a/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql +++ b/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql @@ -24,6 +24,7 @@ private predicate isCharSzPtrExpr(Expr e) { from Expr sizeofExpr, Expr e where + not any(Compilation c).buildModeNone() and // If we see an addWithSizeof then we expect the type of // the pointer expression to be `char*` or `void*`. Otherwise it // is probably a mistake. From 0cd859c5593949c4413c65b953450d6b8a50d886 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 24 Apr 2025 12:48:21 +0100 Subject: [PATCH 192/240] C++: qlformat --- cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql b/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql index 11b7779118fc..da92c792432c 100644 --- a/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql +++ b/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql @@ -28,7 +28,8 @@ where // If we see an addWithSizeof then we expect the type of // the pointer expression to be `char*` or `void*`. Otherwise it // is probably a mistake. - addWithSizeof(e, sizeofExpr, _) and not isCharSzPtrExpr(e) + addWithSizeof(e, sizeofExpr, _) and + not isCharSzPtrExpr(e) select sizeofExpr, "Suspicious sizeof offset in a pointer arithmetic expression. The type of the pointer is $@.", e.getFullyConverted().getType() as t, t.toString() From 69b87a63b851a64c4a89c495f3f58ae6e5a40c8d Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 24 Apr 2025 14:41:05 +0200 Subject: [PATCH 193/240] Go: remove invalid toolchain version diagnostics This diagnostic was introduced by https://github.com/github/codeql/pull/15979. However in the meantime the Go team [has backtracked](https://github.com/golang/go/issues/62278#issuecomment-2062002018) on their decision, which leads to confusing alerts for user (e.g. https://github.com/github/codeql-action/issues/2868). Even using Go toolchains from 1.21 to 1.22 we weren't immediately able to reproduce the problem that this diagnostics was meant to guard against. Therefore it was deemed simpler to just remove it. _En passant_ the `Makefile` now accepts `rtjo` not being set. --- go/Makefile | 2 ++ .../cli/go-autobuilder/go-autobuilder.go | 2 +- go/extractor/diagnostics/diagnostics.go | 15 -------- go/extractor/project/project.go | 34 +++++-------------- go/extractor/project/project_test.go | 29 ---------------- .../build_environment.expected | 5 --- .../diagnostics.expected | 31 ----------------- .../invalid-toolchain-version/src/go.mod | 3 -- .../invalid-toolchain-version/src/main.go | 5 --- .../invalid-toolchain-version/test.py | 6 ---- .../go-version-bump/diagnostics.expected | 17 ---------- .../newer-go-needed/diagnostics.expected | 17 ---------- 12 files changed, 11 insertions(+), 155 deletions(-) delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/build_environment.expected delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/diagnostics.expected delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/go.mod delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/main.go delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/test.py diff --git a/go/Makefile b/go/Makefile index b32b61bc5c38..5bf6d70e0e69 100644 --- a/go/Makefile +++ b/go/Makefile @@ -5,6 +5,8 @@ # and that we actually get are too big, the build fails on CI. BAZEL := $(shell bash -c "which bazel") +rtjo ?= none + all: gen extractor EXTRACTOR_PACK_OUT = extractor-pack diff --git a/go/extractor/cli/go-autobuilder/go-autobuilder.go b/go/extractor/cli/go-autobuilder/go-autobuilder.go index aeff4f0bd6e1..50118c8dc9ff 100644 --- a/go/extractor/cli/go-autobuilder/go-autobuilder.go +++ b/go/extractor/cli/go-autobuilder/go-autobuilder.go @@ -425,7 +425,7 @@ func installDependencies(workspace project.GoWorkspace) { } else { if workspace.Modules == nil { project.InitGoModForLegacyProject(workspace.BaseDir) - workspace.Modules = project.LoadGoModules(true, []string{filepath.Join(workspace.BaseDir, "go.mod")}) + workspace.Modules = project.LoadGoModules([]string{filepath.Join(workspace.BaseDir, "go.mod")}) } // get dependencies for all modules diff --git a/go/extractor/diagnostics/diagnostics.go b/go/extractor/diagnostics/diagnostics.go index 385c611aac81..00179b98cca5 100644 --- a/go/extractor/diagnostics/diagnostics.go +++ b/go/extractor/diagnostics/diagnostics.go @@ -508,18 +508,3 @@ func EmitExtractionFailedForProjects(path []string) { noLocation, ) } - -func EmitInvalidToolchainVersion(goModPath string, version string) { - emitDiagnostic( - "go/autobuilder/invalid-go-toolchain-version", - "Invalid Go toolchain version", - strings.Join([]string{ - "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).", - fmt.Sprintf("`%s` in `%s` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", version, goModPath), - }, - "\n\n"), - severityWarning, - fullVisibility, - &locationStruct{File: goModPath}, - ) -} diff --git a/go/extractor/project/project.go b/go/extractor/project/project.go index eff69c0e9cac..1377b2513418 100644 --- a/go/extractor/project/project.go +++ b/go/extractor/project/project.go @@ -192,20 +192,10 @@ func findGoModFiles(root string) []string { return util.FindAllFilesWithName(root, "go.mod", util.SkipVendorChecks...) } -// A regular expression for the Go toolchain version syntax. -var toolchainVersionRe *regexp.Regexp = regexp.MustCompile(`(?m)^([0-9]+\.[0-9]+(\.[0-9]+|rc[0-9]+))$`) - -// Returns true if the `go.mod` file specifies a Go language version, that version is `1.21` or greater, and -// there is no `toolchain` directive, and the Go language version is not a valid toolchain version. -func hasInvalidToolchainVersion(modFile *modfile.File) bool { - return modFile.Toolchain == nil && modFile.Go != nil && - !toolchainVersionRe.Match([]byte(modFile.Go.Version)) && util.NewSemVer(modFile.Go.Version).IsAtLeast(toolchain.V1_21) -} - // Given a list of `go.mod` file paths, try to parse them all. The resulting array of `GoModule` objects // will be the same length as the input array and the objects will contain at least the `go.mod` path. // If parsing the corresponding file is successful, then the parsed contents will also be available. -func LoadGoModules(emitDiagnostics bool, goModFilePaths []string) []*GoModule { +func LoadGoModules(goModFilePaths []string) []*GoModule { results := make([]*GoModule, len(goModFilePaths)) for i, goModFilePath := range goModFilePaths { @@ -227,14 +217,6 @@ func LoadGoModules(emitDiagnostics bool, goModFilePaths []string) []*GoModule { } results[i].Module = modFile - - // If this `go.mod` file specifies a Go language version, that version is `1.21` or greater, and - // there is no `toolchain` directive, check that it is a valid Go toolchain version. Otherwise, - // `go` commands which try to download the right version of the Go toolchain will fail. We detect - // this situation and emit a diagnostic. - if hasInvalidToolchainVersion(modFile) { - diagnostics.EmitInvalidToolchainVersion(goModFilePath, modFile.Go.Version) - } } return results @@ -243,7 +225,7 @@ func LoadGoModules(emitDiagnostics bool, goModFilePaths []string) []*GoModule { // Given a path to a `go.work` file, this function attempts to parse the `go.work` file. If unsuccessful, // we attempt to discover `go.mod` files within subdirectories of the directory containing the `go.work` // file ourselves. -func discoverWorkspace(emitDiagnostics bool, workFilePath string) GoWorkspace { +func discoverWorkspace(workFilePath string) GoWorkspace { log.Printf("Loading %s...\n", workFilePath) baseDir := filepath.Dir(workFilePath) workFileSrc, err := os.ReadFile(workFilePath) @@ -257,7 +239,7 @@ func discoverWorkspace(emitDiagnostics bool, workFilePath string) GoWorkspace { return GoWorkspace{ BaseDir: baseDir, - Modules: LoadGoModules(emitDiagnostics, goModFilePaths), + Modules: LoadGoModules(goModFilePaths), DepMode: GoGetWithModules, ModMode: getModMode(GoGetWithModules, baseDir), } @@ -274,7 +256,7 @@ func discoverWorkspace(emitDiagnostics bool, workFilePath string) GoWorkspace { return GoWorkspace{ BaseDir: baseDir, - Modules: LoadGoModules(emitDiagnostics, goModFilePaths), + Modules: LoadGoModules(goModFilePaths), DepMode: GoGetWithModules, ModMode: getModMode(GoGetWithModules, baseDir), } @@ -297,7 +279,7 @@ func discoverWorkspace(emitDiagnostics bool, workFilePath string) GoWorkspace { return GoWorkspace{ BaseDir: baseDir, WorkspaceFile: workFile, - Modules: LoadGoModules(emitDiagnostics, goModFilePaths), + Modules: LoadGoModules(goModFilePaths), DepMode: GoGetWithModules, ModMode: ModReadonly, // Workspaces only support "readonly" } @@ -325,7 +307,7 @@ func discoverWorkspaces(emitDiagnostics bool) []GoWorkspace { for i, goModFile := range goModFiles { results[i] = GoWorkspace{ BaseDir: filepath.Dir(goModFile), - Modules: LoadGoModules(emitDiagnostics, []string{goModFile}), + Modules: LoadGoModules([]string{goModFile}), DepMode: GoGetWithModules, ModMode: getModMode(GoGetWithModules, filepath.Dir(goModFile)), } @@ -342,7 +324,7 @@ func discoverWorkspaces(emitDiagnostics bool) []GoWorkspace { results := make([]GoWorkspace, len(goWorkFiles)) for i, workFilePath := range goWorkFiles { - results[i] = discoverWorkspace(emitDiagnostics, workFilePath) + results[i] = discoverWorkspace(workFilePath) } // Add all stray `go.mod` files (i.e. those not referenced by `go.work` files) @@ -374,7 +356,7 @@ func discoverWorkspaces(emitDiagnostics bool) []GoWorkspace { log.Printf("Module %s is not referenced by any go.work file; adding it separately.\n", goModFile) results = append(results, GoWorkspace{ BaseDir: filepath.Dir(goModFile), - Modules: LoadGoModules(emitDiagnostics, []string{goModFile}), + Modules: LoadGoModules([]string{goModFile}), DepMode: GoGetWithModules, ModMode: getModMode(GoGetWithModules, filepath.Dir(goModFile)), }) diff --git a/go/extractor/project/project_test.go b/go/extractor/project/project_test.go index 149a9723ec29..55cb163e9197 100644 --- a/go/extractor/project/project_test.go +++ b/go/extractor/project/project_test.go @@ -39,35 +39,6 @@ func parseModFile(t *testing.T, contents string) *modfile.File { return modFile } -func testHasInvalidToolchainVersion(t *testing.T, contents string) bool { - return hasInvalidToolchainVersion(parseModFile(t, contents)) -} - -func TestHasInvalidToolchainVersion(t *testing.T) { - invalid := []string{ - "go 1.21\n", - "go 1.22\n", - } - - for _, v := range invalid { - if !testHasInvalidToolchainVersion(t, v) { - t.Errorf("Expected testHasInvalidToolchainVersion(\"%s\") to be true, but got false", v) - } - } - - valid := []string{ - "go 1.20\n", - "go 1.21.1\n", - "go 1.22\n\ntoolchain go1.22.0\n", - } - - for _, v := range valid { - if testHasInvalidToolchainVersion(t, v) { - t.Errorf("Expected testHasInvalidToolchainVersion(\"%s\") to be false, but got true", v) - } - } -} - func parseWorkFile(t *testing.T, contents string) *modfile.WorkFile { workFile, err := modfile.ParseWork("go.work", []byte(contents), nil) diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/build_environment.expected b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/build_environment.expected deleted file mode 100644 index 0b225ce00857..000000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/build_environment.expected +++ /dev/null @@ -1,5 +0,0 @@ -{ - "configuration" : { - "go" : { } - } -} diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/diagnostics.expected b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/diagnostics.expected deleted file mode 100644 index 2e5d732e53e7..000000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/diagnostics.expected +++ /dev/null @@ -1,31 +0,0 @@ -{ - "location": { - "file": "go.mod" - }, - "markdownMessage": "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).\n\n`1.21` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", - "severity": "warning", - "source": { - "extractorName": "go", - "id": "go/autobuilder/invalid-go-toolchain-version", - "name": "Invalid Go toolchain version" - }, - "visibility": { - "cliSummaryTable": true, - "statusPage": true, - "telemetry": true - } -} -{ - "markdownMessage": "A single `go.mod` file was found.\n\n`go.mod`", - "severity": "note", - "source": { - "extractorName": "go", - "id": "go/autobuilder/single-root-go-mod-found", - "name": "A single `go.mod` file was found in the root" - }, - "visibility": { - "cliSummaryTable": false, - "statusPage": false, - "telemetry": true - } -} diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/go.mod b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/go.mod deleted file mode 100644 index bee3365b8999..000000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -go 1.21 - -module example diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/main.go b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/main.go deleted file mode 100644 index 79058077776c..000000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/main.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -func main() { - -} diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/test.py b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/test.py deleted file mode 100644 index 44aa92d67584..000000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/test.py +++ /dev/null @@ -1,6 +0,0 @@ -import os - - -def test(codeql, go): - os.environ["LGTM_INDEX_IMPORT_PATH"] = "test" - codeql.database.create(source_root="src") diff --git a/go/ql/integration-tests/go-version-bump/diagnostics.expected b/go/ql/integration-tests/go-version-bump/diagnostics.expected index 2e5d732e53e7..56d774b7037c 100644 --- a/go/ql/integration-tests/go-version-bump/diagnostics.expected +++ b/go/ql/integration-tests/go-version-bump/diagnostics.expected @@ -1,20 +1,3 @@ -{ - "location": { - "file": "go.mod" - }, - "markdownMessage": "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).\n\n`1.21` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", - "severity": "warning", - "source": { - "extractorName": "go", - "id": "go/autobuilder/invalid-go-toolchain-version", - "name": "Invalid Go toolchain version" - }, - "visibility": { - "cliSummaryTable": true, - "statusPage": true, - "telemetry": true - } -} { "markdownMessage": "A single `go.mod` file was found.\n\n`go.mod`", "severity": "note", diff --git a/go/ql/integration-tests/resolve-build-environment/newer-go-needed/diagnostics.expected b/go/ql/integration-tests/resolve-build-environment/newer-go-needed/diagnostics.expected index b64c1397938d..56d774b7037c 100644 --- a/go/ql/integration-tests/resolve-build-environment/newer-go-needed/diagnostics.expected +++ b/go/ql/integration-tests/resolve-build-environment/newer-go-needed/diagnostics.expected @@ -1,20 +1,3 @@ -{ - "location": { - "file": "go.mod" - }, - "markdownMessage": "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).\n\n`1.22` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", - "severity": "warning", - "source": { - "extractorName": "go", - "id": "go/autobuilder/invalid-go-toolchain-version", - "name": "Invalid Go toolchain version" - }, - "visibility": { - "cliSummaryTable": true, - "statusPage": true, - "telemetry": true - } -} { "markdownMessage": "A single `go.mod` file was found.\n\n`go.mod`", "severity": "note", From a5a21b1dddc7a4fa6755034adff7766e6e1c03c2 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 24 Apr 2025 17:40:49 +0200 Subject: [PATCH 194/240] Swift: Guard 'getCaptures' in `fillClosureExpr` --- swift/extractor/translators/ExprTranslator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index c57cfd5b9ee8..0f7d5d0c9155 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -477,7 +477,11 @@ codeql::ErrorExpr ExprTranslator::translateErrorExpr(const swift::ErrorExpr& exp void ExprTranslator::fillClosureExpr(const swift::AbstractClosureExpr& expr, codeql::ClosureExpr& entry) { entry.body = dispatcher.fetchLabel(expr.getBody()); - entry.captures = dispatcher.fetchRepeatedLabels(expr.getCaptureInfo().getCaptures()); + if (expr.getCaptureInfo().hasBeenComputed()) { + entry.captures = dispatcher.fetchRepeatedLabels(expr.getCaptureInfo().getCaptures()); + } else { + LOG_ERROR("Unable to get CaptureInfo"); + } CODEQL_EXPECT_OR(return, expr.getParameters(), "AbstractClosureExpr has null getParameters()"); entry.params = dispatcher.fetchRepeatedLabels(*expr.getParameters()); } From aabbfce01014efcacc0bac1fc017634eed2de9da Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Thu, 24 Apr 2025 13:25:38 -0700 Subject: [PATCH 195/240] Actions: Exclude model-generator queries from query suites This change removes the model generator queries for Actions sources/sinks/summaries from being run as part of the `actions-security-and-quality.qls` query suite, where they were accidentally included. All languages will now exclude both `modelgenerator` and `model-generator` tagged queries from their suites. --- misc/suite-helpers/security-and-quality-selectors.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/suite-helpers/security-and-quality-selectors.yml b/misc/suite-helpers/security-and-quality-selectors.yml index da45710e0b76..3baa3c75758b 100644 --- a/misc/suite-helpers/security-and-quality-selectors.yml +++ b/misc/suite-helpers/security-and-quality-selectors.yml @@ -33,3 +33,4 @@ tags contain: - modeleditor - modelgenerator + - 'model-generator' From 05243bd8553f698ffd517e278a667e0f790045fa Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Thu, 24 Apr 2025 14:20:47 -0700 Subject: [PATCH 196/240] Actions: Fix query ID for reusable workflow sinks query --- actions/ql/src/Models/ReusableWorkflowsSinks.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/ql/src/Models/ReusableWorkflowsSinks.ql b/actions/ql/src/Models/ReusableWorkflowsSinks.ql index 6da9acda9060..05334a533ddf 100644 --- a/actions/ql/src/Models/ReusableWorkflowsSinks.ql +++ b/actions/ql/src/Models/ReusableWorkflowsSinks.ql @@ -5,7 +5,7 @@ * @problem.severity warning * @security-severity 9.3 * @precision high - * @id actions/reusable-wokflow-sinks + * @id actions/reusable-workflow-sinks * @tags actions * model-generator * external/cwe/cwe-020 From b197de8db4428b59b1fb87f9efccd21088cb0470 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Thu, 24 Apr 2025 14:21:04 -0700 Subject: [PATCH 197/240] Actions: Add change note for removing model ggenerator queries --- .../2025-04-24-model-generator-queries.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 actions/ql/src/change-notes/2025-04-24-model-generator-queries.md diff --git a/actions/ql/src/change-notes/2025-04-24-model-generator-queries.md b/actions/ql/src/change-notes/2025-04-24-model-generator-queries.md new file mode 100644 index 000000000000..a7f9675af3b9 --- /dev/null +++ b/actions/ql/src/change-notes/2025-04-24-model-generator-queries.md @@ -0,0 +1,14 @@ +### Breaking Changes + +* The following queries have been removed from the `security-and-quality` suite. + They are not intended to produce user-facing + alerts describing vulnerabilities. + Any existing alerts for these queries will be closed automatically. + * `actions/composite-action-sinks` + * `actions/composite-action-sources` + * `actions/composite-action-summaries` + * `actions/reusable-workflow-sinks` + (renamed from `actions/reusable-wokflow-sinks`) + * `actions/reusable-workflow-sources` + * `actions/reusable-workflow-summaries` + \ No newline at end of file From 6c1e80df3ae30a547a5353d482bc595e52b3752c Mon Sep 17 00:00:00 2001 From: Chuan-kai Lin Date: Thu, 24 Apr 2025 13:38:24 -0700 Subject: [PATCH 198/240] Python: disable diff-informed PolynomialReDoS.ql This commit disabled diff-informed for PolynomialReDoS.ql because it could miss some alerts within diff ranges. --- .../security/dataflow/PolynomialReDoSQuery.qll | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll index 89aa4961e6ef..0e52764c1950 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll @@ -18,7 +18,17 @@ private module PolynomialReDoSConfig implements DataFlow::ConfigSig { predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } - predicate observeDiffInformedIncrementalMode() { any() } + // Diff-informed incremental mode is currently disabled for this query due to + // API limitations. The query exposes sink.getABacktrackingTerm() as an alert + // location, but there is no way to express that information through + // getASelectedSinkLocation() because there is no @location in the CodeQL + // database that corresponds to a term inside a regular expression. As a + // result, this query could miss alerts in diff-informed incremental mode. + // + // To address this problem, we need to have a version of + // getASelectedSinkLocation() that uses hasLocationInfo() instead of + // returning Location objects. + predicate observeDiffInformedIncrementalMode() { none() } Location getASelectedSinkLocation(DataFlow::Node sink) { result = sink.(Sink).getHighlight().getLocation() From a991ef0f876860f907154cb7fedd938c8826eacb Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 25 Apr 2025 10:32:48 +0200 Subject: [PATCH 199/240] C#: Add a CFG test for switch fall-through --- .../controlflow/graph/BasicBlock.expected | 8 ++ .../controlflow/graph/Condition.expected | 20 +++++ .../controlflow/graph/Dominance.expected | 85 +++++++++++++++++++ .../graph/EnclosingCallable.expected | 33 +++++++ .../controlflow/graph/EntryElement.expected | 22 +++++ .../controlflow/graph/ExitElement.expected | 33 +++++++ .../controlflow/graph/NodeGraph.expected | 27 ++++++ .../controlflow/graph/Nodes.expected | 1 + .../library-tests/controlflow/graph/Switch.cs | 17 ++++ 9 files changed, 246 insertions(+) diff --git a/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected b/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected index 623b5404f781..41e3b0918f17 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected @@ -1078,6 +1078,14 @@ | Switch.cs:156:50:156:52 | "b" | Switch.cs:156:41:156:52 | ... => ... | 2 | | Switch.cs:158:13:158:49 | ...; | Switch.cs:158:13:158:48 | call to method WriteLine | 6 | | Switch.cs:160:13:160:49 | ...; | Switch.cs:160:13:160:48 | call to method WriteLine | 6 | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:167:18:167:18 | 1 | 6 | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | exit M16 | 2 | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:18:168:18 | 2 | 2 | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:169:17:169:50 | call to method WriteLine | 3 | +| Switch.cs:170:17:170:22 | break; | Switch.cs:170:17:170:22 | break; | 1 | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:18:171:18 | 3 | 2 | +| Switch.cs:172:17:172:46 | ...; | Switch.cs:173:17:173:22 | break; | 4 | +| Switch.cs:174:13:174:20 | default: | Switch.cs:176:17:176:22 | break; | 5 | | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | TypeAccesses.cs:1:7:1:18 | exit TypeAccesses | 5 | | TypeAccesses.cs:3:10:3:10 | enter M | TypeAccesses.cs:7:18:7:22 | Int32 j | 13 | | TypeAccesses.cs:7:13:7:22 | [false] ... is ... | TypeAccesses.cs:7:13:7:22 | [false] ... is ... | 1 | diff --git a/csharp/ql/test/library-tests/controlflow/graph/Condition.expected b/csharp/ql/test/library-tests/controlflow/graph/Condition.expected index 4bb86b2c3116..1d1baa042cea 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Condition.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/Condition.expected @@ -2140,6 +2140,26 @@ conditionBlock | Switch.cs:156:17:156:54 | ... switch { ... } | Switch.cs:158:13:158:49 | ...; | true | | Switch.cs:156:17:156:54 | ... switch { ... } | Switch.cs:160:13:160:49 | ...; | false | | Switch.cs:156:41:156:45 | false | Switch.cs:156:50:156:52 | "b" | true | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | exit M16 (normal) | false | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | exit M16 (normal) | true | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:168:13:168:19 | case ...: | false | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:168:13:168:19 | case ...: | true | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:169:17:169:51 | ...; | false | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:169:17:169:51 | ...; | true | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:170:17:170:22 | break; | false | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:170:17:170:22 | break; | true | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:171:13:171:19 | case ...: | false | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:171:13:171:19 | case ...: | true | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:172:17:172:46 | ...; | false | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:172:17:172:46 | ...; | true | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:174:13:174:20 | default: | false | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:174:13:174:20 | default: | true | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:169:17:169:51 | ...; | true | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:171:13:171:19 | case ...: | false | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:172:17:172:46 | ...; | false | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:174:13:174:20 | default: | false | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:172:17:172:46 | ...; | true | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:174:13:174:20 | default: | false | | TypeAccesses.cs:3:10:3:10 | enter M | TypeAccesses.cs:7:13:7:22 | [false] ... is ... | false | | TypeAccesses.cs:3:10:3:10 | enter M | TypeAccesses.cs:7:13:7:22 | [true] ... is ... | true | | TypeAccesses.cs:3:10:3:10 | enter M | TypeAccesses.cs:7:25:7:25 | ; | true | diff --git a/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected b/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected index b2d700660689..3f80ba98b569 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected @@ -3678,6 +3678,29 @@ dominance | Switch.cs:160:40:160:43 | "b = " | Switch.cs:160:45:160:45 | access to local variable s | | Switch.cs:160:44:160:46 | {...} | Switch.cs:160:38:160:47 | $"..." | | Switch.cs:160:45:160:45 | access to local variable s | Switch.cs:160:44:160:46 | {...} | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:164:5:178:5 | {...} | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | exit M16 | +| Switch.cs:164:5:178:5 | {...} | Switch.cs:165:9:177:9 | switch (...) {...} | +| Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:165:17:165:17 | access to parameter i | +| Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:167:13:167:19 | case ...: | +| Switch.cs:167:13:167:19 | case ...: | Switch.cs:167:18:167:18 | 1 | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:168:13:168:19 | case ...: | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:18:168:18 | 2 | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:169:17:169:51 | ...; | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:170:17:170:22 | break; | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:171:13:171:19 | case ...: | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:169:42:169:49 | "1 or 2" | +| Switch.cs:169:42:169:49 | "1 or 2" | Switch.cs:169:17:169:50 | call to method WriteLine | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:18:171:18 | 3 | +| Switch.cs:171:18:171:18 | 3 | Switch.cs:172:17:172:46 | ...; | +| Switch.cs:171:18:171:18 | 3 | Switch.cs:174:13:174:20 | default: | +| Switch.cs:172:17:172:45 | call to method WriteLine | Switch.cs:173:17:173:22 | break; | +| Switch.cs:172:17:172:46 | ...; | Switch.cs:172:42:172:44 | "3" | +| Switch.cs:172:42:172:44 | "3" | Switch.cs:172:17:172:45 | call to method WriteLine | +| Switch.cs:174:13:174:20 | default: | Switch.cs:175:17:175:48 | ...; | +| Switch.cs:175:17:175:47 | call to method WriteLine | Switch.cs:176:17:176:22 | break; | +| Switch.cs:175:17:175:48 | ...; | Switch.cs:175:42:175:46 | "def" | +| Switch.cs:175:42:175:46 | "def" | Switch.cs:175:17:175:47 | call to method WriteLine | | TypeAccesses.cs:1:7:1:18 | call to constructor Object | TypeAccesses.cs:1:7:1:18 | {...} | | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | TypeAccesses.cs:1:7:1:18 | call to constructor Object | | TypeAccesses.cs:1:7:1:18 | exit TypeAccesses (normal) | TypeAccesses.cs:1:7:1:18 | exit TypeAccesses | @@ -7854,6 +7877,28 @@ postDominance | Switch.cs:160:40:160:43 | "b = " | Switch.cs:160:13:160:49 | ...; | | Switch.cs:160:44:160:46 | {...} | Switch.cs:160:45:160:45 | access to local variable s | | Switch.cs:160:45:160:45 | access to local variable s | Switch.cs:160:40:160:43 | "b = " | +| Switch.cs:163:10:163:12 | exit M16 | Switch.cs:163:10:163:12 | exit M16 (normal) | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:170:17:170:22 | break; | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:173:17:173:22 | break; | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:176:17:176:22 | break; | +| Switch.cs:164:5:178:5 | {...} | Switch.cs:163:10:163:12 | enter M16 | +| Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:164:5:178:5 | {...} | +| Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:165:9:177:9 | switch (...) {...} | +| Switch.cs:167:13:167:19 | case ...: | Switch.cs:165:17:165:17 | access to parameter i | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:167:13:167:19 | case ...: | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:167:18:167:18 | 1 | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:168:13:168:19 | case ...: | +| Switch.cs:169:17:169:50 | call to method WriteLine | Switch.cs:169:42:169:49 | "1 or 2" | +| Switch.cs:169:42:169:49 | "1 or 2" | Switch.cs:169:17:169:51 | ...; | +| Switch.cs:170:17:170:22 | break; | Switch.cs:169:17:169:50 | call to method WriteLine | +| Switch.cs:171:18:171:18 | 3 | Switch.cs:171:13:171:19 | case ...: | +| Switch.cs:172:17:172:45 | call to method WriteLine | Switch.cs:172:42:172:44 | "3" | +| Switch.cs:172:42:172:44 | "3" | Switch.cs:172:17:172:46 | ...; | +| Switch.cs:173:17:173:22 | break; | Switch.cs:172:17:172:45 | call to method WriteLine | +| Switch.cs:175:17:175:47 | call to method WriteLine | Switch.cs:175:42:175:46 | "def" | +| Switch.cs:175:17:175:48 | ...; | Switch.cs:174:13:174:20 | default: | +| Switch.cs:175:42:175:46 | "def" | Switch.cs:175:17:175:48 | ...; | +| Switch.cs:176:17:176:22 | break; | Switch.cs:175:17:175:47 | call to method WriteLine | | TypeAccesses.cs:1:7:1:18 | call to constructor Object | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | | TypeAccesses.cs:1:7:1:18 | exit TypeAccesses | TypeAccesses.cs:1:7:1:18 | exit TypeAccesses (normal) | | TypeAccesses.cs:1:7:1:18 | exit TypeAccesses (normal) | TypeAccesses.cs:1:7:1:18 | {...} | @@ -12467,6 +12512,29 @@ blockDominance | Switch.cs:156:50:156:52 | "b" | Switch.cs:156:50:156:52 | "b" | | Switch.cs:158:13:158:49 | ...; | Switch.cs:158:13:158:49 | ...; | | Switch.cs:160:13:160:49 | ...; | Switch.cs:160:13:160:49 | ...; | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | enter M16 | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | exit M16 (normal) | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:168:13:168:19 | case ...: | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:169:17:169:51 | ...; | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:170:17:170:22 | break; | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:171:13:171:19 | case ...: | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:172:17:172:46 | ...; | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:174:13:174:20 | default: | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | exit M16 (normal) | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:163:10:163:12 | exit M16 (normal) | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:13:168:19 | case ...: | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:169:17:169:51 | ...; | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:170:17:170:22 | break; | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:171:13:171:19 | case ...: | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:172:17:172:46 | ...; | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:174:13:174:20 | default: | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:169:17:169:51 | ...; | +| Switch.cs:170:17:170:22 | break; | Switch.cs:170:17:170:22 | break; | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:13:171:19 | case ...: | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:172:17:172:46 | ...; | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:174:13:174:20 | default: | +| Switch.cs:172:17:172:46 | ...; | Switch.cs:172:17:172:46 | ...; | +| Switch.cs:174:13:174:20 | default: | Switch.cs:174:13:174:20 | default: | | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | | TypeAccesses.cs:3:10:3:10 | enter M | TypeAccesses.cs:3:10:3:10 | enter M | | TypeAccesses.cs:3:10:3:10 | enter M | TypeAccesses.cs:7:13:7:22 | [false] ... is ... | @@ -15794,6 +15862,23 @@ postBlockDominance | Switch.cs:156:50:156:52 | "b" | Switch.cs:156:50:156:52 | "b" | | Switch.cs:158:13:158:49 | ...; | Switch.cs:158:13:158:49 | ...; | | Switch.cs:160:13:160:49 | ...; | Switch.cs:160:13:160:49 | ...; | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | enter M16 | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | enter M16 | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | exit M16 (normal) | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:168:13:168:19 | case ...: | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:169:17:169:51 | ...; | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:170:17:170:22 | break; | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:171:13:171:19 | case ...: | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:172:17:172:46 | ...; | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:174:13:174:20 | default: | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:163:10:163:12 | enter M16 | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:13:168:19 | case ...: | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:169:17:169:51 | ...; | +| Switch.cs:170:17:170:22 | break; | Switch.cs:169:17:169:51 | ...; | +| Switch.cs:170:17:170:22 | break; | Switch.cs:170:17:170:22 | break; | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:13:171:19 | case ...: | +| Switch.cs:172:17:172:46 | ...; | Switch.cs:172:17:172:46 | ...; | +| Switch.cs:174:13:174:20 | default: | Switch.cs:174:13:174:20 | default: | | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | | TypeAccesses.cs:3:10:3:10 | enter M | TypeAccesses.cs:3:10:3:10 | enter M | | TypeAccesses.cs:7:13:7:22 | [false] ... is ... | TypeAccesses.cs:7:13:7:22 | [false] ... is ... | diff --git a/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected b/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected index 57e393adc39a..b5d2ec33899a 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected @@ -4029,6 +4029,31 @@ nodeEnclosing | Switch.cs:160:40:160:43 | "b = " | Switch.cs:154:10:154:12 | M15 | | Switch.cs:160:44:160:46 | {...} | Switch.cs:154:10:154:12 | M15 | | Switch.cs:160:45:160:45 | access to local variable s | Switch.cs:154:10:154:12 | M15 | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:163:10:163:12 | exit M16 | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:164:5:178:5 | {...} | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:167:13:167:19 | case ...: | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:169:17:169:50 | call to method WriteLine | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:169:42:169:49 | "1 or 2" | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:170:17:170:22 | break; | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:171:18:171:18 | 3 | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:172:17:172:45 | call to method WriteLine | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:172:17:172:46 | ...; | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:172:42:172:44 | "3" | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:173:17:173:22 | break; | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:174:13:174:20 | default: | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:175:17:175:47 | call to method WriteLine | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:175:17:175:48 | ...; | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:175:42:175:46 | "def" | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:176:17:176:22 | break; | Switch.cs:163:10:163:12 | M16 | | TypeAccesses.cs:1:7:1:18 | call to constructor Object | TypeAccesses.cs:1:7:1:18 | TypeAccesses | | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | TypeAccesses.cs:1:7:1:18 | TypeAccesses | | TypeAccesses.cs:1:7:1:18 | exit TypeAccesses | TypeAccesses.cs:1:7:1:18 | TypeAccesses | @@ -5913,6 +5938,14 @@ blockEnclosing | Switch.cs:156:50:156:52 | "b" | Switch.cs:154:10:154:12 | M15 | | Switch.cs:158:13:158:49 | ...; | Switch.cs:154:10:154:12 | M15 | | Switch.cs:160:13:160:49 | ...; | Switch.cs:154:10:154:12 | M15 | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:170:17:170:22 | break; | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:172:17:172:46 | ...; | Switch.cs:163:10:163:12 | M16 | +| Switch.cs:174:13:174:20 | default: | Switch.cs:163:10:163:12 | M16 | | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | TypeAccesses.cs:1:7:1:18 | TypeAccesses | | TypeAccesses.cs:3:10:3:10 | enter M | TypeAccesses.cs:3:10:3:10 | M | | TypeAccesses.cs:7:13:7:22 | [false] ... is ... | TypeAccesses.cs:3:10:3:10 | M | diff --git a/csharp/ql/test/library-tests/controlflow/graph/EntryElement.expected b/csharp/ql/test/library-tests/controlflow/graph/EntryElement.expected index cc26ecf7c8ed..ea7ade106ea8 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/EntryElement.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/EntryElement.expected @@ -2711,6 +2711,28 @@ | Switch.cs:160:40:160:43 | "b = " | Switch.cs:160:40:160:43 | "b = " | | Switch.cs:160:44:160:46 | {...} | Switch.cs:160:45:160:45 | access to local variable s | | Switch.cs:160:45:160:45 | access to local variable s | Switch.cs:160:45:160:45 | access to local variable s | +| Switch.cs:164:5:178:5 | {...} | Switch.cs:164:5:178:5 | {...} | +| Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:165:9:177:9 | switch (...) {...} | +| Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:165:17:165:17 | access to parameter i | +| Switch.cs:167:13:167:19 | case ...: | Switch.cs:167:13:167:19 | case ...: | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:167:18:167:18 | 1 | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:13:168:19 | case ...: | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:168:18:168:18 | 2 | +| Switch.cs:169:17:169:50 | call to method WriteLine | Switch.cs:169:42:169:49 | "1 or 2" | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:169:17:169:51 | ...; | +| Switch.cs:169:42:169:49 | "1 or 2" | Switch.cs:169:42:169:49 | "1 or 2" | +| Switch.cs:170:17:170:22 | break; | Switch.cs:170:17:170:22 | break; | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:13:171:19 | case ...: | +| Switch.cs:171:18:171:18 | 3 | Switch.cs:171:18:171:18 | 3 | +| Switch.cs:172:17:172:45 | call to method WriteLine | Switch.cs:172:42:172:44 | "3" | +| Switch.cs:172:17:172:46 | ...; | Switch.cs:172:17:172:46 | ...; | +| Switch.cs:172:42:172:44 | "3" | Switch.cs:172:42:172:44 | "3" | +| Switch.cs:173:17:173:22 | break; | Switch.cs:173:17:173:22 | break; | +| Switch.cs:174:13:174:20 | default: | Switch.cs:174:13:174:20 | default: | +| Switch.cs:175:17:175:47 | call to method WriteLine | Switch.cs:175:42:175:46 | "def" | +| Switch.cs:175:17:175:48 | ...; | Switch.cs:175:17:175:48 | ...; | +| Switch.cs:175:42:175:46 | "def" | Switch.cs:175:42:175:46 | "def" | +| Switch.cs:176:17:176:22 | break; | Switch.cs:176:17:176:22 | break; | | TypeAccesses.cs:1:7:1:18 | call to constructor Object | TypeAccesses.cs:1:7:1:18 | call to constructor Object | | TypeAccesses.cs:1:7:1:18 | {...} | TypeAccesses.cs:1:7:1:18 | {...} | | TypeAccesses.cs:4:5:9:5 | {...} | TypeAccesses.cs:4:5:9:5 | {...} | diff --git a/csharp/ql/test/library-tests/controlflow/graph/ExitElement.expected b/csharp/ql/test/library-tests/controlflow/graph/ExitElement.expected index bc47b5b3fa26..84e8ab1cc2a6 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/ExitElement.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/ExitElement.expected @@ -3581,6 +3581,39 @@ | Switch.cs:160:40:160:43 | "b = " | Switch.cs:160:40:160:43 | "b = " | normal | | Switch.cs:160:44:160:46 | {...} | Switch.cs:160:44:160:46 | {...} | normal | | Switch.cs:160:45:160:45 | access to local variable s | Switch.cs:160:45:160:45 | access to local variable s | normal | +| Switch.cs:164:5:178:5 | {...} | Switch.cs:170:17:170:22 | break; | normal [break] (0) | +| Switch.cs:164:5:178:5 | {...} | Switch.cs:173:17:173:22 | break; | normal [break] (0) | +| Switch.cs:164:5:178:5 | {...} | Switch.cs:176:17:176:22 | break; | normal [break] (0) | +| Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:170:17:170:22 | break; | normal [break] (0) | +| Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:173:17:173:22 | break; | normal [break] (0) | +| Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:176:17:176:22 | break; | normal [break] (0) | +| Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:165:17:165:17 | access to parameter i | normal | +| Switch.cs:167:13:167:19 | case ...: | Switch.cs:167:18:167:18 | 1 | no-match | +| Switch.cs:167:13:167:19 | case ...: | Switch.cs:168:18:168:18 | 2 | no-match | +| Switch.cs:167:13:167:19 | case ...: | Switch.cs:169:17:169:50 | call to method WriteLine | normal | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:167:18:167:18 | 1 | match | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:167:18:167:18 | 1 | no-match | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:18:168:18 | 2 | no-match | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:169:17:169:50 | call to method WriteLine | normal | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:168:18:168:18 | 2 | match | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:168:18:168:18 | 2 | no-match | +| Switch.cs:169:17:169:50 | call to method WriteLine | Switch.cs:169:17:169:50 | call to method WriteLine | normal | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:169:17:169:50 | call to method WriteLine | normal | +| Switch.cs:169:42:169:49 | "1 or 2" | Switch.cs:169:42:169:49 | "1 or 2" | normal | +| Switch.cs:170:17:170:22 | break; | Switch.cs:170:17:170:22 | break; | break | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:18:171:18 | 3 | no-match | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:172:17:172:45 | call to method WriteLine | normal | +| Switch.cs:171:18:171:18 | 3 | Switch.cs:171:18:171:18 | 3 | match | +| Switch.cs:171:18:171:18 | 3 | Switch.cs:171:18:171:18 | 3 | no-match | +| Switch.cs:172:17:172:45 | call to method WriteLine | Switch.cs:172:17:172:45 | call to method WriteLine | normal | +| Switch.cs:172:17:172:46 | ...; | Switch.cs:172:17:172:45 | call to method WriteLine | normal | +| Switch.cs:172:42:172:44 | "3" | Switch.cs:172:42:172:44 | "3" | normal | +| Switch.cs:173:17:173:22 | break; | Switch.cs:173:17:173:22 | break; | break | +| Switch.cs:174:13:174:20 | default: | Switch.cs:175:17:175:47 | call to method WriteLine | normal | +| Switch.cs:175:17:175:47 | call to method WriteLine | Switch.cs:175:17:175:47 | call to method WriteLine | normal | +| Switch.cs:175:17:175:48 | ...; | Switch.cs:175:17:175:47 | call to method WriteLine | normal | +| Switch.cs:175:42:175:46 | "def" | Switch.cs:175:42:175:46 | "def" | normal | +| Switch.cs:176:17:176:22 | break; | Switch.cs:176:17:176:22 | break; | break | | TypeAccesses.cs:1:7:1:18 | call to constructor Object | TypeAccesses.cs:1:7:1:18 | call to constructor Object | normal | | TypeAccesses.cs:1:7:1:18 | {...} | TypeAccesses.cs:1:7:1:18 | {...} | normal | | TypeAccesses.cs:4:5:9:5 | {...} | TypeAccesses.cs:8:13:8:27 | Type t = ... | normal | diff --git a/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected b/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected index 5b3860e04ede..fdaf608cd445 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected @@ -4145,6 +4145,33 @@ | Switch.cs:160:40:160:43 | "b = " | Switch.cs:160:45:160:45 | access to local variable s | | | Switch.cs:160:44:160:46 | {...} | Switch.cs:160:38:160:47 | $"..." | | | Switch.cs:160:45:160:45 | access to local variable s | Switch.cs:160:44:160:46 | {...} | | +| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:164:5:178:5 | {...} | | +| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | exit M16 | | +| Switch.cs:164:5:178:5 | {...} | Switch.cs:165:9:177:9 | switch (...) {...} | | +| Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:165:17:165:17 | access to parameter i | | +| Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:167:13:167:19 | case ...: | | +| Switch.cs:167:13:167:19 | case ...: | Switch.cs:167:18:167:18 | 1 | | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:168:13:168:19 | case ...: | match, no-match | +| Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:18:168:18 | 2 | | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:169:17:169:51 | ...; | match | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:170:17:170:22 | break; | no-match | +| Switch.cs:168:18:168:18 | 2 | Switch.cs:171:13:171:19 | case ...: | no-match | +| Switch.cs:169:17:169:50 | call to method WriteLine | Switch.cs:170:17:170:22 | break; | | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:169:42:169:49 | "1 or 2" | | +| Switch.cs:169:42:169:49 | "1 or 2" | Switch.cs:169:17:169:50 | call to method WriteLine | | +| Switch.cs:170:17:170:22 | break; | Switch.cs:163:10:163:12 | exit M16 (normal) | break | +| Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:18:171:18 | 3 | | +| Switch.cs:171:18:171:18 | 3 | Switch.cs:172:17:172:46 | ...; | match | +| Switch.cs:171:18:171:18 | 3 | Switch.cs:174:13:174:20 | default: | no-match | +| Switch.cs:172:17:172:45 | call to method WriteLine | Switch.cs:173:17:173:22 | break; | | +| Switch.cs:172:17:172:46 | ...; | Switch.cs:172:42:172:44 | "3" | | +| Switch.cs:172:42:172:44 | "3" | Switch.cs:172:17:172:45 | call to method WriteLine | | +| Switch.cs:173:17:173:22 | break; | Switch.cs:163:10:163:12 | exit M16 (normal) | break | +| Switch.cs:174:13:174:20 | default: | Switch.cs:175:17:175:48 | ...; | | +| Switch.cs:175:17:175:47 | call to method WriteLine | Switch.cs:176:17:176:22 | break; | | +| Switch.cs:175:17:175:48 | ...; | Switch.cs:175:42:175:46 | "def" | | +| Switch.cs:175:42:175:46 | "def" | Switch.cs:175:17:175:47 | call to method WriteLine | | +| Switch.cs:176:17:176:22 | break; | Switch.cs:163:10:163:12 | exit M16 (normal) | break | | TypeAccesses.cs:1:7:1:18 | call to constructor Object | TypeAccesses.cs:1:7:1:18 | {...} | | | TypeAccesses.cs:1:7:1:18 | enter TypeAccesses | TypeAccesses.cs:1:7:1:18 | call to constructor Object | | | TypeAccesses.cs:1:7:1:18 | exit TypeAccesses (normal) | TypeAccesses.cs:1:7:1:18 | exit TypeAccesses | | diff --git a/csharp/ql/test/library-tests/controlflow/graph/Nodes.expected b/csharp/ql/test/library-tests/controlflow/graph/Nodes.expected index 72ad97ec2bb9..7c5a64b7155e 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Nodes.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/Nodes.expected @@ -1256,6 +1256,7 @@ entryPoint | Switch.cs:134:9:134:11 | M13 | Switch.cs:135:5:142:5 | {...} | | Switch.cs:144:9:144:11 | M14 | Switch.cs:145:5:152:5 | {...} | | Switch.cs:154:10:154:12 | M15 | Switch.cs:155:5:161:5 | {...} | +| Switch.cs:163:10:163:12 | M16 | Switch.cs:164:5:178:5 | {...} | | TypeAccesses.cs:1:7:1:18 | TypeAccesses | TypeAccesses.cs:1:7:1:18 | call to constructor Object | | TypeAccesses.cs:3:10:3:10 | M | TypeAccesses.cs:4:5:9:5 | {...} | | VarDecls.cs:3:7:3:14 | VarDecls | VarDecls.cs:3:7:3:14 | call to constructor Object | diff --git a/csharp/ql/test/library-tests/controlflow/graph/Switch.cs b/csharp/ql/test/library-tests/controlflow/graph/Switch.cs index 45912ead10e5..9bcd57c57d0e 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Switch.cs +++ b/csharp/ql/test/library-tests/controlflow/graph/Switch.cs @@ -159,4 +159,21 @@ void M15(bool b) else System.Console.WriteLine($"b = {s}"); } + + void M16(int i) + { + switch (i) + { + case 1: + case 2: + System.Console.WriteLine("1 or 2"); + break; + case 3: + System.Console.WriteLine("3"); + break; + default: + System.Console.WriteLine("def"); + break; + } + } } From e79a906426bbc402718d589c516ff2eabfb9426d Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 25 Apr 2025 11:48:30 +0200 Subject: [PATCH 200/240] C#: Fix CFG for fall-through switch statements --- csharp/ql/lib/semmle/code/csharp/Stmt.qll | 9 +++++++-- .../controlflow/internal/ControlFlowGraphImpl.qll | 8 +++++++- .../controlflow/graph/BasicBlock.expected | 3 +-- .../controlflow/graph/Condition.expected | 11 ----------- .../controlflow/graph/Dominance.expected | 14 ++------------ .../controlflow/graph/EnclosingCallable.expected | 1 - .../controlflow/graph/ExitElement.expected | 1 - .../controlflow/graph/NodeGraph.expected | 4 ++-- 8 files changed, 19 insertions(+), 32 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/Stmt.qll b/csharp/ql/lib/semmle/code/csharp/Stmt.qll index a7bbfb938616..aea8b0378196 100644 --- a/csharp/ql/lib/semmle/code/csharp/Stmt.qll +++ b/csharp/ql/lib/semmle/code/csharp/Stmt.qll @@ -278,9 +278,14 @@ class CaseStmt extends Case, @case_stmt { override PatternExpr getPattern() { result = this.getChild(0) } override Stmt getBody() { - exists(int i | + exists(int i, Stmt next | this = this.getParent().getChild(i) and - result = this.getParent().getChild(i + 1) + next = this.getParent().getChild(i + 1) + | + result = next and + not result instanceof CaseStmt + or + result = next.(CaseStmt).getBody() ) } diff --git a/csharp/ql/lib/semmle/code/csharp/controlflow/internal/ControlFlowGraphImpl.qll b/csharp/ql/lib/semmle/code/csharp/controlflow/internal/ControlFlowGraphImpl.qll index e4f1891012f2..74cb070635b2 100644 --- a/csharp/ql/lib/semmle/code/csharp/controlflow/internal/ControlFlowGraphImpl.qll +++ b/csharp/ql/lib/semmle/code/csharp/controlflow/internal/ControlFlowGraphImpl.qll @@ -1153,7 +1153,13 @@ module Statements { ) or // Flow from last element of `case` statement `i` to first element of statement `i+1` - exists(int i | last(super.getStmt(i).(CaseStmt).getBody(), pred, c) | + exists(int i, Stmt body | + body = super.getStmt(i).(CaseStmt).getBody() and + // in case of fall-through cases, make sure to not jump from their shared body back + // to one of the fall-through cases + not body = super.getStmt(i + 1).(CaseStmt).getBody() and + last(body, pred, c) + | c instanceof NormalCompletion and first(super.getStmt(i + 1), succ) ) diff --git a/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected b/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected index 41e3b0918f17..6177eb7e3350 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected @@ -1081,8 +1081,7 @@ | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:167:18:167:18 | 1 | 6 | | Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | exit M16 | 2 | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:18:168:18 | 2 | 2 | -| Switch.cs:169:17:169:51 | ...; | Switch.cs:169:17:169:50 | call to method WriteLine | 3 | -| Switch.cs:170:17:170:22 | break; | Switch.cs:170:17:170:22 | break; | 1 | +| Switch.cs:169:17:169:51 | ...; | Switch.cs:170:17:170:22 | break; | 4 | | Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:18:171:18 | 3 | 2 | | Switch.cs:172:17:172:46 | ...; | Switch.cs:173:17:173:22 | break; | 4 | | Switch.cs:174:13:174:20 | default: | Switch.cs:176:17:176:22 | break; | 5 | diff --git a/csharp/ql/test/library-tests/controlflow/graph/Condition.expected b/csharp/ql/test/library-tests/controlflow/graph/Condition.expected index 1d1baa042cea..a59100474ea6 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Condition.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/Condition.expected @@ -2140,21 +2140,10 @@ conditionBlock | Switch.cs:156:17:156:54 | ... switch { ... } | Switch.cs:158:13:158:49 | ...; | true | | Switch.cs:156:17:156:54 | ... switch { ... } | Switch.cs:160:13:160:49 | ...; | false | | Switch.cs:156:41:156:45 | false | Switch.cs:156:50:156:52 | "b" | true | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | exit M16 (normal) | false | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | exit M16 (normal) | true | | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:168:13:168:19 | case ...: | false | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:168:13:168:19 | case ...: | true | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:169:17:169:51 | ...; | false | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:169:17:169:51 | ...; | true | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:170:17:170:22 | break; | false | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:170:17:170:22 | break; | true | | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:171:13:171:19 | case ...: | false | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:171:13:171:19 | case ...: | true | | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:172:17:172:46 | ...; | false | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:172:17:172:46 | ...; | true | | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:174:13:174:20 | default: | false | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:174:13:174:20 | default: | true | -| Switch.cs:168:13:168:19 | case ...: | Switch.cs:169:17:169:51 | ...; | true | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:171:13:171:19 | case ...: | false | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:172:17:172:46 | ...; | false | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:174:13:174:20 | default: | false | diff --git a/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected b/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected index 3f80ba98b569..f0a0c6459cbb 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected @@ -3685,10 +3685,10 @@ dominance | Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:167:13:167:19 | case ...: | | Switch.cs:167:13:167:19 | case ...: | Switch.cs:167:18:167:18 | 1 | | Switch.cs:167:18:167:18 | 1 | Switch.cs:168:13:168:19 | case ...: | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:169:17:169:51 | ...; | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:18:168:18 | 2 | -| Switch.cs:168:18:168:18 | 2 | Switch.cs:169:17:169:51 | ...; | -| Switch.cs:168:18:168:18 | 2 | Switch.cs:170:17:170:22 | break; | | Switch.cs:168:18:168:18 | 2 | Switch.cs:171:13:171:19 | case ...: | +| Switch.cs:169:17:169:50 | call to method WriteLine | Switch.cs:170:17:170:22 | break; | | Switch.cs:169:17:169:51 | ...; | Switch.cs:169:42:169:49 | "1 or 2" | | Switch.cs:169:42:169:49 | "1 or 2" | Switch.cs:169:17:169:50 | call to method WriteLine | | Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:18:171:18 | 3 | @@ -7886,7 +7886,6 @@ postDominance | Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:165:9:177:9 | switch (...) {...} | | Switch.cs:167:13:167:19 | case ...: | Switch.cs:165:17:165:17 | access to parameter i | | Switch.cs:167:18:167:18 | 1 | Switch.cs:167:13:167:19 | case ...: | -| Switch.cs:168:13:168:19 | case ...: | Switch.cs:167:18:167:18 | 1 | | Switch.cs:168:18:168:18 | 2 | Switch.cs:168:13:168:19 | case ...: | | Switch.cs:169:17:169:50 | call to method WriteLine | Switch.cs:169:42:169:49 | "1 or 2" | | Switch.cs:169:42:169:49 | "1 or 2" | Switch.cs:169:17:169:51 | ...; | @@ -12516,20 +12515,15 @@ blockDominance | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:163:10:163:12 | exit M16 (normal) | | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:168:13:168:19 | case ...: | | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:169:17:169:51 | ...; | -| Switch.cs:163:10:163:12 | enter M16 | Switch.cs:170:17:170:22 | break; | | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:171:13:171:19 | case ...: | | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:172:17:172:46 | ...; | | Switch.cs:163:10:163:12 | enter M16 | Switch.cs:174:13:174:20 | default: | | Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | exit M16 (normal) | -| Switch.cs:168:13:168:19 | case ...: | Switch.cs:163:10:163:12 | exit M16 (normal) | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:13:168:19 | case ...: | -| Switch.cs:168:13:168:19 | case ...: | Switch.cs:169:17:169:51 | ...; | -| Switch.cs:168:13:168:19 | case ...: | Switch.cs:170:17:170:22 | break; | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:171:13:171:19 | case ...: | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:172:17:172:46 | ...; | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:174:13:174:20 | default: | | Switch.cs:169:17:169:51 | ...; | Switch.cs:169:17:169:51 | ...; | -| Switch.cs:170:17:170:22 | break; | Switch.cs:170:17:170:22 | break; | | Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:13:171:19 | case ...: | | Switch.cs:171:13:171:19 | case ...: | Switch.cs:172:17:172:46 | ...; | | Switch.cs:171:13:171:19 | case ...: | Switch.cs:174:13:174:20 | default: | @@ -15867,15 +15861,11 @@ postBlockDominance | Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | exit M16 (normal) | | Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:168:13:168:19 | case ...: | | Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:169:17:169:51 | ...; | -| Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:170:17:170:22 | break; | | Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:171:13:171:19 | case ...: | | Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:172:17:172:46 | ...; | | Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:174:13:174:20 | default: | -| Switch.cs:168:13:168:19 | case ...: | Switch.cs:163:10:163:12 | enter M16 | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:13:168:19 | case ...: | | Switch.cs:169:17:169:51 | ...; | Switch.cs:169:17:169:51 | ...; | -| Switch.cs:170:17:170:22 | break; | Switch.cs:169:17:169:51 | ...; | -| Switch.cs:170:17:170:22 | break; | Switch.cs:170:17:170:22 | break; | | Switch.cs:171:13:171:19 | case ...: | Switch.cs:171:13:171:19 | case ...: | | Switch.cs:172:17:172:46 | ...; | Switch.cs:172:17:172:46 | ...; | | Switch.cs:174:13:174:20 | default: | Switch.cs:174:13:174:20 | default: | diff --git a/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected b/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected index b5d2ec33899a..fd87b8db0584 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected @@ -5942,7 +5942,6 @@ blockEnclosing | Switch.cs:163:10:163:12 | exit M16 (normal) | Switch.cs:163:10:163:12 | M16 | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:163:10:163:12 | M16 | | Switch.cs:169:17:169:51 | ...; | Switch.cs:163:10:163:12 | M16 | -| Switch.cs:170:17:170:22 | break; | Switch.cs:163:10:163:12 | M16 | | Switch.cs:171:13:171:19 | case ...: | Switch.cs:163:10:163:12 | M16 | | Switch.cs:172:17:172:46 | ...; | Switch.cs:163:10:163:12 | M16 | | Switch.cs:174:13:174:20 | default: | Switch.cs:163:10:163:12 | M16 | diff --git a/csharp/ql/test/library-tests/controlflow/graph/ExitElement.expected b/csharp/ql/test/library-tests/controlflow/graph/ExitElement.expected index 84e8ab1cc2a6..495c74f169c3 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/ExitElement.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/ExitElement.expected @@ -3589,7 +3589,6 @@ | Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:176:17:176:22 | break; | normal [break] (0) | | Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:165:17:165:17 | access to parameter i | normal | | Switch.cs:167:13:167:19 | case ...: | Switch.cs:167:18:167:18 | 1 | no-match | -| Switch.cs:167:13:167:19 | case ...: | Switch.cs:168:18:168:18 | 2 | no-match | | Switch.cs:167:13:167:19 | case ...: | Switch.cs:169:17:169:50 | call to method WriteLine | normal | | Switch.cs:167:18:167:18 | 1 | Switch.cs:167:18:167:18 | 1 | match | | Switch.cs:167:18:167:18 | 1 | Switch.cs:167:18:167:18 | 1 | no-match | diff --git a/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected b/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected index fdaf608cd445..1664d77538a6 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected @@ -4151,10 +4151,10 @@ | Switch.cs:165:9:177:9 | switch (...) {...} | Switch.cs:165:17:165:17 | access to parameter i | | | Switch.cs:165:17:165:17 | access to parameter i | Switch.cs:167:13:167:19 | case ...: | | | Switch.cs:167:13:167:19 | case ...: | Switch.cs:167:18:167:18 | 1 | | -| Switch.cs:167:18:167:18 | 1 | Switch.cs:168:13:168:19 | case ...: | match, no-match | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:168:13:168:19 | case ...: | no-match | +| Switch.cs:167:18:167:18 | 1 | Switch.cs:169:17:169:51 | ...; | match | | Switch.cs:168:13:168:19 | case ...: | Switch.cs:168:18:168:18 | 2 | | | Switch.cs:168:18:168:18 | 2 | Switch.cs:169:17:169:51 | ...; | match | -| Switch.cs:168:18:168:18 | 2 | Switch.cs:170:17:170:22 | break; | no-match | | Switch.cs:168:18:168:18 | 2 | Switch.cs:171:13:171:19 | case ...: | no-match | | Switch.cs:169:17:169:50 | call to method WriteLine | Switch.cs:170:17:170:22 | break; | | | Switch.cs:169:17:169:51 | ...; | Switch.cs:169:42:169:49 | "1 or 2" | | From e8eac810b42e65d2b8518baccfa304bcff17e40b Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 25 Apr 2025 11:56:28 +0200 Subject: [PATCH 201/240] Swift: Commit external sources to git LFS --- swift/third_party/load.bzl | 4 ---- swift/third_party/resources/resource-dir-linux.zip | 4 ++-- swift/third_party/resources/resource-dir-macos.zip | 4 ++-- swift/third_party/resources/swift-prebuilt-linux.tar.zst | 4 ++-- swift/third_party/resources/swift-prebuilt-macos.tar.zst | 4 ++-- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/swift/third_party/load.bzl b/swift/third_party/load.bzl index 8c891a26fc38..d19345a18803 100644 --- a/swift/third_party/load.bzl +++ b/swift/third_party/load.bzl @@ -5,10 +5,6 @@ load("//misc/bazel:lfs.bzl", "lfs_archive", "lfs_files") _override = { # these are used to test new artifacts. Must be empty before merging to main - "swift-prebuilt-macOS-swift-6.1-RELEASE-78.tar.zst": "4dcfe858b5519327c9b0c99735b47fe75c7a5090793d917de1ba6e42795aa86d", - "swift-prebuilt-Linux-swift-6.1-RELEASE-78.tar.zst": "d01b90bccfec46995bdf98a59339bd94e64257da99b4963148869c4a108bc2a9", - "resource-dir-macOS-swift-6.1-RELEASE-91.zip": "12bef89163486ac24d9ca00a5cc6ef3851b633e6fa63b7493c518e4d426e036c", - "resource-dir-Linux-swift-6.1-RELEASE-91.zip": "874932f93c4ca6269ae3a9e9c841916b3fd88f65f5018eec8777a52dde56901d", } _staging_url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/staging-{}/{}" diff --git a/swift/third_party/resources/resource-dir-linux.zip b/swift/third_party/resources/resource-dir-linux.zip index 2c45df3aa031..8697b7c7afc5 100644 --- a/swift/third_party/resources/resource-dir-linux.zip +++ b/swift/third_party/resources/resource-dir-linux.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:403374c72e20299951c2c37185404500d15340baaa52bb2d06f8815b03f8071e -size 318874108 +oid sha256:874932f93c4ca6269ae3a9e9c841916b3fd88f65f5018eec8777a52dde56901d +size 293646067 diff --git a/swift/third_party/resources/resource-dir-macos.zip b/swift/third_party/resources/resource-dir-macos.zip index c358585ea656..95ffbc2e02ff 100644 --- a/swift/third_party/resources/resource-dir-macos.zip +++ b/swift/third_party/resources/resource-dir-macos.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:38f48790fea144b7cf5918b885f32a0f68e21aa5f3c2f0a5722573cc9e950639 -size 653096176 +oid sha256:12bef89163486ac24d9ca00a5cc6ef3851b633e6fa63b7493c518e4d426e036c +size 595744464 diff --git a/swift/third_party/resources/swift-prebuilt-linux.tar.zst b/swift/third_party/resources/swift-prebuilt-linux.tar.zst index 0a1fe2b3f4de..03490187210c 100644 --- a/swift/third_party/resources/swift-prebuilt-linux.tar.zst +++ b/swift/third_party/resources/swift-prebuilt-linux.tar.zst @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:af1e3355fb476538449424a74f15ce21a0f877c7f85a568e736f0bd6c0239a8f -size 118694583 +oid sha256:d01b90bccfec46995bdf98a59339bd94e64257da99b4963148869c4a108bc2a9 +size 124360007 diff --git a/swift/third_party/resources/swift-prebuilt-macos.tar.zst b/swift/third_party/resources/swift-prebuilt-macos.tar.zst index f69024bd10d2..692a8b05dc3b 100644 --- a/swift/third_party/resources/swift-prebuilt-macos.tar.zst +++ b/swift/third_party/resources/swift-prebuilt-macos.tar.zst @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c81917da67ff2bb642ef2e34e005466b06f756c958702ec070bcacdb83c2f76 -size 101405609 +oid sha256:4dcfe858b5519327c9b0c99735b47fe75c7a5090793d917de1ba6e42795aa86d +size 105011965 From 0b5a4a913369559429aefd3cc8c997646030187c Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 25 Apr 2025 12:44:38 +0200 Subject: [PATCH 202/240] Swift: Clarify how the LFS artifacts should be updated --- swift/third_party/resources/updating.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/third_party/resources/updating.md b/swift/third_party/resources/updating.md index 472e74a8b3e5..2a5184e05628 100644 --- a/swift/third_party/resources/updating.md +++ b/swift/third_party/resources/updating.md @@ -13,7 +13,7 @@ In order to perform a Swift update: `SwiftTagTraits.h`](../../extractor/infra/SwiftTagTraits.h). 5. Open a draft PR with the overridden artifacts. Make sure CI passes, go back to 4. otherwise. 6. Run DCA, got back to 4. in case of problems. -7. Once you are happy, do +7. Once you are happy, run the following from the root of the CodeQL repository: ```bash bazel run //swift/third_party/resources:update-dir-macos bazel run //swift/third_party/resources:update-dir-linux From cafe1efefa9c85da7df8d53a61641b15b3fe0ac0 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 25 Apr 2025 12:30:48 +0100 Subject: [PATCH 203/240] Go: Refactor `ApplyProxyEnvVars` --- go/extractor/util/registryproxy.go | 71 +++++++++++++++++++----------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/go/extractor/util/registryproxy.go b/go/extractor/util/registryproxy.go index 71071e838146..94c8b7d281ab 100644 --- a/go/extractor/util/registryproxy.go +++ b/go/extractor/util/registryproxy.go @@ -20,10 +20,23 @@ type RegistryConfig struct { URL string `json:"url"` } +// The address of the proxy including protocol and port (e.g. http://localhost:1234) var proxy_address string + +// The path to the temporary file that stores the proxy certificate, if any. var proxy_cert_file string + +// An array of registry configurations that are relevant to Go. +// This excludes other registry configurations that may be available, but are not relevant to Go. var proxy_configs []RegistryConfig +// Stores the environment variables that we wish to pass on to `go` commands. +var proxy_vars []string = nil + +// Keeps track of whether we have inspected the proxy environment variables. +// Needed since `proxy_vars` may be nil either way. +var proxy_vars_checked bool = false + // Tries to parse the given string value into an array of RegistryConfig values. func parseRegistryConfigs(str string) ([]RegistryConfig, error) { var configs []RegistryConfig @@ -34,10 +47,21 @@ func parseRegistryConfigs(str string) ([]RegistryConfig, error) { return configs, nil } -func checkEnvVars() { +func getEnvVars() []string { + // If `proxy_vars` has been initialised, then we have already performed + // these checks and don't need to do so again. We assume that the environment + // variables are constant throughout the run of the autobuilder. + if proxy_vars != nil { + return proxy_vars + } + + var result []string + if proxy_host, proxy_host_set := os.LookupEnv(PROXY_HOST); proxy_host_set { if proxy_port, proxy_port_set := os.LookupEnv(PROXY_PORT); proxy_port_set { proxy_address = fmt.Sprintf("http://%s:%s", proxy_host, proxy_port) + result = append(result, fmt.Sprintf("HTTP_PROXY=%s", proxy_address), fmt.Sprintf("HTTPS_PROXY=%s", proxy_address)) + slog.Info("Found private registry proxy", slog.String("proxy_address", proxy_address)) } } @@ -61,6 +85,7 @@ func checkEnvVars() { slog.Error("Failed to close the temporary certificate file", slog.String("error", err.Error())) } else { proxy_cert_file = f.Name() + result = append(result, fmt.Sprintf("SSL_CERT_FILE=%s", proxy_cert_file)) } } @@ -71,47 +96,43 @@ func checkEnvVars() { } else { // We only care about private registry configurations that are relevant to Go and // filter others out at this point. - proxy_configs = make([]RegistryConfig, 0) for _, cfg := range val { if cfg.Type == GOPROXY_SERVER { proxy_configs = append(proxy_configs, cfg) slog.Info("Found GOPROXY server", slog.String("url", cfg.URL)) } } + + if len(proxy_configs) > 0 { + goproxy_val := "https://proxy.golang.org,direct" + + for _, cfg := range proxy_configs { + goproxy_val = cfg.URL + "," + goproxy_val + } + + result = append(result, fmt.Sprintf("GOPROXY=%s", goproxy_val), "GOPRIVATE=", "GONOPROXY=") + } } } } // Applies private package proxy related environment variables to `cmd`. func ApplyProxyEnvVars(cmd *exec.Cmd) { - slog.Info( + slog.Debug( "Applying private registry proxy environment variables", slog.String("cmd_args", strings.Join(cmd.Args, " ")), ) - checkEnvVars() - - // Preserve environment variables - cmd.Env = os.Environ() - - if proxy_address != "" { - cmd.Env = append(cmd.Env, fmt.Sprintf("HTTP_PROXY=%s", proxy_address)) - cmd.Env = append(cmd.Env, fmt.Sprintf("HTTPS_PROXY=%s", proxy_address)) + // If we haven't done so yet, check whether the proxy environment variables are set + // and extract information from them. + if !proxy_vars_checked { + proxy_vars = getEnvVars() + proxy_vars_checked = true } - if proxy_cert_file != "" { - slog.Info("Setting SSL_CERT_FILE", slog.String("proxy_cert_file", proxy_cert_file)) - cmd.Env = append(cmd.Env, fmt.Sprintf("SSL_CERT_FILE=%s", proxy_cert_file)) - } - - if len(proxy_configs) > 0 { - goproxy_val := "https://proxy.golang.org,direct" - - for _, cfg := range proxy_configs { - goproxy_val = cfg.URL + "," + goproxy_val - } - cmd.Env = append(cmd.Env, fmt.Sprintf("GOPROXY=%s", goproxy_val)) - cmd.Env = append(cmd.Env, "GOPRIVATE=") - cmd.Env = append(cmd.Env, "GONOPROXY=") + // If the proxy is configured, `proxy_vars` will be not `nil`. We append those + // variables Preserve environment variables + if proxy_vars != nil { + cmd.Env = append(os.Environ(), proxy_vars...) } } From 4c9aee2cc7bc889cec3cba996bc05d214142f9c4 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Wed, 23 Apr 2025 13:28:20 +0200 Subject: [PATCH 204/240] Add query suite tests for swift with shared logic --- .../java/query-suite/test.py | 30 +++++++---------- misc/pytest/lib/query-suite-test.py | 23 +++++++++++++ .../query-suite/not_included_in_qls.expected | 9 ++++++ .../swift-code-quality.qls.expected | 1 + .../swift-code-scanning.qls.expected | 31 ++++++++++++++++++ .../swift-security-and-quality.qls.expected | 32 +++++++++++++++++++ .../swift-security-extended.qls.expected | 32 +++++++++++++++++++ .../posix/query-suite/test.py | 23 +++++++++++++ 8 files changed, 163 insertions(+), 18 deletions(-) create mode 100644 misc/pytest/lib/query-suite-test.py create mode 100644 swift/ql/integration-tests/posix/query-suite/not_included_in_qls.expected create mode 100644 swift/ql/integration-tests/posix/query-suite/swift-code-quality.qls.expected create mode 100644 swift/ql/integration-tests/posix/query-suite/swift-code-scanning.qls.expected create mode 100644 swift/ql/integration-tests/posix/query-suite/swift-security-and-quality.qls.expected create mode 100644 swift/ql/integration-tests/posix/query-suite/swift-security-extended.qls.expected create mode 100644 swift/ql/integration-tests/posix/query-suite/test.py diff --git a/java/ql/integration-tests/java/query-suite/test.py b/java/ql/integration-tests/java/query-suite/test.py index 83551ecfc19c..b87e48b7f15a 100644 --- a/java/ql/integration-tests/java/query-suite/test.py +++ b/java/ql/integration-tests/java/query-suite/test.py @@ -1,29 +1,23 @@ -import os import runs_on import pytest +import sys + +def get_test_module(semmle_code_dir): + import importlib.util + spec = importlib.util.spec_from_file_location('test-module', semmle_code_dir / 'ql' / 'misc' / 'pytest' / 'lib' / 'query-suite-test.py') + mod = importlib.util.module_from_spec(spec) + sys.modules["test-module"] = mod + spec.loader.exec_module(mod) + return mod well_known_query_suites = ['java-code-quality.qls', 'java-security-and-quality.qls', 'java-security-extended.qls', 'java-code-scanning.qls'] @runs_on.posix @pytest.mark.parametrize("query_suite", well_known_query_suites) def test(codeql, java, cwd, expected_files, semmle_code_dir, query_suite): - actual = codeql.resolve.queries(query_suite, _capture=True).strip() - actual = sorted(actual.splitlines()) - actual = [os.path.relpath(q, semmle_code_dir) for q in actual] - actual_file_name = query_suite + '.actual' - expected_files.add(actual_file_name) - (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') + get_test_module(semmle_code_dir).test(codeql, cwd, expected_files, semmle_code_dir, query_suite) + @runs_on.posix def test_not_included_queries(codeql, java, cwd, expected_files, semmle_code_dir): - all_queries = codeql.resolve.queries(semmle_code_dir / 'ql' / 'java' / 'ql' / 'src', _capture=True).strip().splitlines() - - included_in_qls = set() - for query_suite in well_known_query_suites: - included_in_qls |= set(codeql.resolve.queries(query_suite, _capture=True).strip().splitlines()) - - not_included = sorted(set(all_queries) - included_in_qls) - not_included = [os.path.relpath(q, semmle_code_dir) for q in not_included] - not_included_file_name = 'not_included_in_qls.actual' - expected_files.add(not_included_file_name) - (cwd / not_included_file_name).write_text('\n'.join(not_included)+'\n') + get_test_module(semmle_code_dir).test_not_included_queries(codeql, 'java', cwd, expected_files, semmle_code_dir, well_known_query_suites) diff --git a/misc/pytest/lib/query-suite-test.py b/misc/pytest/lib/query-suite-test.py new file mode 100644 index 000000000000..f25397f459d8 --- /dev/null +++ b/misc/pytest/lib/query-suite-test.py @@ -0,0 +1,23 @@ + +import os + +def test(codeql, cwd, expected_files, semmle_code_dir, query_suite): + actual = codeql.resolve.queries(query_suite, _capture=True).strip() + actual = sorted(actual.splitlines()) + actual = [os.path.relpath(q, semmle_code_dir) for q in actual] + actual_file_name = query_suite + '.actual' + expected_files.add(actual_file_name) + (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') + +def test_not_included_queries(codeql, lang_folder_name, cwd, expected_files, semmle_code_dir, query_suites): + all_queries = codeql.resolve.queries(semmle_code_dir / 'ql' / lang_folder_name / 'ql' / 'src', _capture=True).strip().splitlines() + + included_in_qls = set() + for query_suite in query_suites: + included_in_qls |= set(codeql.resolve.queries(query_suite, _capture=True).strip().splitlines()) + + not_included = sorted(set(all_queries) - included_in_qls) + not_included = [os.path.relpath(q, semmle_code_dir) for q in not_included] + not_included_file_name = 'not_included_in_qls.actual' + expected_files.add(not_included_file_name) + (cwd / not_included_file_name).write_text('\n'.join(not_included)+'\n') diff --git a/swift/ql/integration-tests/posix/query-suite/not_included_in_qls.expected b/swift/ql/integration-tests/posix/query-suite/not_included_in_qls.expected new file mode 100644 index 000000000000..64c776d96d1d --- /dev/null +++ b/swift/ql/integration-tests/posix/query-suite/not_included_in_qls.expected @@ -0,0 +1,9 @@ +ql/swift/ql/src/AlertSuppression.ql +ql/swift/ql/src/experimental/Security/CWE-022/UnsafeUnpack.ql +ql/swift/ql/src/queries/Summary/FlowSources.ql +ql/swift/ql/src/queries/Summary/QuerySinks.ql +ql/swift/ql/src/queries/Summary/RegexEvals.ql +ql/swift/ql/src/queries/Summary/SensitiveExprs.ql +ql/swift/ql/src/queries/Summary/SummaryStats.ql +ql/swift/ql/src/queries/Summary/TaintReach.ql +ql/swift/ql/src/queries/ide-contextual-queries/printAst.ql diff --git a/swift/ql/integration-tests/posix/query-suite/swift-code-quality.qls.expected b/swift/ql/integration-tests/posix/query-suite/swift-code-quality.qls.expected new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/swift/ql/integration-tests/posix/query-suite/swift-code-quality.qls.expected @@ -0,0 +1 @@ + diff --git a/swift/ql/integration-tests/posix/query-suite/swift-code-scanning.qls.expected b/swift/ql/integration-tests/posix/query-suite/swift-code-scanning.qls.expected new file mode 100644 index 000000000000..bee12dbfb8fa --- /dev/null +++ b/swift/ql/integration-tests/posix/query-suite/swift-code-scanning.qls.expected @@ -0,0 +1,31 @@ +ql/swift/ql/src/diagnostics/ExtractedFiles.ql +ql/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql +ql/swift/ql/src/diagnostics/internal/AstNodes.ql +ql/swift/ql/src/diagnostics/internal/ExtractionErrors.ql +ql/swift/ql/src/diagnostics/internal/UnresolvedAstNodes.ql +ql/swift/ql/src/queries/Security/CWE-020/IncompleteHostnameRegex.ql +ql/swift/ql/src/queries/Security/CWE-020/MissingRegexAnchor.ql +ql/swift/ql/src/queries/Security/CWE-022/PathInjection.ql +ql/swift/ql/src/queries/Security/CWE-078/CommandInjection.ql +ql/swift/ql/src/queries/Security/CWE-079/UnsafeWebViewFetch.ql +ql/swift/ql/src/queries/Security/CWE-089/SqlInjection.ql +ql/swift/ql/src/queries/Security/CWE-116/BadTagFilter.ql +ql/swift/ql/src/queries/Security/CWE-1204/StaticInitializationVector.ql +ql/swift/ql/src/queries/Security/CWE-1333/ReDoS.ql +ql/swift/ql/src/queries/Security/CWE-134/UncontrolledFormatString.ql +ql/swift/ql/src/queries/Security/CWE-135/StringLengthConflation.ql +ql/swift/ql/src/queries/Security/CWE-259/ConstantPassword.ql +ql/swift/ql/src/queries/Security/CWE-311/CleartextStorageDatabase.ql +ql/swift/ql/src/queries/Security/CWE-311/CleartextTransmission.ql +ql/swift/ql/src/queries/Security/CWE-312/CleartextLogging.ql +ql/swift/ql/src/queries/Security/CWE-312/CleartextStoragePreferences.ql +ql/swift/ql/src/queries/Security/CWE-321/HardcodedEncryptionKey.ql +ql/swift/ql/src/queries/Security/CWE-327/ECBEncryption.ql +ql/swift/ql/src/queries/Security/CWE-328/WeakPasswordHashing.ql +ql/swift/ql/src/queries/Security/CWE-328/WeakSensitiveDataHashing.ql +ql/swift/ql/src/queries/Security/CWE-611/XXE.ql +ql/swift/ql/src/queries/Security/CWE-730/RegexInjection.ql +ql/swift/ql/src/queries/Security/CWE-757/InsecureTLS.ql +ql/swift/ql/src/queries/Security/CWE-760/ConstantSalt.ql +ql/swift/ql/src/queries/Security/CWE-916/InsufficientHashIterations.ql +ql/swift/ql/src/queries/Security/CWE-943/PredicateInjection.ql diff --git a/swift/ql/integration-tests/posix/query-suite/swift-security-and-quality.qls.expected b/swift/ql/integration-tests/posix/query-suite/swift-security-and-quality.qls.expected new file mode 100644 index 000000000000..412d0816affc --- /dev/null +++ b/swift/ql/integration-tests/posix/query-suite/swift-security-and-quality.qls.expected @@ -0,0 +1,32 @@ +ql/swift/ql/src/diagnostics/ExtractedFiles.ql +ql/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql +ql/swift/ql/src/diagnostics/internal/AstNodes.ql +ql/swift/ql/src/diagnostics/internal/ExtractionErrors.ql +ql/swift/ql/src/diagnostics/internal/UnresolvedAstNodes.ql +ql/swift/ql/src/queries/Security/CWE-020/IncompleteHostnameRegex.ql +ql/swift/ql/src/queries/Security/CWE-020/MissingRegexAnchor.ql +ql/swift/ql/src/queries/Security/CWE-022/PathInjection.ql +ql/swift/ql/src/queries/Security/CWE-078/CommandInjection.ql +ql/swift/ql/src/queries/Security/CWE-079/UnsafeWebViewFetch.ql +ql/swift/ql/src/queries/Security/CWE-089/SqlInjection.ql +ql/swift/ql/src/queries/Security/CWE-094/UnsafeJsEval.ql +ql/swift/ql/src/queries/Security/CWE-116/BadTagFilter.ql +ql/swift/ql/src/queries/Security/CWE-1204/StaticInitializationVector.ql +ql/swift/ql/src/queries/Security/CWE-1333/ReDoS.ql +ql/swift/ql/src/queries/Security/CWE-134/UncontrolledFormatString.ql +ql/swift/ql/src/queries/Security/CWE-135/StringLengthConflation.ql +ql/swift/ql/src/queries/Security/CWE-259/ConstantPassword.ql +ql/swift/ql/src/queries/Security/CWE-311/CleartextStorageDatabase.ql +ql/swift/ql/src/queries/Security/CWE-311/CleartextTransmission.ql +ql/swift/ql/src/queries/Security/CWE-312/CleartextLogging.ql +ql/swift/ql/src/queries/Security/CWE-312/CleartextStoragePreferences.ql +ql/swift/ql/src/queries/Security/CWE-321/HardcodedEncryptionKey.ql +ql/swift/ql/src/queries/Security/CWE-327/ECBEncryption.ql +ql/swift/ql/src/queries/Security/CWE-328/WeakPasswordHashing.ql +ql/swift/ql/src/queries/Security/CWE-328/WeakSensitiveDataHashing.ql +ql/swift/ql/src/queries/Security/CWE-611/XXE.ql +ql/swift/ql/src/queries/Security/CWE-730/RegexInjection.ql +ql/swift/ql/src/queries/Security/CWE-757/InsecureTLS.ql +ql/swift/ql/src/queries/Security/CWE-760/ConstantSalt.ql +ql/swift/ql/src/queries/Security/CWE-916/InsufficientHashIterations.ql +ql/swift/ql/src/queries/Security/CWE-943/PredicateInjection.ql diff --git a/swift/ql/integration-tests/posix/query-suite/swift-security-extended.qls.expected b/swift/ql/integration-tests/posix/query-suite/swift-security-extended.qls.expected new file mode 100644 index 000000000000..412d0816affc --- /dev/null +++ b/swift/ql/integration-tests/posix/query-suite/swift-security-extended.qls.expected @@ -0,0 +1,32 @@ +ql/swift/ql/src/diagnostics/ExtractedFiles.ql +ql/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql +ql/swift/ql/src/diagnostics/internal/AstNodes.ql +ql/swift/ql/src/diagnostics/internal/ExtractionErrors.ql +ql/swift/ql/src/diagnostics/internal/UnresolvedAstNodes.ql +ql/swift/ql/src/queries/Security/CWE-020/IncompleteHostnameRegex.ql +ql/swift/ql/src/queries/Security/CWE-020/MissingRegexAnchor.ql +ql/swift/ql/src/queries/Security/CWE-022/PathInjection.ql +ql/swift/ql/src/queries/Security/CWE-078/CommandInjection.ql +ql/swift/ql/src/queries/Security/CWE-079/UnsafeWebViewFetch.ql +ql/swift/ql/src/queries/Security/CWE-089/SqlInjection.ql +ql/swift/ql/src/queries/Security/CWE-094/UnsafeJsEval.ql +ql/swift/ql/src/queries/Security/CWE-116/BadTagFilter.ql +ql/swift/ql/src/queries/Security/CWE-1204/StaticInitializationVector.ql +ql/swift/ql/src/queries/Security/CWE-1333/ReDoS.ql +ql/swift/ql/src/queries/Security/CWE-134/UncontrolledFormatString.ql +ql/swift/ql/src/queries/Security/CWE-135/StringLengthConflation.ql +ql/swift/ql/src/queries/Security/CWE-259/ConstantPassword.ql +ql/swift/ql/src/queries/Security/CWE-311/CleartextStorageDatabase.ql +ql/swift/ql/src/queries/Security/CWE-311/CleartextTransmission.ql +ql/swift/ql/src/queries/Security/CWE-312/CleartextLogging.ql +ql/swift/ql/src/queries/Security/CWE-312/CleartextStoragePreferences.ql +ql/swift/ql/src/queries/Security/CWE-321/HardcodedEncryptionKey.ql +ql/swift/ql/src/queries/Security/CWE-327/ECBEncryption.ql +ql/swift/ql/src/queries/Security/CWE-328/WeakPasswordHashing.ql +ql/swift/ql/src/queries/Security/CWE-328/WeakSensitiveDataHashing.ql +ql/swift/ql/src/queries/Security/CWE-611/XXE.ql +ql/swift/ql/src/queries/Security/CWE-730/RegexInjection.ql +ql/swift/ql/src/queries/Security/CWE-757/InsecureTLS.ql +ql/swift/ql/src/queries/Security/CWE-760/ConstantSalt.ql +ql/swift/ql/src/queries/Security/CWE-916/InsufficientHashIterations.ql +ql/swift/ql/src/queries/Security/CWE-943/PredicateInjection.ql diff --git a/swift/ql/integration-tests/posix/query-suite/test.py b/swift/ql/integration-tests/posix/query-suite/test.py new file mode 100644 index 000000000000..5394cb8f2ccf --- /dev/null +++ b/swift/ql/integration-tests/posix/query-suite/test.py @@ -0,0 +1,23 @@ +import runs_on +import pytest +import sys + +def get_test_module(semmle_code_dir): + import importlib.util + spec = importlib.util.spec_from_file_location('test-module', semmle_code_dir / 'ql' / 'misc' / 'pytest' / 'lib' / 'query-suite-test.py') + mod = importlib.util.module_from_spec(spec) + sys.modules["test-module"] = mod + spec.loader.exec_module(mod) + return mod + + +well_known_query_suites = ['swift-code-quality.qls', 'swift-security-and-quality.qls', 'swift-security-extended.qls', 'swift-code-scanning.qls'] + +@runs_on.posix +@pytest.mark.parametrize("query_suite", well_known_query_suites) +def test(codeql, swift, cwd, expected_files, semmle_code_dir, query_suite): + get_test_module(semmle_code_dir).test(codeql, cwd, expected_files, semmle_code_dir, query_suite) + +@runs_on.posix +def test_not_included_queries(codeql, swift, cwd, expected_files, semmle_code_dir): + get_test_module(semmle_code_dir).test_not_included_queries(codeql, 'swift', cwd, expected_files, semmle_code_dir, well_known_query_suites) From 522dd51416ec33b5be635a864d1c84e287c6fed3 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Thu, 24 Apr 2025 08:35:48 +0200 Subject: [PATCH 205/240] Improve query suite test based on feedback --- .../java/query-suite/test.py | 19 ++++-------- misc/pytest/lib/query-suite-test.py | 23 -------------- misc/pytest/lib/query_suites.py | 30 +++++++++++++++++++ .../posix/query-suite/test.py | 19 ++++-------- 4 files changed, 40 insertions(+), 51 deletions(-) delete mode 100644 misc/pytest/lib/query-suite-test.py create mode 100644 misc/pytest/lib/query_suites.py diff --git a/java/ql/integration-tests/java/query-suite/test.py b/java/ql/integration-tests/java/query-suite/test.py index b87e48b7f15a..307a66c14316 100644 --- a/java/ql/integration-tests/java/query-suite/test.py +++ b/java/ql/integration-tests/java/query-suite/test.py @@ -1,23 +1,14 @@ import runs_on import pytest -import sys - -def get_test_module(semmle_code_dir): - import importlib.util - spec = importlib.util.spec_from_file_location('test-module', semmle_code_dir / 'ql' / 'misc' / 'pytest' / 'lib' / 'query-suite-test.py') - mod = importlib.util.module_from_spec(spec) - sys.modules["test-module"] = mod - spec.loader.exec_module(mod) - return mod +from query_suites import * well_known_query_suites = ['java-code-quality.qls', 'java-security-and-quality.qls', 'java-security-extended.qls', 'java-code-scanning.qls'] @runs_on.posix @pytest.mark.parametrize("query_suite", well_known_query_suites) -def test(codeql, java, cwd, expected_files, semmle_code_dir, query_suite): - get_test_module(semmle_code_dir).test(codeql, cwd, expected_files, semmle_code_dir, query_suite) - +def test(codeql, java, check_query_suite, query_suite): + check_query_suite(query_suite) @runs_on.posix -def test_not_included_queries(codeql, java, cwd, expected_files, semmle_code_dir): - get_test_module(semmle_code_dir).test_not_included_queries(codeql, 'java', cwd, expected_files, semmle_code_dir, well_known_query_suites) +def test_not_included_queries(codeql, java, check_queries_not_included): + check_queries_not_included('java', well_known_query_suites) diff --git a/misc/pytest/lib/query-suite-test.py b/misc/pytest/lib/query-suite-test.py deleted file mode 100644 index f25397f459d8..000000000000 --- a/misc/pytest/lib/query-suite-test.py +++ /dev/null @@ -1,23 +0,0 @@ - -import os - -def test(codeql, cwd, expected_files, semmle_code_dir, query_suite): - actual = codeql.resolve.queries(query_suite, _capture=True).strip() - actual = sorted(actual.splitlines()) - actual = [os.path.relpath(q, semmle_code_dir) for q in actual] - actual_file_name = query_suite + '.actual' - expected_files.add(actual_file_name) - (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') - -def test_not_included_queries(codeql, lang_folder_name, cwd, expected_files, semmle_code_dir, query_suites): - all_queries = codeql.resolve.queries(semmle_code_dir / 'ql' / lang_folder_name / 'ql' / 'src', _capture=True).strip().splitlines() - - included_in_qls = set() - for query_suite in query_suites: - included_in_qls |= set(codeql.resolve.queries(query_suite, _capture=True).strip().splitlines()) - - not_included = sorted(set(all_queries) - included_in_qls) - not_included = [os.path.relpath(q, semmle_code_dir) for q in not_included] - not_included_file_name = 'not_included_in_qls.actual' - expected_files.add(not_included_file_name) - (cwd / not_included_file_name).write_text('\n'.join(not_included)+'\n') diff --git a/misc/pytest/lib/query_suites.py b/misc/pytest/lib/query_suites.py new file mode 100644 index 000000000000..b0b8aea8cf8c --- /dev/null +++ b/misc/pytest/lib/query_suites.py @@ -0,0 +1,30 @@ + +import os +import pytest + +@pytest.fixture +def check_query_suite(codeql, cwd, expected_files, semmle_code_dir): + def ret(query_suite): + actual = codeql.resolve.queries(query_suite, _capture=True).strip() + actual = sorted(actual.splitlines()) + actual = [os.path.relpath(q, semmle_code_dir) for q in actual] + actual_file_name = query_suite + '.actual' + expected_files.add(actual_file_name) + (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') + return ret + +@pytest.fixture +def check_queries_not_included(codeql, cwd, expected_files, semmle_code_dir): + def ret(lang_folder_name, query_suites): + all_queries = codeql.resolve.queries(semmle_code_dir / 'ql' / lang_folder_name / 'ql' / 'src', _capture=True).strip().splitlines() + + included_in_qls = set() + for query_suite in query_suites: + included_in_qls |= set(codeql.resolve.queries(query_suite, _capture=True).strip().splitlines()) + + not_included = sorted(set(all_queries) - included_in_qls) + not_included = [os.path.relpath(q, semmle_code_dir) for q in not_included] + not_included_file_name = 'not_included_in_qls.actual' + expected_files.add(not_included_file_name) + (cwd / not_included_file_name).write_text('\n'.join(not_included)+'\n') + return ret diff --git a/swift/ql/integration-tests/posix/query-suite/test.py b/swift/ql/integration-tests/posix/query-suite/test.py index 5394cb8f2ccf..43babae01259 100644 --- a/swift/ql/integration-tests/posix/query-suite/test.py +++ b/swift/ql/integration-tests/posix/query-suite/test.py @@ -1,23 +1,14 @@ import runs_on import pytest -import sys - -def get_test_module(semmle_code_dir): - import importlib.util - spec = importlib.util.spec_from_file_location('test-module', semmle_code_dir / 'ql' / 'misc' / 'pytest' / 'lib' / 'query-suite-test.py') - mod = importlib.util.module_from_spec(spec) - sys.modules["test-module"] = mod - spec.loader.exec_module(mod) - return mod - +from query_suites import * well_known_query_suites = ['swift-code-quality.qls', 'swift-security-and-quality.qls', 'swift-security-extended.qls', 'swift-code-scanning.qls'] @runs_on.posix @pytest.mark.parametrize("query_suite", well_known_query_suites) -def test(codeql, swift, cwd, expected_files, semmle_code_dir, query_suite): - get_test_module(semmle_code_dir).test(codeql, cwd, expected_files, semmle_code_dir, query_suite) +def test(codeql, swift, check_query_suite, query_suite): + check_query_suite(query_suite) @runs_on.posix -def test_not_included_queries(codeql, swift, cwd, expected_files, semmle_code_dir): - get_test_module(semmle_code_dir).test_not_included_queries(codeql, 'swift', cwd, expected_files, semmle_code_dir, well_known_query_suites) +def test_not_included_queries(codeql, swift, check_queries_not_included): + check_queries_not_included('swift', well_known_query_suites) From a4a24470c864553f7599060b90fb30bc0a2c40c8 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Thu, 24 Apr 2025 09:06:18 +0200 Subject: [PATCH 206/240] Add query suite inclusion tests for actions, csharp, go, javascript, ruby, rust --- .../actions-code-quality.qls.expected | 1 + .../actions-code-scanning.qls.expected | 17 ++ .../actions-security-and-quality.qls.expected | 33 +++ .../actions-security-extended.qls.expected | 23 ++ .../query-suite/not_included_in_qls.expected | 11 + .../ql/integration-tests/query-suite/test.py | 14 ++ .../csharp-code-quality.qls.expected | 12 + .../csharp-code-scanning.qls.expected | 57 +++++ .../csharp-security-and-quality.qls.expected | 173 +++++++++++++++ .../csharp-security-extended.qls.expected | 71 ++++++ .../query-suite/not_included_in_qls.expected | 128 +++++++++++ .../posix/query-suite/test.py | 14 ++ .../query-suite/go-code-quality.qls.expected | 6 + .../query-suite/go-code-scanning.qls.expected | 31 +++ .../go-security-and-quality.qls.expected | 55 +++++ .../go-security-extended.qls.expected | 33 +++ .../query-suite/not_included_in_qls.expected | 33 +++ go/ql/integration-tests/query-suite/test.py | 14 ++ .../javascript-code-quality.qls.expected | 5 + .../javascript-code-scanning.qls.expected | 90 ++++++++ ...vascript-security-and-quality.qls.expected | 205 ++++++++++++++++++ .../javascript-security-extended.qls.expected | 107 +++++++++ .../query-suite/not_included_in_qls.expected | 148 +++++++++++++ .../ql/integration-tests/query-suite/test.py | 14 ++ .../query-suite/not_included_in_qls.expected | 36 +++ .../ruby-code-quality.qls.expected | 3 + .../ruby-code-scanning.qls.expected | 44 ++++ .../ruby-security-and-quality.qls.expected | 54 +++++ .../ruby-security-extended.qls.expected | 51 +++++ ruby/ql/integration-tests/query-suite/test.py | 14 ++ .../query-suite/not_included_in_qls.expected | 16 ++ .../rust-code-quality.qls.expected | 1 + .../rust-code-scanning.qls.expected | 26 +++ .../rust-security-and-quality.qls.expected | 29 +++ .../rust-security-extended.qls.expected | 27 +++ rust/ql/integration-tests/query-suite/test.py | 14 ++ 36 files changed, 1610 insertions(+) create mode 100644 actions/ql/integration-tests/query-suite/actions-code-quality.qls.expected create mode 100644 actions/ql/integration-tests/query-suite/actions-code-scanning.qls.expected create mode 100644 actions/ql/integration-tests/query-suite/actions-security-and-quality.qls.expected create mode 100644 actions/ql/integration-tests/query-suite/actions-security-extended.qls.expected create mode 100644 actions/ql/integration-tests/query-suite/not_included_in_qls.expected create mode 100644 actions/ql/integration-tests/query-suite/test.py create mode 100644 csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected create mode 100644 csharp/ql/integration-tests/posix/query-suite/csharp-code-scanning.qls.expected create mode 100644 csharp/ql/integration-tests/posix/query-suite/csharp-security-and-quality.qls.expected create mode 100644 csharp/ql/integration-tests/posix/query-suite/csharp-security-extended.qls.expected create mode 100644 csharp/ql/integration-tests/posix/query-suite/not_included_in_qls.expected create mode 100644 csharp/ql/integration-tests/posix/query-suite/test.py create mode 100644 go/ql/integration-tests/query-suite/go-code-quality.qls.expected create mode 100644 go/ql/integration-tests/query-suite/go-code-scanning.qls.expected create mode 100644 go/ql/integration-tests/query-suite/go-security-and-quality.qls.expected create mode 100644 go/ql/integration-tests/query-suite/go-security-extended.qls.expected create mode 100644 go/ql/integration-tests/query-suite/not_included_in_qls.expected create mode 100644 go/ql/integration-tests/query-suite/test.py create mode 100644 javascript/ql/integration-tests/query-suite/javascript-code-quality.qls.expected create mode 100644 javascript/ql/integration-tests/query-suite/javascript-code-scanning.qls.expected create mode 100644 javascript/ql/integration-tests/query-suite/javascript-security-and-quality.qls.expected create mode 100644 javascript/ql/integration-tests/query-suite/javascript-security-extended.qls.expected create mode 100644 javascript/ql/integration-tests/query-suite/not_included_in_qls.expected create mode 100644 javascript/ql/integration-tests/query-suite/test.py create mode 100644 ruby/ql/integration-tests/query-suite/not_included_in_qls.expected create mode 100644 ruby/ql/integration-tests/query-suite/ruby-code-quality.qls.expected create mode 100644 ruby/ql/integration-tests/query-suite/ruby-code-scanning.qls.expected create mode 100644 ruby/ql/integration-tests/query-suite/ruby-security-and-quality.qls.expected create mode 100644 ruby/ql/integration-tests/query-suite/ruby-security-extended.qls.expected create mode 100644 ruby/ql/integration-tests/query-suite/test.py create mode 100644 rust/ql/integration-tests/query-suite/not_included_in_qls.expected create mode 100644 rust/ql/integration-tests/query-suite/rust-code-quality.qls.expected create mode 100644 rust/ql/integration-tests/query-suite/rust-code-scanning.qls.expected create mode 100644 rust/ql/integration-tests/query-suite/rust-security-and-quality.qls.expected create mode 100644 rust/ql/integration-tests/query-suite/rust-security-extended.qls.expected create mode 100644 rust/ql/integration-tests/query-suite/test.py diff --git a/actions/ql/integration-tests/query-suite/actions-code-quality.qls.expected b/actions/ql/integration-tests/query-suite/actions-code-quality.qls.expected new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/actions/ql/integration-tests/query-suite/actions-code-quality.qls.expected @@ -0,0 +1 @@ + diff --git a/actions/ql/integration-tests/query-suite/actions-code-scanning.qls.expected b/actions/ql/integration-tests/query-suite/actions-code-scanning.qls.expected new file mode 100644 index 000000000000..4a12174ffbda --- /dev/null +++ b/actions/ql/integration-tests/query-suite/actions-code-scanning.qls.expected @@ -0,0 +1,17 @@ +ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql +ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql +ql/actions/ql/src/Security/CWE-094/CodeInjectionCritical.ql +ql/actions/ql/src/Security/CWE-1395/UseOfKnownVulnerableAction.ql +ql/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql +ql/actions/ql/src/Security/CWE-285/ImproperAccessControl.ql +ql/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql +ql/actions/ql/src/Security/CWE-312/SecretsInArtifacts.ql +ql/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.ql +ql/actions/ql/src/Security/CWE-349/CachePoisoningViaCodeInjection.ql +ql/actions/ql/src/Security/CWE-349/CachePoisoningViaDirectCache.ql +ql/actions/ql/src/Security/CWE-349/CachePoisoningViaPoisonableStep.ql +ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUCritical.ql +ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUHigh.ql +ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningCritical.ql +ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.ql +ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutHigh.ql diff --git a/actions/ql/integration-tests/query-suite/actions-security-and-quality.qls.expected b/actions/ql/integration-tests/query-suite/actions-security-and-quality.qls.expected new file mode 100644 index 000000000000..cadb6202fde6 --- /dev/null +++ b/actions/ql/integration-tests/query-suite/actions-security-and-quality.qls.expected @@ -0,0 +1,33 @@ +ql/actions/ql/src/Debug/SyntaxError.ql +ql/actions/ql/src/Models/CompositeActionsSinks.ql +ql/actions/ql/src/Models/CompositeActionsSources.ql +ql/actions/ql/src/Models/CompositeActionsSummaries.ql +ql/actions/ql/src/Models/ReusableWorkflowsSinks.ql +ql/actions/ql/src/Models/ReusableWorkflowsSources.ql +ql/actions/ql/src/Models/ReusableWorkflowsSummaries.ql +ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql +ql/actions/ql/src/Security/CWE-077/EnvPathInjectionMedium.ql +ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql +ql/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.ql +ql/actions/ql/src/Security/CWE-094/CodeInjectionCritical.ql +ql/actions/ql/src/Security/CWE-094/CodeInjectionMedium.ql +ql/actions/ql/src/Security/CWE-1395/UseOfKnownVulnerableAction.ql +ql/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql +ql/actions/ql/src/Security/CWE-285/ImproperAccessControl.ql +ql/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql +ql/actions/ql/src/Security/CWE-312/SecretsInArtifacts.ql +ql/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.ql +ql/actions/ql/src/Security/CWE-349/CachePoisoningViaCodeInjection.ql +ql/actions/ql/src/Security/CWE-349/CachePoisoningViaDirectCache.ql +ql/actions/ql/src/Security/CWE-349/CachePoisoningViaPoisonableStep.ql +ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUCritical.ql +ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUHigh.ql +ql/actions/ql/src/Security/CWE-571/ExpressionIsAlwaysTrueCritical.ql +ql/actions/ql/src/Security/CWE-571/ExpressionIsAlwaysTrueHigh.ql +ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningCritical.ql +ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningMedium.ql +ql/actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql +ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.ql +ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutHigh.ql +ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutMedium.ql +ql/actions/ql/src/Violations Of Best Practice/CodeQL/UnnecessaryUseOfAdvancedConfig.ql diff --git a/actions/ql/integration-tests/query-suite/actions-security-extended.qls.expected b/actions/ql/integration-tests/query-suite/actions-security-extended.qls.expected new file mode 100644 index 000000000000..06a9c6745e48 --- /dev/null +++ b/actions/ql/integration-tests/query-suite/actions-security-extended.qls.expected @@ -0,0 +1,23 @@ +ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql +ql/actions/ql/src/Security/CWE-077/EnvPathInjectionMedium.ql +ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql +ql/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.ql +ql/actions/ql/src/Security/CWE-094/CodeInjectionCritical.ql +ql/actions/ql/src/Security/CWE-094/CodeInjectionMedium.ql +ql/actions/ql/src/Security/CWE-1395/UseOfKnownVulnerableAction.ql +ql/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql +ql/actions/ql/src/Security/CWE-285/ImproperAccessControl.ql +ql/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql +ql/actions/ql/src/Security/CWE-312/SecretsInArtifacts.ql +ql/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.ql +ql/actions/ql/src/Security/CWE-349/CachePoisoningViaCodeInjection.ql +ql/actions/ql/src/Security/CWE-349/CachePoisoningViaDirectCache.ql +ql/actions/ql/src/Security/CWE-349/CachePoisoningViaPoisonableStep.ql +ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUCritical.ql +ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUHigh.ql +ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningCritical.ql +ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningMedium.ql +ql/actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql +ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.ql +ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutHigh.ql +ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutMedium.ql diff --git a/actions/ql/integration-tests/query-suite/not_included_in_qls.expected b/actions/ql/integration-tests/query-suite/not_included_in_qls.expected new file mode 100644 index 000000000000..8763955a8e40 --- /dev/null +++ b/actions/ql/integration-tests/query-suite/not_included_in_qls.expected @@ -0,0 +1,11 @@ +ql/actions/ql/src/Debug/partial.ql +ql/actions/ql/src/experimental/Security/CWE-074/OutputClobberingHigh.ql +ql/actions/ql/src/experimental/Security/CWE-078/CommandInjectionCritical.ql +ql/actions/ql/src/experimental/Security/CWE-078/CommandInjectionMedium.ql +ql/actions/ql/src/experimental/Security/CWE-088/ArgumentInjectionCritical.ql +ql/actions/ql/src/experimental/Security/CWE-088/ArgumentInjectionMedium.ql +ql/actions/ql/src/experimental/Security/CWE-200/SecretExfiltration.ql +ql/actions/ql/src/experimental/Security/CWE-284/CodeExecutionOnSelfHostedRunner.ql +ql/actions/ql/src/experimental/Security/CWE-829/ArtifactPoisoningPathTraversal.ql +ql/actions/ql/src/experimental/Security/CWE-829/UnversionedImmutableAction.ql +ql/actions/ql/src/experimental/Security/CWE-918/RequestForgery.ql diff --git a/actions/ql/integration-tests/query-suite/test.py b/actions/ql/integration-tests/query-suite/test.py new file mode 100644 index 000000000000..6eb57c090b99 --- /dev/null +++ b/actions/ql/integration-tests/query-suite/test.py @@ -0,0 +1,14 @@ +import runs_on +import pytest +from query_suites import * + +well_known_query_suites = ['actions-code-quality.qls', 'actions-security-and-quality.qls', 'actions-security-extended.qls', 'actions-code-scanning.qls'] + +@runs_on.posix +@pytest.mark.parametrize("query_suite", well_known_query_suites) +def test(codeql, actions, check_query_suite, query_suite): + check_query_suite(query_suite) + +@runs_on.posix +def test_not_included_queries(codeql, actions, check_queries_not_included): + check_queries_not_included('actions', well_known_query_suites) diff --git a/csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected b/csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected new file mode 100644 index 000000000000..533344cbbc27 --- /dev/null +++ b/csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected @@ -0,0 +1,12 @@ +ql/csharp/ql/src/API Abuse/NoDisposeCallOnLocalIDisposable.ql +ql/csharp/ql/src/Bad Practices/Control-Flow/ConstantCondition.ql +ql/csharp/ql/src/Dead Code/DeadStoreOfLocal.ql +ql/csharp/ql/src/Likely Bugs/Collections/ContainerLengthCmpOffByOne.ql +ql/csharp/ql/src/Likely Bugs/Collections/ContainerSizeCmpZero.ql +ql/csharp/ql/src/Likely Bugs/DangerousNonShortCircuitLogic.ql +ql/csharp/ql/src/Likely Bugs/ReferenceEqualsOnValueTypes.ql +ql/csharp/ql/src/Likely Bugs/SelfAssignment.ql +ql/csharp/ql/src/Likely Bugs/UncheckedCastInEquals.ql +ql/csharp/ql/src/Performance/UseTryGetValue.ql +ql/csharp/ql/src/Useless code/DefaultToString.ql +ql/csharp/ql/src/Useless code/IntGetHashCode.ql diff --git a/csharp/ql/integration-tests/posix/query-suite/csharp-code-scanning.qls.expected b/csharp/ql/integration-tests/posix/query-suite/csharp-code-scanning.qls.expected new file mode 100644 index 000000000000..c0ff79af1c16 --- /dev/null +++ b/csharp/ql/integration-tests/posix/query-suite/csharp-code-scanning.qls.expected @@ -0,0 +1,57 @@ +ql/csharp/ql/src/Diagnostics/CompilerError.ql +ql/csharp/ql/src/Diagnostics/CompilerMessage.ql +ql/csharp/ql/src/Diagnostics/DiagnosticExtractionErrors.ql +ql/csharp/ql/src/Diagnostics/ExtractedFiles.ql +ql/csharp/ql/src/Diagnostics/ExtractorError.ql +ql/csharp/ql/src/Diagnostics/ExtractorMessage.ql +ql/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql +ql/csharp/ql/src/Security Features/CWE-011/ASPNetDebug.ql +ql/csharp/ql/src/Security Features/CWE-016/ASPNetPagesValidateRequest.ql +ql/csharp/ql/src/Security Features/CWE-022/TaintedPath.ql +ql/csharp/ql/src/Security Features/CWE-022/ZipSlip.ql +ql/csharp/ql/src/Security Features/CWE-078/CommandInjection.ql +ql/csharp/ql/src/Security Features/CWE-079/XSS.ql +ql/csharp/ql/src/Security Features/CWE-089/SqlInjection.ql +ql/csharp/ql/src/Security Features/CWE-090/LDAPInjection.ql +ql/csharp/ql/src/Security Features/CWE-091/XMLInjection.ql +ql/csharp/ql/src/Security Features/CWE-094/CodeInjection.ql +ql/csharp/ql/src/Security Features/CWE-099/ResourceInjection.ql +ql/csharp/ql/src/Security Features/CWE-114/AssemblyPathInjection.ql +ql/csharp/ql/src/Security Features/CWE-117/LogForging.ql +ql/csharp/ql/src/Security Features/CWE-119/LocalUnvalidatedArithmetic.ql +ql/csharp/ql/src/Security Features/CWE-134/UncontrolledFormatString.ql +ql/csharp/ql/src/Security Features/CWE-201/ExposureInTransmittedData.ql +ql/csharp/ql/src/Security Features/CWE-209/ExceptionInformationExposure.ql +ql/csharp/ql/src/Security Features/CWE-248/MissingASPNETGlobalErrorHandler.ql +ql/csharp/ql/src/Security Features/CWE-312/CleartextStorage.ql +ql/csharp/ql/src/Security Features/CWE-352/MissingAntiForgeryTokenValidation.ql +ql/csharp/ql/src/Security Features/CWE-359/ExposureOfPrivateInformation.ql +ql/csharp/ql/src/Security Features/CWE-384/AbandonSession.ql +ql/csharp/ql/src/Security Features/CWE-451/MissingXFrameOptions.ql +ql/csharp/ql/src/Security Features/CWE-502/DeserializedDelegate.ql +ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql +ql/csharp/ql/src/Security Features/CWE-548/ASPNetDirectoryListing.ql +ql/csharp/ql/src/Security Features/CWE-601/UrlRedirect.ql +ql/csharp/ql/src/Security Features/CWE-611/UntrustedDataInsecureXml.ql +ql/csharp/ql/src/Security Features/CWE-614/RequireSSL.ql +ql/csharp/ql/src/Security Features/CWE-643/XPathInjection.ql +ql/csharp/ql/src/Security Features/CWE-730/ReDoS.ql +ql/csharp/ql/src/Security Features/CWE-730/RegexInjection.ql +ql/csharp/ql/src/Security Features/CWE-807/ConditionalBypass.ql +ql/csharp/ql/src/Security Features/CookieWithOverlyBroadDomain.ql +ql/csharp/ql/src/Security Features/CookieWithOverlyBroadPath.ql +ql/csharp/ql/src/Security Features/Encryption using ECB.ql +ql/csharp/ql/src/Security Features/HeaderCheckingDisabled.ql +ql/csharp/ql/src/Security Features/InadequateRSAPadding.ql +ql/csharp/ql/src/Security Features/InsecureRandomness.ql +ql/csharp/ql/src/Security Features/InsufficientKeySize.ql +ql/csharp/ql/src/Security Features/PersistentCookie.ql +ql/csharp/ql/src/Security Features/WeakEncryption.ql +ql/csharp/ql/src/Telemetry/DatabaseQualityDiagnostics.ql +ql/csharp/ql/src/Telemetry/ExternalLibraryUsage.ql +ql/csharp/ql/src/Telemetry/ExtractorInformation.ql +ql/csharp/ql/src/Telemetry/SupportedExternalApis.ql +ql/csharp/ql/src/Telemetry/SupportedExternalSinks.ql +ql/csharp/ql/src/Telemetry/SupportedExternalSources.ql +ql/csharp/ql/src/Telemetry/SupportedExternalTaint.ql +ql/csharp/ql/src/Telemetry/UnsupportedExternalAPIs.ql diff --git a/csharp/ql/integration-tests/posix/query-suite/csharp-security-and-quality.qls.expected b/csharp/ql/integration-tests/posix/query-suite/csharp-security-and-quality.qls.expected new file mode 100644 index 000000000000..fc0fa2403f96 --- /dev/null +++ b/csharp/ql/integration-tests/posix/query-suite/csharp-security-and-quality.qls.expected @@ -0,0 +1,173 @@ +ql/csharp/ql/src/API Abuse/CallToGCCollect.ql +ql/csharp/ql/src/API Abuse/CallToObsoleteMethod.ql +ql/csharp/ql/src/API Abuse/ClassDoesNotImplementEquals.ql +ql/csharp/ql/src/API Abuse/ClassImplementsICloneable.ql +ql/csharp/ql/src/API Abuse/DisposeNotCalledOnException.ql +ql/csharp/ql/src/API Abuse/FormatInvalid.ql +ql/csharp/ql/src/API Abuse/InconsistentEqualsGetHashCode.ql +ql/csharp/ql/src/API Abuse/IncorrectCompareToSignature.ql +ql/csharp/ql/src/API Abuse/IncorrectEqualsSignature.ql +ql/csharp/ql/src/API Abuse/NoDisposeCallOnLocalIDisposable.ql +ql/csharp/ql/src/API Abuse/NullArgumentToEquals.ql +ql/csharp/ql/src/ASP/BlockCodeResponseWrite.ql +ql/csharp/ql/src/Architecture/Refactoring Opportunities/InappropriateIntimacy.ql +ql/csharp/ql/src/Bad Practices/CallsUnmanagedCode.ql +ql/csharp/ql/src/Bad Practices/CatchOfNullReferenceException.ql +ql/csharp/ql/src/Bad Practices/Control-Flow/ConstantCondition.ql +ql/csharp/ql/src/Bad Practices/Declarations/LocalScopeVariableShadowsMember.ql +ql/csharp/ql/src/Bad Practices/Declarations/TooManyRefParameters.ql +ql/csharp/ql/src/Bad Practices/EmptyCatchBlock.ql +ql/csharp/ql/src/Bad Practices/ErroneousClassCompare.ql +ql/csharp/ql/src/Bad Practices/Implementation Hiding/AbstractToConcreteCollection.ql +ql/csharp/ql/src/Bad Practices/Implementation Hiding/ExposeRepresentation.ql +ql/csharp/ql/src/Bad Practices/Naming Conventions/FieldMasksSuperField.ql +ql/csharp/ql/src/Bad Practices/Naming Conventions/SameNameAsSuper.ql +ql/csharp/ql/src/Bad Practices/PathCombine.ql +ql/csharp/ql/src/Bad Practices/UnmanagedCodeCheck.ql +ql/csharp/ql/src/Bad Practices/VirtualCallInConstructorOrDestructor.ql +ql/csharp/ql/src/CSI/CompareIdenticalValues.ql +ql/csharp/ql/src/CSI/NullAlways.ql +ql/csharp/ql/src/CSI/NullMaybe.ql +ql/csharp/ql/src/Complexity/BlockWithTooManyStatements.ql +ql/csharp/ql/src/Complexity/ComplexCondition.ql +ql/csharp/ql/src/Concurrency/FutileSyncOnField.ql +ql/csharp/ql/src/Concurrency/LockOrder.ql +ql/csharp/ql/src/Concurrency/LockThis.ql +ql/csharp/ql/src/Concurrency/LockedWait.ql +ql/csharp/ql/src/Concurrency/SynchSetUnsynchGet.ql +ql/csharp/ql/src/Concurrency/UnsafeLazyInitialization.ql +ql/csharp/ql/src/Concurrency/UnsynchronizedStaticAccess.ql +ql/csharp/ql/src/Configuration/EmptyPasswordInConfigurationFile.ql +ql/csharp/ql/src/Configuration/PasswordInConfigurationFile.ql +ql/csharp/ql/src/Dead Code/DeadStoreOfLocal.ql +ql/csharp/ql/src/Diagnostics/CompilerError.ql +ql/csharp/ql/src/Diagnostics/CompilerMessage.ql +ql/csharp/ql/src/Diagnostics/DiagnosticExtractionErrors.ql +ql/csharp/ql/src/Diagnostics/ExtractedFiles.ql +ql/csharp/ql/src/Diagnostics/ExtractorError.ql +ql/csharp/ql/src/Diagnostics/ExtractorMessage.ql +ql/csharp/ql/src/Documentation/XmldocMissingSummary.ql +ql/csharp/ql/src/Input Validation/UseOfFileUpload.ql +ql/csharp/ql/src/Input Validation/ValueShadowing.ql +ql/csharp/ql/src/Input Validation/ValueShadowingServerVariable.ql +ql/csharp/ql/src/Language Abuse/CastThisToTypeParameter.ql +ql/csharp/ql/src/Language Abuse/CatchOfGenericException.ql +ql/csharp/ql/src/Language Abuse/ChainedIs.ql +ql/csharp/ql/src/Language Abuse/DubiousDowncastOfThis.ql +ql/csharp/ql/src/Language Abuse/DubiousTypeTestOfThis.ql +ql/csharp/ql/src/Language Abuse/MissedReadonlyOpportunity.ql +ql/csharp/ql/src/Language Abuse/MissedTernaryOpportunity.ql +ql/csharp/ql/src/Language Abuse/MissedUsingOpportunity.ql +ql/csharp/ql/src/Language Abuse/NestedIf.ql +ql/csharp/ql/src/Language Abuse/RethrowException.ql +ql/csharp/ql/src/Language Abuse/SimplifyBoolExpr.ql +ql/csharp/ql/src/Language Abuse/UnusedPropertyValue.ql +ql/csharp/ql/src/Language Abuse/UselessCastToSelf.ql +ql/csharp/ql/src/Language Abuse/UselessNullCoalescingExpression.ql +ql/csharp/ql/src/Language Abuse/UselessTypeTest.ql +ql/csharp/ql/src/Language Abuse/UselessUpcast.ql +ql/csharp/ql/src/Likely Bugs/Collections/ContainerLengthCmpOffByOne.ql +ql/csharp/ql/src/Likely Bugs/Collections/ContainerSizeCmpZero.ql +ql/csharp/ql/src/Likely Bugs/Collections/ReadOnlyContainer.ql +ql/csharp/ql/src/Likely Bugs/Collections/WriteOnlyContainer.ql +ql/csharp/ql/src/Likely Bugs/ConstantComparison.ql +ql/csharp/ql/src/Likely Bugs/DangerousNonShortCircuitLogic.ql +ql/csharp/ql/src/Likely Bugs/Dynamic/BadDynamicCall.ql +ql/csharp/ql/src/Likely Bugs/EqualityCheckOnFloats.ql +ql/csharp/ql/src/Likely Bugs/EqualsArray.ql +ql/csharp/ql/src/Likely Bugs/EqualsUsesAs.ql +ql/csharp/ql/src/Likely Bugs/EqualsUsesIs.ql +ql/csharp/ql/src/Likely Bugs/HashedButNoHash.ql +ql/csharp/ql/src/Likely Bugs/ImpossibleArrayCast.ql +ql/csharp/ql/src/Likely Bugs/IncomparableEquals.ql +ql/csharp/ql/src/Likely Bugs/InconsistentCompareTo.ql +ql/csharp/ql/src/Likely Bugs/LeapYear/UnsafeYearConstruction.ql +ql/csharp/ql/src/Likely Bugs/MishandlingJapaneseEra.ql +ql/csharp/ql/src/Likely Bugs/NestedLoopsSameVariable.ql +ql/csharp/ql/src/Likely Bugs/ObjectComparison.ql +ql/csharp/ql/src/Likely Bugs/PossibleLossOfPrecision.ql +ql/csharp/ql/src/Likely Bugs/RecursiveEquals.ql +ql/csharp/ql/src/Likely Bugs/RecursiveOperatorEquals.ql +ql/csharp/ql/src/Likely Bugs/ReferenceEqualsOnValueTypes.ql +ql/csharp/ql/src/Likely Bugs/SelfAssignment.ql +ql/csharp/ql/src/Likely Bugs/Statements/EmptyBlock.ql +ql/csharp/ql/src/Likely Bugs/Statements/EmptyLockStatement.ql +ql/csharp/ql/src/Likely Bugs/Statements/UseBraces.ql +ql/csharp/ql/src/Likely Bugs/StaticFieldWrittenByInstance.ql +ql/csharp/ql/src/Likely Bugs/StringBuilderCharInit.ql +ql/csharp/ql/src/Likely Bugs/ThreadUnsafeICryptoTransform.ql +ql/csharp/ql/src/Likely Bugs/ThreadUnsafeICryptoTransformLambda.ql +ql/csharp/ql/src/Likely Bugs/UncheckedCastInEquals.ql +ql/csharp/ql/src/Linq/BadMultipleIteration.ql +ql/csharp/ql/src/Linq/MissedAllOpportunity.ql +ql/csharp/ql/src/Linq/MissedCastOpportunity.ql +ql/csharp/ql/src/Linq/MissedOfTypeOpportunity.ql +ql/csharp/ql/src/Linq/MissedSelectOpportunity.ql +ql/csharp/ql/src/Linq/MissedWhereOpportunity.ql +ql/csharp/ql/src/Linq/RedundantSelect.ql +ql/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql +ql/csharp/ql/src/Performance/StringBuilderInLoop.ql +ql/csharp/ql/src/Performance/StringConcatenationInLoop.ql +ql/csharp/ql/src/Performance/UseTryGetValue.ql +ql/csharp/ql/src/Security Features/CWE-011/ASPNetDebug.ql +ql/csharp/ql/src/Security Features/CWE-016/ASPNetPagesValidateRequest.ql +ql/csharp/ql/src/Security Features/CWE-020/RuntimeChecksBypass.ql +ql/csharp/ql/src/Security Features/CWE-022/TaintedPath.ql +ql/csharp/ql/src/Security Features/CWE-022/ZipSlip.ql +ql/csharp/ql/src/Security Features/CWE-078/CommandInjection.ql +ql/csharp/ql/src/Security Features/CWE-079/XSS.ql +ql/csharp/ql/src/Security Features/CWE-089/SqlInjection.ql +ql/csharp/ql/src/Security Features/CWE-090/LDAPInjection.ql +ql/csharp/ql/src/Security Features/CWE-091/XMLInjection.ql +ql/csharp/ql/src/Security Features/CWE-094/CodeInjection.ql +ql/csharp/ql/src/Security Features/CWE-099/ResourceInjection.ql +ql/csharp/ql/src/Security Features/CWE-112/MissingXMLValidation.ql +ql/csharp/ql/src/Security Features/CWE-114/AssemblyPathInjection.ql +ql/csharp/ql/src/Security Features/CWE-117/LogForging.ql +ql/csharp/ql/src/Security Features/CWE-119/LocalUnvalidatedArithmetic.ql +ql/csharp/ql/src/Security Features/CWE-134/UncontrolledFormatString.ql +ql/csharp/ql/src/Security Features/CWE-201/ExposureInTransmittedData.ql +ql/csharp/ql/src/Security Features/CWE-209/ExceptionInformationExposure.ql +ql/csharp/ql/src/Security Features/CWE-248/MissingASPNETGlobalErrorHandler.ql +ql/csharp/ql/src/Security Features/CWE-285/MissingAccessControl.ql +ql/csharp/ql/src/Security Features/CWE-312/CleartextStorage.ql +ql/csharp/ql/src/Security Features/CWE-327/InsecureSQLConnection.ql +ql/csharp/ql/src/Security Features/CWE-352/MissingAntiForgeryTokenValidation.ql +ql/csharp/ql/src/Security Features/CWE-359/ExposureOfPrivateInformation.ql +ql/csharp/ql/src/Security Features/CWE-384/AbandonSession.ql +ql/csharp/ql/src/Security Features/CWE-451/MissingXFrameOptions.ql +ql/csharp/ql/src/Security Features/CWE-502/DeserializedDelegate.ql +ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql +ql/csharp/ql/src/Security Features/CWE-548/ASPNetDirectoryListing.ql +ql/csharp/ql/src/Security Features/CWE-601/UrlRedirect.ql +ql/csharp/ql/src/Security Features/CWE-611/UntrustedDataInsecureXml.ql +ql/csharp/ql/src/Security Features/CWE-614/RequireSSL.ql +ql/csharp/ql/src/Security Features/CWE-639/InsecureDirectObjectReference.ql +ql/csharp/ql/src/Security Features/CWE-643/XPathInjection.ql +ql/csharp/ql/src/Security Features/CWE-730/ReDoS.ql +ql/csharp/ql/src/Security Features/CWE-730/RegexInjection.ql +ql/csharp/ql/src/Security Features/CWE-798/HardcodedConnectionString.ql +ql/csharp/ql/src/Security Features/CWE-798/HardcodedCredentials.ql +ql/csharp/ql/src/Security Features/CWE-807/ConditionalBypass.ql +ql/csharp/ql/src/Security Features/CookieWithOverlyBroadDomain.ql +ql/csharp/ql/src/Security Features/CookieWithOverlyBroadPath.ql +ql/csharp/ql/src/Security Features/Encryption using ECB.ql +ql/csharp/ql/src/Security Features/HeaderCheckingDisabled.ql +ql/csharp/ql/src/Security Features/InadequateRSAPadding.ql +ql/csharp/ql/src/Security Features/InsecureRandomness.ql +ql/csharp/ql/src/Security Features/InsufficientKeySize.ql +ql/csharp/ql/src/Security Features/PersistentCookie.ql +ql/csharp/ql/src/Security Features/WeakEncryption.ql +ql/csharp/ql/src/Telemetry/DatabaseQualityDiagnostics.ql +ql/csharp/ql/src/Telemetry/ExternalLibraryUsage.ql +ql/csharp/ql/src/Telemetry/ExtractorInformation.ql +ql/csharp/ql/src/Telemetry/SupportedExternalApis.ql +ql/csharp/ql/src/Telemetry/SupportedExternalSinks.ql +ql/csharp/ql/src/Telemetry/SupportedExternalSources.ql +ql/csharp/ql/src/Telemetry/SupportedExternalTaint.ql +ql/csharp/ql/src/Telemetry/UnsupportedExternalAPIs.ql +ql/csharp/ql/src/Useless code/DefaultToString.ql +ql/csharp/ql/src/Useless code/FutileConditional.ql +ql/csharp/ql/src/Useless code/IntGetHashCode.ql +ql/csharp/ql/src/Useless code/RedundantToStringCall.ql +ql/csharp/ql/src/Useless code/UnusedLabel.ql diff --git a/csharp/ql/integration-tests/posix/query-suite/csharp-security-extended.qls.expected b/csharp/ql/integration-tests/posix/query-suite/csharp-security-extended.qls.expected new file mode 100644 index 000000000000..69f47536e683 --- /dev/null +++ b/csharp/ql/integration-tests/posix/query-suite/csharp-security-extended.qls.expected @@ -0,0 +1,71 @@ +ql/csharp/ql/src/Configuration/EmptyPasswordInConfigurationFile.ql +ql/csharp/ql/src/Configuration/PasswordInConfigurationFile.ql +ql/csharp/ql/src/Diagnostics/CompilerError.ql +ql/csharp/ql/src/Diagnostics/CompilerMessage.ql +ql/csharp/ql/src/Diagnostics/DiagnosticExtractionErrors.ql +ql/csharp/ql/src/Diagnostics/ExtractedFiles.ql +ql/csharp/ql/src/Diagnostics/ExtractorError.ql +ql/csharp/ql/src/Diagnostics/ExtractorMessage.ql +ql/csharp/ql/src/Input Validation/UseOfFileUpload.ql +ql/csharp/ql/src/Input Validation/ValueShadowing.ql +ql/csharp/ql/src/Input Validation/ValueShadowingServerVariable.ql +ql/csharp/ql/src/Likely Bugs/ThreadUnsafeICryptoTransform.ql +ql/csharp/ql/src/Likely Bugs/ThreadUnsafeICryptoTransformLambda.ql +ql/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql +ql/csharp/ql/src/Security Features/CWE-011/ASPNetDebug.ql +ql/csharp/ql/src/Security Features/CWE-016/ASPNetPagesValidateRequest.ql +ql/csharp/ql/src/Security Features/CWE-020/RuntimeChecksBypass.ql +ql/csharp/ql/src/Security Features/CWE-022/TaintedPath.ql +ql/csharp/ql/src/Security Features/CWE-022/ZipSlip.ql +ql/csharp/ql/src/Security Features/CWE-078/CommandInjection.ql +ql/csharp/ql/src/Security Features/CWE-079/XSS.ql +ql/csharp/ql/src/Security Features/CWE-089/SqlInjection.ql +ql/csharp/ql/src/Security Features/CWE-090/LDAPInjection.ql +ql/csharp/ql/src/Security Features/CWE-091/XMLInjection.ql +ql/csharp/ql/src/Security Features/CWE-094/CodeInjection.ql +ql/csharp/ql/src/Security Features/CWE-099/ResourceInjection.ql +ql/csharp/ql/src/Security Features/CWE-112/MissingXMLValidation.ql +ql/csharp/ql/src/Security Features/CWE-114/AssemblyPathInjection.ql +ql/csharp/ql/src/Security Features/CWE-117/LogForging.ql +ql/csharp/ql/src/Security Features/CWE-119/LocalUnvalidatedArithmetic.ql +ql/csharp/ql/src/Security Features/CWE-134/UncontrolledFormatString.ql +ql/csharp/ql/src/Security Features/CWE-201/ExposureInTransmittedData.ql +ql/csharp/ql/src/Security Features/CWE-209/ExceptionInformationExposure.ql +ql/csharp/ql/src/Security Features/CWE-248/MissingASPNETGlobalErrorHandler.ql +ql/csharp/ql/src/Security Features/CWE-285/MissingAccessControl.ql +ql/csharp/ql/src/Security Features/CWE-312/CleartextStorage.ql +ql/csharp/ql/src/Security Features/CWE-327/InsecureSQLConnection.ql +ql/csharp/ql/src/Security Features/CWE-352/MissingAntiForgeryTokenValidation.ql +ql/csharp/ql/src/Security Features/CWE-359/ExposureOfPrivateInformation.ql +ql/csharp/ql/src/Security Features/CWE-384/AbandonSession.ql +ql/csharp/ql/src/Security Features/CWE-451/MissingXFrameOptions.ql +ql/csharp/ql/src/Security Features/CWE-502/DeserializedDelegate.ql +ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql +ql/csharp/ql/src/Security Features/CWE-548/ASPNetDirectoryListing.ql +ql/csharp/ql/src/Security Features/CWE-601/UrlRedirect.ql +ql/csharp/ql/src/Security Features/CWE-611/UntrustedDataInsecureXml.ql +ql/csharp/ql/src/Security Features/CWE-614/RequireSSL.ql +ql/csharp/ql/src/Security Features/CWE-639/InsecureDirectObjectReference.ql +ql/csharp/ql/src/Security Features/CWE-643/XPathInjection.ql +ql/csharp/ql/src/Security Features/CWE-730/ReDoS.ql +ql/csharp/ql/src/Security Features/CWE-730/RegexInjection.ql +ql/csharp/ql/src/Security Features/CWE-798/HardcodedConnectionString.ql +ql/csharp/ql/src/Security Features/CWE-798/HardcodedCredentials.ql +ql/csharp/ql/src/Security Features/CWE-807/ConditionalBypass.ql +ql/csharp/ql/src/Security Features/CookieWithOverlyBroadDomain.ql +ql/csharp/ql/src/Security Features/CookieWithOverlyBroadPath.ql +ql/csharp/ql/src/Security Features/Encryption using ECB.ql +ql/csharp/ql/src/Security Features/HeaderCheckingDisabled.ql +ql/csharp/ql/src/Security Features/InadequateRSAPadding.ql +ql/csharp/ql/src/Security Features/InsecureRandomness.ql +ql/csharp/ql/src/Security Features/InsufficientKeySize.ql +ql/csharp/ql/src/Security Features/PersistentCookie.ql +ql/csharp/ql/src/Security Features/WeakEncryption.ql +ql/csharp/ql/src/Telemetry/DatabaseQualityDiagnostics.ql +ql/csharp/ql/src/Telemetry/ExternalLibraryUsage.ql +ql/csharp/ql/src/Telemetry/ExtractorInformation.ql +ql/csharp/ql/src/Telemetry/SupportedExternalApis.ql +ql/csharp/ql/src/Telemetry/SupportedExternalSinks.ql +ql/csharp/ql/src/Telemetry/SupportedExternalSources.ql +ql/csharp/ql/src/Telemetry/SupportedExternalTaint.ql +ql/csharp/ql/src/Telemetry/UnsupportedExternalAPIs.ql diff --git a/csharp/ql/integration-tests/posix/query-suite/not_included_in_qls.expected b/csharp/ql/integration-tests/posix/query-suite/not_included_in_qls.expected new file mode 100644 index 000000000000..23bdca4394bf --- /dev/null +++ b/csharp/ql/integration-tests/posix/query-suite/not_included_in_qls.expected @@ -0,0 +1,128 @@ +ql/csharp/ql/src/API Abuse/MissingDisposeCall.ql +ql/csharp/ql/src/API Abuse/MissingDisposeMethod.ql +ql/csharp/ql/src/API Abuse/NonOverridingMethod.ql +ql/csharp/ql/src/API Abuse/UncheckedReturnValue.ql +ql/csharp/ql/src/ASP/ComplexInlineCode.ql +ql/csharp/ql/src/ASP/NonInternationalizedText.ql +ql/csharp/ql/src/ASP/SplitControlStructure.ql +ql/csharp/ql/src/AlertSuppression.ql +ql/csharp/ql/src/Architecture/Dependencies/MutualDependency.ql +ql/csharp/ql/src/Architecture/Refactoring Opportunities/FeatureEnvy.ql +ql/csharp/ql/src/Bad Practices/Comments/CommentedOutCode.ql +ql/csharp/ql/src/Bad Practices/Comments/TodoComments.ql +ql/csharp/ql/src/Bad Practices/Declarations/EmptyInterface.ql +ql/csharp/ql/src/Bad Practices/Declarations/NoConstantsOnly.ql +ql/csharp/ql/src/Bad Practices/Implementation Hiding/StaticArray.ql +ql/csharp/ql/src/Bad Practices/LeftoverDebugCode.ql +ql/csharp/ql/src/Bad Practices/Magic Constants/MagicConstantsNumbers.ql +ql/csharp/ql/src/Bad Practices/Magic Constants/MagicConstantsString.ql +ql/csharp/ql/src/Bad Practices/Magic Constants/MagicNumbersUseConstant.ql +ql/csharp/ql/src/Bad Practices/Magic Constants/MagicStringsUseConstant.ql +ql/csharp/ql/src/Bad Practices/Naming Conventions/ConfusingMethodNames.ql +ql/csharp/ql/src/Bad Practices/Naming Conventions/ConfusingOverridesNames.ql +ql/csharp/ql/src/Bad Practices/Naming Conventions/ConstantNaming.ql +ql/csharp/ql/src/Bad Practices/Naming Conventions/ControlNamePrefixes.ql +ql/csharp/ql/src/Bad Practices/Naming Conventions/DefaultControlNames.ql +ql/csharp/ql/src/Bad Practices/Naming Conventions/VariableNameTooShort.ql +ql/csharp/ql/src/Bad Practices/UseOfHtmlInputHidden.ql +ql/csharp/ql/src/Bad Practices/UseOfSystemOutputStream.ql +ql/csharp/ql/src/Dead Code/DeadRefTypes.ql +ql/csharp/ql/src/Dead Code/NonAssignedFields.ql +ql/csharp/ql/src/Dead Code/UnusedField.ql +ql/csharp/ql/src/Dead Code/UnusedMethod.ql +ql/csharp/ql/src/Documentation/XmldocExtraParam.ql +ql/csharp/ql/src/Documentation/XmldocExtraTypeParam.ql +ql/csharp/ql/src/Documentation/XmldocMissing.ql +ql/csharp/ql/src/Documentation/XmldocMissingException.ql +ql/csharp/ql/src/Documentation/XmldocMissingParam.ql +ql/csharp/ql/src/Documentation/XmldocMissingReturn.ql +ql/csharp/ql/src/Documentation/XmldocMissingTypeParam.ql +ql/csharp/ql/src/Language Abuse/ForeachCapture.ql +ql/csharp/ql/src/Language Abuse/UselessIsBeforeAs.ql +ql/csharp/ql/src/Likely Bugs/BadCheckOdd.ql +ql/csharp/ql/src/Likely Bugs/RandomUsedOnce.ql +ql/csharp/ql/src/Metrics/Callables/CCyclomaticComplexity.ql +ql/csharp/ql/src/Metrics/Callables/CLinesOfCode.ql +ql/csharp/ql/src/Metrics/Callables/CLinesOfComment.ql +ql/csharp/ql/src/Metrics/Callables/CNumberOfParameters.ql +ql/csharp/ql/src/Metrics/Callables/CNumberOfStatements.ql +ql/csharp/ql/src/Metrics/Callables/CPercentageOfComments.ql +ql/csharp/ql/src/Metrics/Callables/StatementNestingDepth.ql +ql/csharp/ql/src/Metrics/Dependencies/ExternalDependencies.ql +ql/csharp/ql/src/Metrics/Dependencies/ExternalDependenciesSourceLinks.ql +ql/csharp/ql/src/Metrics/Files/FCommentRatio.ql +ql/csharp/ql/src/Metrics/Files/FCyclomaticComplexity.ql +ql/csharp/ql/src/Metrics/Files/FLines.ql +ql/csharp/ql/src/Metrics/Files/FLinesOfCode.ql +ql/csharp/ql/src/Metrics/Files/FLinesOfComment.ql +ql/csharp/ql/src/Metrics/Files/FLinesOfCommentedCode.ql +ql/csharp/ql/src/Metrics/Files/FNumberOfClasses.ql +ql/csharp/ql/src/Metrics/Files/FNumberOfInterfaces.ql +ql/csharp/ql/src/Metrics/Files/FNumberOfStructs.ql +ql/csharp/ql/src/Metrics/Files/FNumberOfTests.ql +ql/csharp/ql/src/Metrics/Files/FNumberOfUsingNamespaces.ql +ql/csharp/ql/src/Metrics/Files/FSelfContainedness.ql +ql/csharp/ql/src/Metrics/RefTypes/TAfferentCoupling.ql +ql/csharp/ql/src/Metrics/RefTypes/TEfferentCoupling.ql +ql/csharp/ql/src/Metrics/RefTypes/TInheritanceDepth.ql +ql/csharp/ql/src/Metrics/RefTypes/TLackOfCohesionCK.ql +ql/csharp/ql/src/Metrics/RefTypes/TLackOfCohesionHS.ql +ql/csharp/ql/src/Metrics/RefTypes/TNumberOfCallables.ql +ql/csharp/ql/src/Metrics/RefTypes/TNumberOfEvents.ql +ql/csharp/ql/src/Metrics/RefTypes/TNumberOfFields.ql +ql/csharp/ql/src/Metrics/RefTypes/TNumberOfIndexers.ql +ql/csharp/ql/src/Metrics/RefTypes/TNumberOfNonConstFields.ql +ql/csharp/ql/src/Metrics/RefTypes/TNumberOfProperties.ql +ql/csharp/ql/src/Metrics/RefTypes/TNumberOfStatements.ql +ql/csharp/ql/src/Metrics/RefTypes/TResponse.ql +ql/csharp/ql/src/Metrics/RefTypes/TSizeOfAPI.ql +ql/csharp/ql/src/Metrics/RefTypes/TSpecialisationIndex.ql +ql/csharp/ql/src/Metrics/RefTypes/TUnmanagedCode.ql +ql/csharp/ql/src/Metrics/Summaries/FrameworkCoverage.ql +ql/csharp/ql/src/Metrics/internal/ExtractorDiagnostics.ql +ql/csharp/ql/src/Security Features/CWE-016/ASPNetMaxRequestLength.ql +ql/csharp/ql/src/Security Features/CWE-016/ASPNetRequestValidationMode.ql +ql/csharp/ql/src/Security Features/CWE-020/ExternalAPIsUsedWithUntrustedData.ql +ql/csharp/ql/src/Security Features/CWE-020/UntrustedDataToExternalAPI.ql +ql/csharp/ql/src/Security Features/CWE-321/HardcodedEncryptionKey.ql +ql/csharp/ql/src/Security Features/CWE-321/HardcodedSymmetricEncryptionKey.ql +ql/csharp/ql/src/Security Features/CWE-327/DontInstallRootCert.ql +ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserialization.ql +ql/csharp/ql/src/Security Features/CWE-611/UseXmlSecureResolver.ql +ql/csharp/ql/src/Security Features/CWE-838/InappropriateEncoding.ql +ql/csharp/ql/src/Useless code/PointlessForwardingMethod.ql +ql/csharp/ql/src/definitions.ql +ql/csharp/ql/src/experimental/CWE-099/TaintedWebClient.ql +ql/csharp/ql/src/experimental/CWE-918/RequestForgery.ql +ql/csharp/ql/src/experimental/Security Features/CWE-1004/CookieWithoutHttpOnly.ql +ql/csharp/ql/src/experimental/Security Features/CWE-327/Azure/UnsafeUsageOfClientSideEncryptionVersion.ql +ql/csharp/ql/src/experimental/Security Features/CWE-614/CookieWithoutSecure.ql +ql/csharp/ql/src/experimental/Security Features/CWE-759/HashWithoutSalt.ql +ql/csharp/ql/src/experimental/Security Features/JsonWebTokenHandler/delegated-security-validations-always-return-true.ql +ql/csharp/ql/src/experimental/Security Features/JsonWebTokenHandler/security-validation-disabled.ql +ql/csharp/ql/src/experimental/Security Features/Serialization/DefiningDatasetRelatedType.ql +ql/csharp/ql/src/experimental/Security Features/Serialization/DefiningPotentiallyUnsafeXmlSerializer.ql +ql/csharp/ql/src/experimental/Security Features/Serialization/UnsafeTypeUsedDataContractSerializer.ql +ql/csharp/ql/src/experimental/Security Features/Serialization/XmlDeserializationWithDataSet.ql +ql/csharp/ql/src/experimental/Security Features/backdoor/DangerousNativeFunctionCall.ql +ql/csharp/ql/src/experimental/Security Features/backdoor/PotentialTimeBomb.ql +ql/csharp/ql/src/experimental/Security Features/backdoor/ProcessNameToHashTaintFlow.ql +ql/csharp/ql/src/filters/ClassifyFiles.ql +ql/csharp/ql/src/meta/frameworks/Coverage.ql +ql/csharp/ql/src/meta/frameworks/UnsupportedExternalAPIs.ql +ql/csharp/ql/src/utils/modelconverter/ExtractNeutrals.ql +ql/csharp/ql/src/utils/modelconverter/ExtractSinks.ql +ql/csharp/ql/src/utils/modelconverter/ExtractSources.ql +ql/csharp/ql/src/utils/modelconverter/ExtractSummaries.ql +ql/csharp/ql/src/utils/modeleditor/ApplicationModeEndpoints.ql +ql/csharp/ql/src/utils/modeleditor/FrameworkModeEndpoints.ql +ql/csharp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql +ql/csharp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql +ql/csharp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql +ql/csharp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql +ql/csharp/ql/src/utils/modelgenerator/CaptureSinkModels.ql +ql/csharp/ql/src/utils/modelgenerator/CaptureSourceModels.ql +ql/csharp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql +ql/csharp/ql/src/utils/modelgenerator/CaptureTypeBasedSummaryModels.ql +ql/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql +ql/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql diff --git a/csharp/ql/integration-tests/posix/query-suite/test.py b/csharp/ql/integration-tests/posix/query-suite/test.py new file mode 100644 index 000000000000..38f0643dfbbd --- /dev/null +++ b/csharp/ql/integration-tests/posix/query-suite/test.py @@ -0,0 +1,14 @@ +import runs_on +import pytest +from query_suites import * + +well_known_query_suites = ['csharp-code-quality.qls', 'csharp-security-and-quality.qls', 'csharp-security-extended.qls', 'csharp-code-scanning.qls'] + +@runs_on.posix +@pytest.mark.parametrize("query_suite", well_known_query_suites) +def test(codeql, csharp, check_query_suite, query_suite): + check_query_suite(query_suite) + +@runs_on.posix +def test_not_included_queries(codeql, csharp, check_queries_not_included): + check_queries_not_included('csharp', well_known_query_suites) diff --git a/go/ql/integration-tests/query-suite/go-code-quality.qls.expected b/go/ql/integration-tests/query-suite/go-code-quality.qls.expected new file mode 100644 index 000000000000..236c285ece05 --- /dev/null +++ b/go/ql/integration-tests/query-suite/go-code-quality.qls.expected @@ -0,0 +1,6 @@ +ql/go/ql/src/InconsistentCode/LengthComparisonOffByOne.ql +ql/go/ql/src/InconsistentCode/MissingErrorCheck.ql +ql/go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql +ql/go/ql/src/InconsistentCode/WrappedErrorAlwaysNil.ql +ql/go/ql/src/RedundantCode/NegativeLengthCheck.ql +ql/go/ql/src/RedundantCode/RedundantRecover.ql diff --git a/go/ql/integration-tests/query-suite/go-code-scanning.qls.expected b/go/ql/integration-tests/query-suite/go-code-scanning.qls.expected new file mode 100644 index 000000000000..609e21e82ec0 --- /dev/null +++ b/go/ql/integration-tests/query-suite/go-code-scanning.qls.expected @@ -0,0 +1,31 @@ +ql/go/ql/src/Diagnostics/ExtractionErrors.ql +ql/go/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +ql/go/ql/src/Security/CWE-020/IncompleteHostnameRegexp.ql +ql/go/ql/src/Security/CWE-020/IncompleteUrlSchemeCheck.ql +ql/go/ql/src/Security/CWE-020/MissingRegexpAnchor.ql +ql/go/ql/src/Security/CWE-020/SuspiciousCharacterInRegexp.ql +ql/go/ql/src/Security/CWE-022/TaintedPath.ql +ql/go/ql/src/Security/CWE-022/UnsafeUnzipSymlink.ql +ql/go/ql/src/Security/CWE-022/ZipSlip.ql +ql/go/ql/src/Security/CWE-078/CommandInjection.ql +ql/go/ql/src/Security/CWE-079/ReflectedXss.ql +ql/go/ql/src/Security/CWE-089/SqlInjection.ql +ql/go/ql/src/Security/CWE-089/StringBreak.ql +ql/go/ql/src/Security/CWE-190/AllocationSizeOverflow.ql +ql/go/ql/src/Security/CWE-209/StackTraceExposure.ql +ql/go/ql/src/Security/CWE-295/DisabledCertificateCheck.ql +ql/go/ql/src/Security/CWE-312/CleartextLogging.ql +ql/go/ql/src/Security/CWE-322/InsecureHostKeyCallback.ql +ql/go/ql/src/Security/CWE-326/InsufficientKeySize.ql +ql/go/ql/src/Security/CWE-327/InsecureTLS.ql +ql/go/ql/src/Security/CWE-338/InsecureRandomness.ql +ql/go/ql/src/Security/CWE-347/MissingJwtSignatureCheck.ql +ql/go/ql/src/Security/CWE-352/ConstantOauth2State.ql +ql/go/ql/src/Security/CWE-601/BadRedirectCheck.ql +ql/go/ql/src/Security/CWE-601/OpenUrlRedirect.ql +ql/go/ql/src/Security/CWE-640/EmailInjection.ql +ql/go/ql/src/Security/CWE-643/XPathInjection.ql +ql/go/ql/src/Security/CWE-681/IncorrectIntegerConversionQuery.ql +ql/go/ql/src/Security/CWE-770/UncontrolledAllocationSize.ql +ql/go/ql/src/Security/CWE-918/RequestForgery.ql +ql/go/ql/src/Summary/LinesOfCode.ql diff --git a/go/ql/integration-tests/query-suite/go-security-and-quality.qls.expected b/go/ql/integration-tests/query-suite/go-security-and-quality.qls.expected new file mode 100644 index 000000000000..46f21d921ef7 --- /dev/null +++ b/go/ql/integration-tests/query-suite/go-security-and-quality.qls.expected @@ -0,0 +1,55 @@ +ql/go/ql/src/Diagnostics/ExtractionErrors.ql +ql/go/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +ql/go/ql/src/InconsistentCode/ConstantLengthComparison.ql +ql/go/ql/src/InconsistentCode/InconsistentLoopOrientation.ql +ql/go/ql/src/InconsistentCode/LengthComparisonOffByOne.ql +ql/go/ql/src/InconsistentCode/MissingErrorCheck.ql +ql/go/ql/src/InconsistentCode/MistypedExponentiation.ql +ql/go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql +ql/go/ql/src/InconsistentCode/WhitespaceContradictsPrecedence.ql +ql/go/ql/src/InconsistentCode/WrappedErrorAlwaysNil.ql +ql/go/ql/src/RedundantCode/CompareIdenticalValues.ql +ql/go/ql/src/RedundantCode/DeadStoreOfField.ql +ql/go/ql/src/RedundantCode/DeadStoreOfLocal.ql +ql/go/ql/src/RedundantCode/DuplicateBranches.ql +ql/go/ql/src/RedundantCode/DuplicateCondition.ql +ql/go/ql/src/RedundantCode/DuplicateSwitchCase.ql +ql/go/ql/src/RedundantCode/ExprHasNoEffect.ql +ql/go/ql/src/RedundantCode/ImpossibleInterfaceNilCheck.ql +ql/go/ql/src/RedundantCode/NegativeLengthCheck.ql +ql/go/ql/src/RedundantCode/RedundantExpr.ql +ql/go/ql/src/RedundantCode/RedundantRecover.ql +ql/go/ql/src/RedundantCode/SelfAssignment.ql +ql/go/ql/src/RedundantCode/ShiftOutOfRange.ql +ql/go/ql/src/RedundantCode/UnreachableStatement.ql +ql/go/ql/src/Security/CWE-020/IncompleteHostnameRegexp.ql +ql/go/ql/src/Security/CWE-020/IncompleteUrlSchemeCheck.ql +ql/go/ql/src/Security/CWE-020/MissingRegexpAnchor.ql +ql/go/ql/src/Security/CWE-020/SuspiciousCharacterInRegexp.ql +ql/go/ql/src/Security/CWE-022/TaintedPath.ql +ql/go/ql/src/Security/CWE-022/UnsafeUnzipSymlink.ql +ql/go/ql/src/Security/CWE-022/ZipSlip.ql +ql/go/ql/src/Security/CWE-078/CommandInjection.ql +ql/go/ql/src/Security/CWE-079/ReflectedXss.ql +ql/go/ql/src/Security/CWE-089/SqlInjection.ql +ql/go/ql/src/Security/CWE-089/StringBreak.ql +ql/go/ql/src/Security/CWE-117/LogInjection.ql +ql/go/ql/src/Security/CWE-190/AllocationSizeOverflow.ql +ql/go/ql/src/Security/CWE-209/StackTraceExposure.ql +ql/go/ql/src/Security/CWE-295/DisabledCertificateCheck.ql +ql/go/ql/src/Security/CWE-312/CleartextLogging.ql +ql/go/ql/src/Security/CWE-322/InsecureHostKeyCallback.ql +ql/go/ql/src/Security/CWE-326/InsufficientKeySize.ql +ql/go/ql/src/Security/CWE-327/InsecureTLS.ql +ql/go/ql/src/Security/CWE-338/InsecureRandomness.ql +ql/go/ql/src/Security/CWE-347/MissingJwtSignatureCheck.ql +ql/go/ql/src/Security/CWE-352/ConstantOauth2State.ql +ql/go/ql/src/Security/CWE-601/BadRedirectCheck.ql +ql/go/ql/src/Security/CWE-601/OpenUrlRedirect.ql +ql/go/ql/src/Security/CWE-640/EmailInjection.ql +ql/go/ql/src/Security/CWE-643/XPathInjection.ql +ql/go/ql/src/Security/CWE-681/IncorrectIntegerConversionQuery.ql +ql/go/ql/src/Security/CWE-770/UncontrolledAllocationSize.ql +ql/go/ql/src/Security/CWE-798/HardcodedCredentials.ql +ql/go/ql/src/Security/CWE-918/RequestForgery.ql +ql/go/ql/src/Summary/LinesOfCode.ql diff --git a/go/ql/integration-tests/query-suite/go-security-extended.qls.expected b/go/ql/integration-tests/query-suite/go-security-extended.qls.expected new file mode 100644 index 000000000000..a206ef2364ab --- /dev/null +++ b/go/ql/integration-tests/query-suite/go-security-extended.qls.expected @@ -0,0 +1,33 @@ +ql/go/ql/src/Diagnostics/ExtractionErrors.ql +ql/go/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +ql/go/ql/src/Security/CWE-020/IncompleteHostnameRegexp.ql +ql/go/ql/src/Security/CWE-020/IncompleteUrlSchemeCheck.ql +ql/go/ql/src/Security/CWE-020/MissingRegexpAnchor.ql +ql/go/ql/src/Security/CWE-020/SuspiciousCharacterInRegexp.ql +ql/go/ql/src/Security/CWE-022/TaintedPath.ql +ql/go/ql/src/Security/CWE-022/UnsafeUnzipSymlink.ql +ql/go/ql/src/Security/CWE-022/ZipSlip.ql +ql/go/ql/src/Security/CWE-078/CommandInjection.ql +ql/go/ql/src/Security/CWE-079/ReflectedXss.ql +ql/go/ql/src/Security/CWE-089/SqlInjection.ql +ql/go/ql/src/Security/CWE-089/StringBreak.ql +ql/go/ql/src/Security/CWE-117/LogInjection.ql +ql/go/ql/src/Security/CWE-190/AllocationSizeOverflow.ql +ql/go/ql/src/Security/CWE-209/StackTraceExposure.ql +ql/go/ql/src/Security/CWE-295/DisabledCertificateCheck.ql +ql/go/ql/src/Security/CWE-312/CleartextLogging.ql +ql/go/ql/src/Security/CWE-322/InsecureHostKeyCallback.ql +ql/go/ql/src/Security/CWE-326/InsufficientKeySize.ql +ql/go/ql/src/Security/CWE-327/InsecureTLS.ql +ql/go/ql/src/Security/CWE-338/InsecureRandomness.ql +ql/go/ql/src/Security/CWE-347/MissingJwtSignatureCheck.ql +ql/go/ql/src/Security/CWE-352/ConstantOauth2State.ql +ql/go/ql/src/Security/CWE-601/BadRedirectCheck.ql +ql/go/ql/src/Security/CWE-601/OpenUrlRedirect.ql +ql/go/ql/src/Security/CWE-640/EmailInjection.ql +ql/go/ql/src/Security/CWE-643/XPathInjection.ql +ql/go/ql/src/Security/CWE-681/IncorrectIntegerConversionQuery.ql +ql/go/ql/src/Security/CWE-770/UncontrolledAllocationSize.ql +ql/go/ql/src/Security/CWE-798/HardcodedCredentials.ql +ql/go/ql/src/Security/CWE-918/RequestForgery.ql +ql/go/ql/src/Summary/LinesOfCode.ql diff --git a/go/ql/integration-tests/query-suite/not_included_in_qls.expected b/go/ql/integration-tests/query-suite/not_included_in_qls.expected new file mode 100644 index 000000000000..751c76041a29 --- /dev/null +++ b/go/ql/integration-tests/query-suite/not_included_in_qls.expected @@ -0,0 +1,33 @@ +ql/go/ql/src/AlertSuppression.ql +ql/go/ql/src/Metrics/FLinesOfCode.ql +ql/go/ql/src/Metrics/FLinesOfComment.ql +ql/go/ql/src/Security/CWE-020/ExternalAPIsUsedWithUntrustedData.ql +ql/go/ql/src/Security/CWE-020/UntrustedDataToExternalAPI.ql +ql/go/ql/src/Security/CWE-020/UntrustedDataToUnknownExternalAPI.ql +ql/go/ql/src/Security/CWE-078/StoredCommand.ql +ql/go/ql/src/Security/CWE-079/StoredXss.ql +ql/go/ql/src/definitions.ql +ql/go/ql/src/experimental/CWE-090/LDAPInjection.ql +ql/go/ql/src/experimental/CWE-1004/CookieWithoutHttpOnly.ql +ql/go/ql/src/experimental/CWE-203/Timing.ql +ql/go/ql/src/experimental/CWE-285/PamAuthBypass.ql +ql/go/ql/src/experimental/CWE-287/ImproperLdapAuth.ql +ql/go/ql/src/experimental/CWE-321-V2/HardCodedKeys.ql +ql/go/ql/src/experimental/CWE-327/WeakCryptoAlgorithm.ql +ql/go/ql/src/experimental/CWE-369/DivideByZero.ql +ql/go/ql/src/experimental/CWE-400/DatabaseCallInLoop.ql +ql/go/ql/src/experimental/CWE-522-DecompressionBombs/DecompressionBombs.ql +ql/go/ql/src/experimental/CWE-525/WebCacheDeception.ql +ql/go/ql/src/experimental/CWE-74/DsnInjection.ql +ql/go/ql/src/experimental/CWE-74/DsnInjectionLocal.ql +ql/go/ql/src/experimental/CWE-79/HTMLTemplateEscapingPassthrough.ql +ql/go/ql/src/experimental/CWE-807/SensitiveConditionBypass.ql +ql/go/ql/src/experimental/CWE-840/ConditionalBypass.ql +ql/go/ql/src/experimental/CWE-918/SSRF.ql +ql/go/ql/src/experimental/CWE-942/CorsMisconfiguration.ql +ql/go/ql/src/experimental/InconsistentCode/DeferInLoop.ql +ql/go/ql/src/experimental/InconsistentCode/GORMErrorNotChecked.ql +ql/go/ql/src/experimental/IntegerOverflow/IntegerOverflow.ql +ql/go/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql +ql/go/ql/src/filters/ClassifyFiles.ql +ql/go/ql/src/meta/frameworks/Coverage.ql diff --git a/go/ql/integration-tests/query-suite/test.py b/go/ql/integration-tests/query-suite/test.py new file mode 100644 index 000000000000..d4c6f9f37099 --- /dev/null +++ b/go/ql/integration-tests/query-suite/test.py @@ -0,0 +1,14 @@ +import runs_on +import pytest +from query_suites import * + +well_known_query_suites = ['go-code-quality.qls', 'go-security-and-quality.qls', 'go-security-extended.qls', 'go-code-scanning.qls'] + +@runs_on.posix +@pytest.mark.parametrize("query_suite", well_known_query_suites) +def test(codeql, go, check_query_suite, query_suite): + check_query_suite(query_suite) + +@runs_on.posix +def test_not_included_queries(codeql, go, check_queries_not_included): + check_queries_not_included('go', well_known_query_suites) diff --git a/javascript/ql/integration-tests/query-suite/javascript-code-quality.qls.expected b/javascript/ql/integration-tests/query-suite/javascript-code-quality.qls.expected new file mode 100644 index 000000000000..e4620badfc82 --- /dev/null +++ b/javascript/ql/integration-tests/query-suite/javascript-code-quality.qls.expected @@ -0,0 +1,5 @@ +ql/javascript/ql/src/Declarations/IneffectiveParameterType.ql +ql/javascript/ql/src/Expressions/ExprHasNoEffect.ql +ql/javascript/ql/src/Expressions/MissingAwait.ql +ql/javascript/ql/src/LanguageFeatures/SpuriousArguments.ql +ql/javascript/ql/src/RegExp/RegExpAlwaysMatches.ql diff --git a/javascript/ql/integration-tests/query-suite/javascript-code-scanning.qls.expected b/javascript/ql/integration-tests/query-suite/javascript-code-scanning.qls.expected new file mode 100644 index 000000000000..7f7ab7aa326d --- /dev/null +++ b/javascript/ql/integration-tests/query-suite/javascript-code-scanning.qls.expected @@ -0,0 +1,90 @@ +ql/javascript/ql/src/AngularJS/DisablingSce.ql +ql/javascript/ql/src/AngularJS/DoubleCompilation.ql +ql/javascript/ql/src/AngularJS/InsecureUrlWhitelist.ql +ql/javascript/ql/src/Diagnostics/ExtractedFiles.ql +ql/javascript/ql/src/Diagnostics/ExtractionErrors.ql +ql/javascript/ql/src/Electron/AllowRunningInsecureContent.ql +ql/javascript/ql/src/Electron/DisablingWebSecurity.ql +ql/javascript/ql/src/Performance/PolynomialReDoS.ql +ql/javascript/ql/src/Performance/ReDoS.ql +ql/javascript/ql/src/RegExp/IdentityReplacement.ql +ql/javascript/ql/src/Security/CWE-020/IncompleteHostnameRegExp.ql +ql/javascript/ql/src/Security/CWE-020/IncompleteUrlSchemeCheck.ql +ql/javascript/ql/src/Security/CWE-020/IncompleteUrlSubstringSanitization.ql +ql/javascript/ql/src/Security/CWE-020/IncorrectSuffixCheck.ql +ql/javascript/ql/src/Security/CWE-020/OverlyLargeRange.ql +ql/javascript/ql/src/Security/CWE-020/UselessRegExpCharacterEscape.ql +ql/javascript/ql/src/Security/CWE-022/TaintedPath.ql +ql/javascript/ql/src/Security/CWE-022/ZipSlip.ql +ql/javascript/ql/src/Security/CWE-073/TemplateObjectInjection.ql +ql/javascript/ql/src/Security/CWE-078/CommandInjection.ql +ql/javascript/ql/src/Security/CWE-078/SecondOrderCommandInjection.ql +ql/javascript/ql/src/Security/CWE-078/ShellCommandInjectionFromEnvironment.ql +ql/javascript/ql/src/Security/CWE-078/UnsafeShellCommandConstruction.ql +ql/javascript/ql/src/Security/CWE-078/UselessUseOfCat.ql +ql/javascript/ql/src/Security/CWE-079/ExceptionXss.ql +ql/javascript/ql/src/Security/CWE-079/ReflectedXss.ql +ql/javascript/ql/src/Security/CWE-079/StoredXss.ql +ql/javascript/ql/src/Security/CWE-079/UnsafeHtmlConstruction.ql +ql/javascript/ql/src/Security/CWE-079/UnsafeJQueryPlugin.ql +ql/javascript/ql/src/Security/CWE-079/Xss.ql +ql/javascript/ql/src/Security/CWE-079/XssThroughDom.ql +ql/javascript/ql/src/Security/CWE-089/SqlInjection.ql +ql/javascript/ql/src/Security/CWE-094/CodeInjection.ql +ql/javascript/ql/src/Security/CWE-094/ExpressionInjection.ql +ql/javascript/ql/src/Security/CWE-094/ImproperCodeSanitization.ql +ql/javascript/ql/src/Security/CWE-094/UnsafeDynamicMethodAccess.ql +ql/javascript/ql/src/Security/CWE-1004/ClientExposedCookie.ql +ql/javascript/ql/src/Security/CWE-116/BadTagFilter.ql +ql/javascript/ql/src/Security/CWE-116/DoubleEscaping.ql +ql/javascript/ql/src/Security/CWE-116/IncompleteHtmlAttributeSanitization.ql +ql/javascript/ql/src/Security/CWE-116/IncompleteMultiCharacterSanitization.ql +ql/javascript/ql/src/Security/CWE-116/IncompleteSanitization.ql +ql/javascript/ql/src/Security/CWE-116/UnsafeHtmlExpansion.ql +ql/javascript/ql/src/Security/CWE-134/TaintedFormatString.ql +ql/javascript/ql/src/Security/CWE-178/CaseSensitiveMiddlewarePath.ql +ql/javascript/ql/src/Security/CWE-200/PrivateFileExposure.ql +ql/javascript/ql/src/Security/CWE-201/PostMessageStar.ql +ql/javascript/ql/src/Security/CWE-209/StackTraceExposure.ql +ql/javascript/ql/src/Security/CWE-295/DisablingCertificateValidation.ql +ql/javascript/ql/src/Security/CWE-300/InsecureDependencyResolution.ql +ql/javascript/ql/src/Security/CWE-312/ActionsArtifactLeak.ql +ql/javascript/ql/src/Security/CWE-312/BuildArtifactLeak.ql +ql/javascript/ql/src/Security/CWE-312/CleartextLogging.ql +ql/javascript/ql/src/Security/CWE-312/CleartextStorage.ql +ql/javascript/ql/src/Security/CWE-326/InsufficientKeySize.ql +ql/javascript/ql/src/Security/CWE-327/BadRandomness.ql +ql/javascript/ql/src/Security/CWE-327/BrokenCryptoAlgorithm.ql +ql/javascript/ql/src/Security/CWE-338/InsecureRandomness.ql +ql/javascript/ql/src/Security/CWE-346/CorsMisconfigurationForCredentials.ql +ql/javascript/ql/src/Security/CWE-347/MissingJWTKeyVerification.ql +ql/javascript/ql/src/Security/CWE-352/MissingCsrfMiddleware.ql +ql/javascript/ql/src/Security/CWE-400/DeepObjectResourceExhaustion.ql +ql/javascript/ql/src/Security/CWE-502/UnsafeDeserialization.ql +ql/javascript/ql/src/Security/CWE-598/SensitiveGetQuery.ql +ql/javascript/ql/src/Security/CWE-601/ClientSideUrlRedirect.ql +ql/javascript/ql/src/Security/CWE-601/ServerSideUrlRedirect.ql +ql/javascript/ql/src/Security/CWE-611/Xxe.ql +ql/javascript/ql/src/Security/CWE-614/ClearTextCookie.ql +ql/javascript/ql/src/Security/CWE-640/HostHeaderPoisoningInEmailGeneration.ql +ql/javascript/ql/src/Security/CWE-643/XpathInjection.ql +ql/javascript/ql/src/Security/CWE-693/InsecureHelmet.ql +ql/javascript/ql/src/Security/CWE-730/RegExpInjection.ql +ql/javascript/ql/src/Security/CWE-730/ServerCrash.ql +ql/javascript/ql/src/Security/CWE-754/UnvalidatedDynamicMethodCall.ql +ql/javascript/ql/src/Security/CWE-770/MissingRateLimiting.ql +ql/javascript/ql/src/Security/CWE-770/ResourceExhaustion.ql +ql/javascript/ql/src/Security/CWE-776/XmlBomb.ql +ql/javascript/ql/src/Security/CWE-798/HardcodedCredentials.ql +ql/javascript/ql/src/Security/CWE-829/InsecureDownload.ql +ql/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedDomain.ql +ql/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedSource.ql +ql/javascript/ql/src/Security/CWE-834/LoopBoundInjection.ql +ql/javascript/ql/src/Security/CWE-843/TypeConfusionThroughParameterTampering.ql +ql/javascript/ql/src/Security/CWE-915/PrototypePollutingAssignment.ql +ql/javascript/ql/src/Security/CWE-915/PrototypePollutingFunction.ql +ql/javascript/ql/src/Security/CWE-915/PrototypePollutingMergeCall.ql +ql/javascript/ql/src/Security/CWE-916/InsufficientPasswordHash.ql +ql/javascript/ql/src/Security/CWE-918/RequestForgery.ql +ql/javascript/ql/src/Summary/LinesOfCode.ql +ql/javascript/ql/src/Summary/LinesOfUserCode.ql diff --git a/javascript/ql/integration-tests/query-suite/javascript-security-and-quality.qls.expected b/javascript/ql/integration-tests/query-suite/javascript-security-and-quality.qls.expected new file mode 100644 index 000000000000..63f6629f7bfd --- /dev/null +++ b/javascript/ql/integration-tests/query-suite/javascript-security-and-quality.qls.expected @@ -0,0 +1,205 @@ +ql/javascript/ql/src/AngularJS/DependencyMismatch.ql +ql/javascript/ql/src/AngularJS/DisablingSce.ql +ql/javascript/ql/src/AngularJS/DoubleCompilation.ql +ql/javascript/ql/src/AngularJS/DuplicateDependency.ql +ql/javascript/ql/src/AngularJS/IncompatibleService.ql +ql/javascript/ql/src/AngularJS/InsecureUrlWhitelist.ql +ql/javascript/ql/src/AngularJS/MissingExplicitInjection.ql +ql/javascript/ql/src/AngularJS/RepeatedInjection.ql +ql/javascript/ql/src/AngularJS/UseNgSrc.ql +ql/javascript/ql/src/DOM/DuplicateAttributes.ql +ql/javascript/ql/src/DOM/MalformedIdAttribute.ql +ql/javascript/ql/src/DOM/PseudoEval.ql +ql/javascript/ql/src/Declarations/ArgumentsRedefined.ql +ql/javascript/ql/src/Declarations/AssignmentToConst.ql +ql/javascript/ql/src/Declarations/ClobberingVarInit.ql +ql/javascript/ql/src/Declarations/ConflictingFunctions.ql +ql/javascript/ql/src/Declarations/DeadStoreOfLocal.ql +ql/javascript/ql/src/Declarations/DeadStoreOfProperty.ql +ql/javascript/ql/src/Declarations/DeclBeforeUse.ql +ql/javascript/ql/src/Declarations/DefaultArgumentReferencesNestedFunction.ql +ql/javascript/ql/src/Declarations/DuplicateVarDecl.ql +ql/javascript/ql/src/Declarations/IneffectiveParameterType.ql +ql/javascript/ql/src/Declarations/MissingThisQualifier.ql +ql/javascript/ql/src/Declarations/MissingVarDecl.ql +ql/javascript/ql/src/Declarations/MixedStaticInstanceThisAccess.ql +ql/javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql +ql/javascript/ql/src/Declarations/TemporalDeadZone.ql +ql/javascript/ql/src/Declarations/UniqueParameterNames.ql +ql/javascript/ql/src/Declarations/UniquePropertyNames.ql +ql/javascript/ql/src/Declarations/UnreachableMethodOverloads.ql +ql/javascript/ql/src/Declarations/UnusedVariable.ql +ql/javascript/ql/src/Diagnostics/ExtractedFiles.ql +ql/javascript/ql/src/Diagnostics/ExtractionErrors.ql +ql/javascript/ql/src/Electron/AllowRunningInsecureContent.ql +ql/javascript/ql/src/Electron/DisablingWebSecurity.ql +ql/javascript/ql/src/Expressions/ComparisonWithNaN.ql +ql/javascript/ql/src/Expressions/DuplicateCondition.ql +ql/javascript/ql/src/Expressions/DuplicateProperty.ql +ql/javascript/ql/src/Expressions/DuplicateSwitchCase.ql +ql/javascript/ql/src/Expressions/ExprHasNoEffect.ql +ql/javascript/ql/src/Expressions/HeterogeneousComparison.ql +ql/javascript/ql/src/Expressions/ImplicitOperandConversion.ql +ql/javascript/ql/src/Expressions/MissingAwait.ql +ql/javascript/ql/src/Expressions/MissingDotLengthInComparison.ql +ql/javascript/ql/src/Expressions/MissingSpaceInAppend.ql +ql/javascript/ql/src/Expressions/MisspelledVariableName.ql +ql/javascript/ql/src/Expressions/RedundantExpression.ql +ql/javascript/ql/src/Expressions/SelfAssignment.ql +ql/javascript/ql/src/Expressions/ShiftOutOfRange.ql +ql/javascript/ql/src/Expressions/StringInsteadOfRegex.ql +ql/javascript/ql/src/Expressions/SuspiciousInvocation.ql +ql/javascript/ql/src/Expressions/SuspiciousPropAccess.ql +ql/javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql +ql/javascript/ql/src/Expressions/UnclearOperatorPrecedence.ql +ql/javascript/ql/src/Expressions/UnknownDirective.ql +ql/javascript/ql/src/Expressions/UnneededDefensiveProgramming.ql +ql/javascript/ql/src/Expressions/WhitespaceContradictsPrecedence.ql +ql/javascript/ql/src/LanguageFeatures/BadTypeof.ql +ql/javascript/ql/src/LanguageFeatures/ConditionalComments.ql +ql/javascript/ql/src/LanguageFeatures/DeleteVar.ql +ql/javascript/ql/src/LanguageFeatures/ExpressionClosures.ql +ql/javascript/ql/src/LanguageFeatures/ForInComprehensionBlocks.ql +ql/javascript/ql/src/LanguageFeatures/IllegalInvocation.ql +ql/javascript/ql/src/LanguageFeatures/InconsistentNew.ql +ql/javascript/ql/src/LanguageFeatures/InvalidPrototype.ql +ql/javascript/ql/src/LanguageFeatures/LengthComparisonOffByOne.ql +ql/javascript/ql/src/LanguageFeatures/NonLinearPattern.ql +ql/javascript/ql/src/LanguageFeatures/PropertyWriteOnPrimitive.ql +ql/javascript/ql/src/LanguageFeatures/SemicolonInsertion.ql +ql/javascript/ql/src/LanguageFeatures/SetterReturn.ql +ql/javascript/ql/src/LanguageFeatures/SpuriousArguments.ql +ql/javascript/ql/src/LanguageFeatures/StrictModeCallStackIntrospection.ql +ql/javascript/ql/src/LanguageFeatures/SyntaxError.ql +ql/javascript/ql/src/LanguageFeatures/TemplateSyntaxInStringLiteral.ql +ql/javascript/ql/src/LanguageFeatures/ThisBeforeSuper.ql +ql/javascript/ql/src/LanguageFeatures/UnusedIndexVariable.ql +ql/javascript/ql/src/LanguageFeatures/WithStatement.ql +ql/javascript/ql/src/LanguageFeatures/YieldInNonGenerator.ql +ql/javascript/ql/src/NodeJS/InvalidExport.ql +ql/javascript/ql/src/NodeJS/MissingExports.ql +ql/javascript/ql/src/Performance/PolynomialReDoS.ql +ql/javascript/ql/src/Performance/ReDoS.ql +ql/javascript/ql/src/React/DirectStateMutation.ql +ql/javascript/ql/src/React/InconsistentStateUpdate.ql +ql/javascript/ql/src/React/UnsupportedStateUpdateInLifecycleMethod.ql +ql/javascript/ql/src/React/UnusedOrUndefinedStateProperty.ql +ql/javascript/ql/src/RegExp/BackrefBeforeGroup.ql +ql/javascript/ql/src/RegExp/BackrefIntoNegativeLookahead.ql +ql/javascript/ql/src/RegExp/DuplicateCharacterInCharacterClass.ql +ql/javascript/ql/src/RegExp/EmptyCharacterClass.ql +ql/javascript/ql/src/RegExp/IdentityReplacement.ql +ql/javascript/ql/src/RegExp/RegExpAlwaysMatches.ql +ql/javascript/ql/src/RegExp/UnboundBackref.ql +ql/javascript/ql/src/RegExp/UnmatchableCaret.ql +ql/javascript/ql/src/RegExp/UnmatchableDollar.ql +ql/javascript/ql/src/Security/CWE-020/IncompleteHostnameRegExp.ql +ql/javascript/ql/src/Security/CWE-020/IncompleteUrlSchemeCheck.ql +ql/javascript/ql/src/Security/CWE-020/IncompleteUrlSubstringSanitization.ql +ql/javascript/ql/src/Security/CWE-020/IncorrectSuffixCheck.ql +ql/javascript/ql/src/Security/CWE-020/MissingOriginCheck.ql +ql/javascript/ql/src/Security/CWE-020/MissingRegExpAnchor.ql +ql/javascript/ql/src/Security/CWE-020/OverlyLargeRange.ql +ql/javascript/ql/src/Security/CWE-020/UselessRegExpCharacterEscape.ql +ql/javascript/ql/src/Security/CWE-022/TaintedPath.ql +ql/javascript/ql/src/Security/CWE-022/ZipSlip.ql +ql/javascript/ql/src/Security/CWE-073/TemplateObjectInjection.ql +ql/javascript/ql/src/Security/CWE-078/CommandInjection.ql +ql/javascript/ql/src/Security/CWE-078/IndirectCommandInjection.ql +ql/javascript/ql/src/Security/CWE-078/SecondOrderCommandInjection.ql +ql/javascript/ql/src/Security/CWE-078/ShellCommandInjectionFromEnvironment.ql +ql/javascript/ql/src/Security/CWE-078/UnsafeShellCommandConstruction.ql +ql/javascript/ql/src/Security/CWE-078/UselessUseOfCat.ql +ql/javascript/ql/src/Security/CWE-079/ExceptionXss.ql +ql/javascript/ql/src/Security/CWE-079/ReflectedXss.ql +ql/javascript/ql/src/Security/CWE-079/StoredXss.ql +ql/javascript/ql/src/Security/CWE-079/UnsafeHtmlConstruction.ql +ql/javascript/ql/src/Security/CWE-079/UnsafeJQueryPlugin.ql +ql/javascript/ql/src/Security/CWE-079/Xss.ql +ql/javascript/ql/src/Security/CWE-079/XssThroughDom.ql +ql/javascript/ql/src/Security/CWE-089/SqlInjection.ql +ql/javascript/ql/src/Security/CWE-094/CodeInjection.ql +ql/javascript/ql/src/Security/CWE-094/ExpressionInjection.ql +ql/javascript/ql/src/Security/CWE-094/ImproperCodeSanitization.ql +ql/javascript/ql/src/Security/CWE-094/UnsafeCodeConstruction.ql +ql/javascript/ql/src/Security/CWE-094/UnsafeDynamicMethodAccess.ql +ql/javascript/ql/src/Security/CWE-1004/ClientExposedCookie.ql +ql/javascript/ql/src/Security/CWE-116/BadTagFilter.ql +ql/javascript/ql/src/Security/CWE-116/DoubleEscaping.ql +ql/javascript/ql/src/Security/CWE-116/IncompleteHtmlAttributeSanitization.ql +ql/javascript/ql/src/Security/CWE-116/IncompleteMultiCharacterSanitization.ql +ql/javascript/ql/src/Security/CWE-116/IncompleteSanitization.ql +ql/javascript/ql/src/Security/CWE-116/UnsafeHtmlExpansion.ql +ql/javascript/ql/src/Security/CWE-117/LogInjection.ql +ql/javascript/ql/src/Security/CWE-1275/SameSiteNoneCookie.ql +ql/javascript/ql/src/Security/CWE-134/TaintedFormatString.ql +ql/javascript/ql/src/Security/CWE-178/CaseSensitiveMiddlewarePath.ql +ql/javascript/ql/src/Security/CWE-200/FileAccessToHttp.ql +ql/javascript/ql/src/Security/CWE-200/PrivateFileExposure.ql +ql/javascript/ql/src/Security/CWE-201/PostMessageStar.ql +ql/javascript/ql/src/Security/CWE-209/StackTraceExposure.ql +ql/javascript/ql/src/Security/CWE-295/DisablingCertificateValidation.ql +ql/javascript/ql/src/Security/CWE-300/InsecureDependencyResolution.ql +ql/javascript/ql/src/Security/CWE-312/ActionsArtifactLeak.ql +ql/javascript/ql/src/Security/CWE-312/BuildArtifactLeak.ql +ql/javascript/ql/src/Security/CWE-312/CleartextLogging.ql +ql/javascript/ql/src/Security/CWE-312/CleartextStorage.ql +ql/javascript/ql/src/Security/CWE-313/PasswordInConfigurationFile.ql +ql/javascript/ql/src/Security/CWE-326/InsufficientKeySize.ql +ql/javascript/ql/src/Security/CWE-327/BadRandomness.ql +ql/javascript/ql/src/Security/CWE-327/BrokenCryptoAlgorithm.ql +ql/javascript/ql/src/Security/CWE-338/InsecureRandomness.ql +ql/javascript/ql/src/Security/CWE-346/CorsMisconfigurationForCredentials.ql +ql/javascript/ql/src/Security/CWE-347/MissingJWTKeyVerification.ql +ql/javascript/ql/src/Security/CWE-352/MissingCsrfMiddleware.ql +ql/javascript/ql/src/Security/CWE-367/FileSystemRace.ql +ql/javascript/ql/src/Security/CWE-377/InsecureTemporaryFile.ql +ql/javascript/ql/src/Security/CWE-384/SessionFixation.ql +ql/javascript/ql/src/Security/CWE-400/DeepObjectResourceExhaustion.ql +ql/javascript/ql/src/Security/CWE-400/RemotePropertyInjection.ql +ql/javascript/ql/src/Security/CWE-502/UnsafeDeserialization.ql +ql/javascript/ql/src/Security/CWE-506/HardcodedDataInterpretedAsCode.ql +ql/javascript/ql/src/Security/CWE-598/SensitiveGetQuery.ql +ql/javascript/ql/src/Security/CWE-601/ClientSideUrlRedirect.ql +ql/javascript/ql/src/Security/CWE-601/ServerSideUrlRedirect.ql +ql/javascript/ql/src/Security/CWE-611/Xxe.ql +ql/javascript/ql/src/Security/CWE-614/ClearTextCookie.ql +ql/javascript/ql/src/Security/CWE-640/HostHeaderPoisoningInEmailGeneration.ql +ql/javascript/ql/src/Security/CWE-643/XpathInjection.ql +ql/javascript/ql/src/Security/CWE-693/InsecureHelmet.ql +ql/javascript/ql/src/Security/CWE-730/RegExpInjection.ql +ql/javascript/ql/src/Security/CWE-730/ServerCrash.ql +ql/javascript/ql/src/Security/CWE-754/UnvalidatedDynamicMethodCall.ql +ql/javascript/ql/src/Security/CWE-770/MissingRateLimiting.ql +ql/javascript/ql/src/Security/CWE-770/ResourceExhaustion.ql +ql/javascript/ql/src/Security/CWE-776/XmlBomb.ql +ql/javascript/ql/src/Security/CWE-798/HardcodedCredentials.ql +ql/javascript/ql/src/Security/CWE-807/ConditionalBypass.ql +ql/javascript/ql/src/Security/CWE-829/InsecureDownload.ql +ql/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedDomain.ql +ql/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedSource.ql +ql/javascript/ql/src/Security/CWE-834/LoopBoundInjection.ql +ql/javascript/ql/src/Security/CWE-843/TypeConfusionThroughParameterTampering.ql +ql/javascript/ql/src/Security/CWE-862/EmptyPasswordInConfigurationFile.ql +ql/javascript/ql/src/Security/CWE-912/HttpToFileAccess.ql +ql/javascript/ql/src/Security/CWE-915/PrototypePollutingAssignment.ql +ql/javascript/ql/src/Security/CWE-915/PrototypePollutingFunction.ql +ql/javascript/ql/src/Security/CWE-915/PrototypePollutingMergeCall.ql +ql/javascript/ql/src/Security/CWE-916/InsufficientPasswordHash.ql +ql/javascript/ql/src/Security/CWE-918/ClientSideRequestForgery.ql +ql/javascript/ql/src/Security/CWE-918/RequestForgery.ql +ql/javascript/ql/src/Statements/DanglingElse.ql +ql/javascript/ql/src/Statements/IgnoreArrayResult.ql +ql/javascript/ql/src/Statements/InconsistentLoopOrientation.ql +ql/javascript/ql/src/Statements/LabelInCase.ql +ql/javascript/ql/src/Statements/LoopIterationSkippedDueToShifting.ql +ql/javascript/ql/src/Statements/MisleadingIndentationAfterControlStmt.ql +ql/javascript/ql/src/Statements/ReturnAssignsLocal.ql +ql/javascript/ql/src/Statements/SuspiciousUnusedLoopIterationVariable.ql +ql/javascript/ql/src/Statements/UnreachableStatement.ql +ql/javascript/ql/src/Statements/UseOfReturnlessFunction.ql +ql/javascript/ql/src/Statements/UselessComparisonTest.ql +ql/javascript/ql/src/Statements/UselessConditional.ql +ql/javascript/ql/src/Summary/LinesOfCode.ql +ql/javascript/ql/src/Summary/LinesOfUserCode.ql +ql/javascript/ql/src/Vue/ArrowMethodOnVueInstance.ql diff --git a/javascript/ql/integration-tests/query-suite/javascript-security-extended.qls.expected b/javascript/ql/integration-tests/query-suite/javascript-security-extended.qls.expected new file mode 100644 index 000000000000..29ae7fd6939e --- /dev/null +++ b/javascript/ql/integration-tests/query-suite/javascript-security-extended.qls.expected @@ -0,0 +1,107 @@ +ql/javascript/ql/src/AngularJS/DisablingSce.ql +ql/javascript/ql/src/AngularJS/DoubleCompilation.ql +ql/javascript/ql/src/AngularJS/InsecureUrlWhitelist.ql +ql/javascript/ql/src/Diagnostics/ExtractedFiles.ql +ql/javascript/ql/src/Diagnostics/ExtractionErrors.ql +ql/javascript/ql/src/Electron/AllowRunningInsecureContent.ql +ql/javascript/ql/src/Electron/DisablingWebSecurity.ql +ql/javascript/ql/src/Performance/PolynomialReDoS.ql +ql/javascript/ql/src/Performance/ReDoS.ql +ql/javascript/ql/src/RegExp/IdentityReplacement.ql +ql/javascript/ql/src/Security/CWE-020/IncompleteHostnameRegExp.ql +ql/javascript/ql/src/Security/CWE-020/IncompleteUrlSchemeCheck.ql +ql/javascript/ql/src/Security/CWE-020/IncompleteUrlSubstringSanitization.ql +ql/javascript/ql/src/Security/CWE-020/IncorrectSuffixCheck.ql +ql/javascript/ql/src/Security/CWE-020/MissingOriginCheck.ql +ql/javascript/ql/src/Security/CWE-020/MissingRegExpAnchor.ql +ql/javascript/ql/src/Security/CWE-020/OverlyLargeRange.ql +ql/javascript/ql/src/Security/CWE-020/UselessRegExpCharacterEscape.ql +ql/javascript/ql/src/Security/CWE-022/TaintedPath.ql +ql/javascript/ql/src/Security/CWE-022/ZipSlip.ql +ql/javascript/ql/src/Security/CWE-073/TemplateObjectInjection.ql +ql/javascript/ql/src/Security/CWE-078/CommandInjection.ql +ql/javascript/ql/src/Security/CWE-078/IndirectCommandInjection.ql +ql/javascript/ql/src/Security/CWE-078/SecondOrderCommandInjection.ql +ql/javascript/ql/src/Security/CWE-078/ShellCommandInjectionFromEnvironment.ql +ql/javascript/ql/src/Security/CWE-078/UnsafeShellCommandConstruction.ql +ql/javascript/ql/src/Security/CWE-078/UselessUseOfCat.ql +ql/javascript/ql/src/Security/CWE-079/ExceptionXss.ql +ql/javascript/ql/src/Security/CWE-079/ReflectedXss.ql +ql/javascript/ql/src/Security/CWE-079/StoredXss.ql +ql/javascript/ql/src/Security/CWE-079/UnsafeHtmlConstruction.ql +ql/javascript/ql/src/Security/CWE-079/UnsafeJQueryPlugin.ql +ql/javascript/ql/src/Security/CWE-079/Xss.ql +ql/javascript/ql/src/Security/CWE-079/XssThroughDom.ql +ql/javascript/ql/src/Security/CWE-089/SqlInjection.ql +ql/javascript/ql/src/Security/CWE-094/CodeInjection.ql +ql/javascript/ql/src/Security/CWE-094/ExpressionInjection.ql +ql/javascript/ql/src/Security/CWE-094/ImproperCodeSanitization.ql +ql/javascript/ql/src/Security/CWE-094/UnsafeCodeConstruction.ql +ql/javascript/ql/src/Security/CWE-094/UnsafeDynamicMethodAccess.ql +ql/javascript/ql/src/Security/CWE-1004/ClientExposedCookie.ql +ql/javascript/ql/src/Security/CWE-116/BadTagFilter.ql +ql/javascript/ql/src/Security/CWE-116/DoubleEscaping.ql +ql/javascript/ql/src/Security/CWE-116/IncompleteHtmlAttributeSanitization.ql +ql/javascript/ql/src/Security/CWE-116/IncompleteMultiCharacterSanitization.ql +ql/javascript/ql/src/Security/CWE-116/IncompleteSanitization.ql +ql/javascript/ql/src/Security/CWE-116/UnsafeHtmlExpansion.ql +ql/javascript/ql/src/Security/CWE-117/LogInjection.ql +ql/javascript/ql/src/Security/CWE-1275/SameSiteNoneCookie.ql +ql/javascript/ql/src/Security/CWE-134/TaintedFormatString.ql +ql/javascript/ql/src/Security/CWE-178/CaseSensitiveMiddlewarePath.ql +ql/javascript/ql/src/Security/CWE-200/FileAccessToHttp.ql +ql/javascript/ql/src/Security/CWE-200/PrivateFileExposure.ql +ql/javascript/ql/src/Security/CWE-201/PostMessageStar.ql +ql/javascript/ql/src/Security/CWE-209/StackTraceExposure.ql +ql/javascript/ql/src/Security/CWE-295/DisablingCertificateValidation.ql +ql/javascript/ql/src/Security/CWE-300/InsecureDependencyResolution.ql +ql/javascript/ql/src/Security/CWE-312/ActionsArtifactLeak.ql +ql/javascript/ql/src/Security/CWE-312/BuildArtifactLeak.ql +ql/javascript/ql/src/Security/CWE-312/CleartextLogging.ql +ql/javascript/ql/src/Security/CWE-312/CleartextStorage.ql +ql/javascript/ql/src/Security/CWE-313/PasswordInConfigurationFile.ql +ql/javascript/ql/src/Security/CWE-326/InsufficientKeySize.ql +ql/javascript/ql/src/Security/CWE-327/BadRandomness.ql +ql/javascript/ql/src/Security/CWE-327/BrokenCryptoAlgorithm.ql +ql/javascript/ql/src/Security/CWE-338/InsecureRandomness.ql +ql/javascript/ql/src/Security/CWE-346/CorsMisconfigurationForCredentials.ql +ql/javascript/ql/src/Security/CWE-347/MissingJWTKeyVerification.ql +ql/javascript/ql/src/Security/CWE-352/MissingCsrfMiddleware.ql +ql/javascript/ql/src/Security/CWE-367/FileSystemRace.ql +ql/javascript/ql/src/Security/CWE-377/InsecureTemporaryFile.ql +ql/javascript/ql/src/Security/CWE-384/SessionFixation.ql +ql/javascript/ql/src/Security/CWE-400/DeepObjectResourceExhaustion.ql +ql/javascript/ql/src/Security/CWE-400/RemotePropertyInjection.ql +ql/javascript/ql/src/Security/CWE-502/UnsafeDeserialization.ql +ql/javascript/ql/src/Security/CWE-506/HardcodedDataInterpretedAsCode.ql +ql/javascript/ql/src/Security/CWE-598/SensitiveGetQuery.ql +ql/javascript/ql/src/Security/CWE-601/ClientSideUrlRedirect.ql +ql/javascript/ql/src/Security/CWE-601/ServerSideUrlRedirect.ql +ql/javascript/ql/src/Security/CWE-611/Xxe.ql +ql/javascript/ql/src/Security/CWE-614/ClearTextCookie.ql +ql/javascript/ql/src/Security/CWE-640/HostHeaderPoisoningInEmailGeneration.ql +ql/javascript/ql/src/Security/CWE-643/XpathInjection.ql +ql/javascript/ql/src/Security/CWE-693/InsecureHelmet.ql +ql/javascript/ql/src/Security/CWE-730/RegExpInjection.ql +ql/javascript/ql/src/Security/CWE-730/ServerCrash.ql +ql/javascript/ql/src/Security/CWE-754/UnvalidatedDynamicMethodCall.ql +ql/javascript/ql/src/Security/CWE-770/MissingRateLimiting.ql +ql/javascript/ql/src/Security/CWE-770/ResourceExhaustion.ql +ql/javascript/ql/src/Security/CWE-776/XmlBomb.ql +ql/javascript/ql/src/Security/CWE-798/HardcodedCredentials.ql +ql/javascript/ql/src/Security/CWE-807/ConditionalBypass.ql +ql/javascript/ql/src/Security/CWE-829/InsecureDownload.ql +ql/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedDomain.ql +ql/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedSource.ql +ql/javascript/ql/src/Security/CWE-834/LoopBoundInjection.ql +ql/javascript/ql/src/Security/CWE-843/TypeConfusionThroughParameterTampering.ql +ql/javascript/ql/src/Security/CWE-862/EmptyPasswordInConfigurationFile.ql +ql/javascript/ql/src/Security/CWE-912/HttpToFileAccess.ql +ql/javascript/ql/src/Security/CWE-915/PrototypePollutingAssignment.ql +ql/javascript/ql/src/Security/CWE-915/PrototypePollutingFunction.ql +ql/javascript/ql/src/Security/CWE-915/PrototypePollutingMergeCall.ql +ql/javascript/ql/src/Security/CWE-916/InsufficientPasswordHash.ql +ql/javascript/ql/src/Security/CWE-918/ClientSideRequestForgery.ql +ql/javascript/ql/src/Security/CWE-918/RequestForgery.ql +ql/javascript/ql/src/Summary/LinesOfCode.ql +ql/javascript/ql/src/Summary/LinesOfUserCode.ql diff --git a/javascript/ql/integration-tests/query-suite/not_included_in_qls.expected b/javascript/ql/integration-tests/query-suite/not_included_in_qls.expected new file mode 100644 index 000000000000..a6c808c6cbfb --- /dev/null +++ b/javascript/ql/integration-tests/query-suite/not_included_in_qls.expected @@ -0,0 +1,148 @@ +ql/javascript/ql/src/AlertSuppression.ql +ql/javascript/ql/src/AngularJS/DeadAngularJSEventListener.ql +ql/javascript/ql/src/AngularJS/UnusedAngularDependency.ql +ql/javascript/ql/src/Comments/CommentedOutCode.ql +ql/javascript/ql/src/Comments/FCommentedOutCode.ql +ql/javascript/ql/src/Comments/TodoComments.ql +ql/javascript/ql/src/DOM/Alert.ql +ql/javascript/ql/src/DOM/AmbiguousIdAttribute.ql +ql/javascript/ql/src/DOM/ConflictingAttributes.ql +ql/javascript/ql/src/DOM/TargetBlank.ql +ql/javascript/ql/src/Declarations/DeadStoreOfGlobal.ql +ql/javascript/ql/src/Declarations/RedeclaredVariable.ql +ql/javascript/ql/src/Declarations/TooManyParameters.ql +ql/javascript/ql/src/Declarations/UnstableCyclicImport.ql +ql/javascript/ql/src/Declarations/UnusedParameter.ql +ql/javascript/ql/src/Declarations/UnusedProperty.ql +ql/javascript/ql/src/Electron/EnablingNodeIntegration.ql +ql/javascript/ql/src/Expressions/BitwiseSignCheck.ql +ql/javascript/ql/src/Expressions/CompareIdenticalValues.ql +ql/javascript/ql/src/Expressions/MisspelledIdentifier.ql +ql/javascript/ql/src/JSDoc/BadParamTag.ql +ql/javascript/ql/src/JSDoc/JSDocForNonExistentParameter.ql +ql/javascript/ql/src/JSDoc/UndocumentedParameter.ql +ql/javascript/ql/src/LanguageFeatures/ArgumentsCallerCallee.ql +ql/javascript/ql/src/LanguageFeatures/DebuggerStatement.ql +ql/javascript/ql/src/LanguageFeatures/EmptyArrayInit.ql +ql/javascript/ql/src/LanguageFeatures/Eval.ql +ql/javascript/ql/src/LanguageFeatures/JumpFromFinally.ql +ql/javascript/ql/src/LanguageFeatures/SetterIgnoresParameter.ql +ql/javascript/ql/src/LanguageFeatures/WrongExtensionJSON.ql +ql/javascript/ql/src/Metrics/Dependencies/ExternalDependencies.ql +ql/javascript/ql/src/Metrics/Dependencies/ExternalDependenciesSourceLinks.ql +ql/javascript/ql/src/Metrics/FCommentRatio.ql +ql/javascript/ql/src/Metrics/FCyclomaticComplexity.ql +ql/javascript/ql/src/Metrics/FFunctions.ql +ql/javascript/ql/src/Metrics/FLines.ql +ql/javascript/ql/src/Metrics/FLinesOfCode.ql +ql/javascript/ql/src/Metrics/FLinesOfComment.ql +ql/javascript/ql/src/Metrics/FLinesOfDuplicatedCode.ql +ql/javascript/ql/src/Metrics/FLinesOfSimilarCode.ql +ql/javascript/ql/src/Metrics/FNumberOfStatements.ql +ql/javascript/ql/src/Metrics/FNumberOfTests.ql +ql/javascript/ql/src/Metrics/FUseOfES6.ql +ql/javascript/ql/src/Metrics/FunCyclomaticComplexity.ql +ql/javascript/ql/src/Metrics/FunLinesOfCode.ql +ql/javascript/ql/src/NodeJS/CyclicImport.ql +ql/javascript/ql/src/NodeJS/DubiousImport.ql +ql/javascript/ql/src/NodeJS/UnresolvableImport.ql +ql/javascript/ql/src/NodeJS/UnusedDependency.ql +ql/javascript/ql/src/Performance/NonLocalForIn.ql +ql/javascript/ql/src/Performance/ReassignParameterAndUseArguments.ql +ql/javascript/ql/src/RegExp/BackspaceEscape.ql +ql/javascript/ql/src/RegExp/MalformedRegExp.ql +ql/javascript/ql/src/Security/CWE-020/ExternalAPIsUsedWithUntrustedData.ql +ql/javascript/ql/src/Security/CWE-020/UntrustedDataToExternalAPI.ql +ql/javascript/ql/src/Security/CWE-451/MissingXFrameOptions.ql +ql/javascript/ql/src/Security/CWE-807/DifferentKindsComparisonBypass.ql +ql/javascript/ql/src/Security/trest/test.ql +ql/javascript/ql/src/Statements/EphemeralLoop.ql +ql/javascript/ql/src/Statements/ImplicitReturn.ql +ql/javascript/ql/src/Statements/InconsistentReturn.ql +ql/javascript/ql/src/Statements/NestedLoopsSameVariable.ql +ql/javascript/ql/src/Statements/ReturnOutsideFunction.ql +ql/javascript/ql/src/Summary/TaintSinks.ql +ql/javascript/ql/src/Summary/TaintSources.ql +ql/javascript/ql/src/definitions.ql +ql/javascript/ql/src/experimental/Security/CWE-094-dataURL/CodeInjection.ql +ql/javascript/ql/src/experimental/Security/CWE-094/UntrustedCheckout.ql +ql/javascript/ql/src/experimental/Security/CWE-099/EnvValueAndKeyInjection.ql +ql/javascript/ql/src/experimental/Security/CWE-099/EnvValueInjection.ql +ql/javascript/ql/src/experimental/Security/CWE-340/TokenBuiltFromUUID.ql +ql/javascript/ql/src/experimental/Security/CWE-347/decodeJwtWithoutVerification.ql +ql/javascript/ql/src/experimental/Security/CWE-347/decodeJwtWithoutVerificationLocalSource.ql +ql/javascript/ql/src/experimental/Security/CWE-444/InsecureHttpParser.ql +ql/javascript/ql/src/experimental/Security/CWE-522-DecompressionBombs/DecompressionBombs.ql +ql/javascript/ql/src/experimental/Security/CWE-918/SSRF.ql +ql/javascript/ql/src/experimental/Security/CWE-942/CorsPermissiveConfiguration.ql +ql/javascript/ql/src/experimental/StandardLibrary/MultipleArgumentsToSetConstructor.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-020/UntrustedDataToExternalAPI.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-078/CommandInjection.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-079/Xss.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-089/SqlInjection.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-094/CodeInjection.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-117/LogInjection.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-134/TaintedFormatString.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-346/CorsMisconfigurationForCredentials.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-400/RemotePropertyInjection.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-502/UnsafeDeserialization.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-611/Xxe.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-643/XpathInjection.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-730/RegExpInjection.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-770/ResourceExhaustion.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-776/XmlBomb.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-807/ConditionalBypass.ql +ql/javascript/ql/src/experimental/heuristics/ql/src/Security/CWE-915/PrototypePollutingAssignment.ql +ql/javascript/ql/src/external/DuplicateFunction.ql +ql/javascript/ql/src/external/DuplicateToplevel.ql +ql/javascript/ql/src/external/SimilarFunction.ql +ql/javascript/ql/src/external/SimilarToplevel.ql +ql/javascript/ql/src/filters/ClassifyFiles.ql +ql/javascript/ql/src/meta/ApiGraphs/ApiGraphEdges.ql +ql/javascript/ql/src/meta/ApiGraphs/ApiGraphNodes.ql +ql/javascript/ql/src/meta/ApiGraphs/ApiGraphPointsToEdges.ql +ql/javascript/ql/src/meta/ApiGraphs/ApiGraphRhsNodes.ql +ql/javascript/ql/src/meta/ApiGraphs/ApiGraphUseNodes.ql +ql/javascript/ql/src/meta/Consistency.ql +ql/javascript/ql/src/meta/SSA/DeadDef.ql +ql/javascript/ql/src/meta/SSA/Dominance.ql +ql/javascript/ql/src/meta/SSA/MultipleDefs.ql +ql/javascript/ql/src/meta/SSA/MultipleRefinementInputs.ql +ql/javascript/ql/src/meta/SSA/NoDefs.ql +ql/javascript/ql/src/meta/SSA/NoPhiInputs.ql +ql/javascript/ql/src/meta/SSA/NoRefinementInputs.ql +ql/javascript/ql/src/meta/SSA/SinglePhiInput.ql +ql/javascript/ql/src/meta/alerts/CallGraph.ql +ql/javascript/ql/src/meta/alerts/ImportGraph.ql +ql/javascript/ql/src/meta/alerts/LibraryInputs.ql +ql/javascript/ql/src/meta/alerts/TaintSinks.ql +ql/javascript/ql/src/meta/alerts/TaintSources.ql +ql/javascript/ql/src/meta/alerts/TaintedNodes.ql +ql/javascript/ql/src/meta/alerts/ThreatModelSources.ql +ql/javascript/ql/src/meta/analysis-quality/CalledFunctionCandidates.ql +ql/javascript/ql/src/meta/analysis-quality/CalledFunctionRatio.ql +ql/javascript/ql/src/meta/analysis-quality/CalledFunctions.ql +ql/javascript/ql/src/meta/analysis-quality/DomValueRefs.ql +ql/javascript/ql/src/meta/analysis-quality/NumModules.ql +ql/javascript/ql/src/meta/analysis-quality/ResolvableCallCandidates.ql +ql/javascript/ql/src/meta/analysis-quality/ResolvableCallRatio.ql +ql/javascript/ql/src/meta/analysis-quality/ResolvableCalls.ql +ql/javascript/ql/src/meta/analysis-quality/ResolvableImports.ql +ql/javascript/ql/src/meta/analysis-quality/RouteHandlers.ql +ql/javascript/ql/src/meta/analysis-quality/SanitizersReachableFromSource.ql +ql/javascript/ql/src/meta/analysis-quality/SinksReachableFromSanitizer.ql +ql/javascript/ql/src/meta/analysis-quality/TaintSinks.ql +ql/javascript/ql/src/meta/analysis-quality/TaintSources.ql +ql/javascript/ql/src/meta/analysis-quality/TaintSteps.ql +ql/javascript/ql/src/meta/analysis-quality/TaintedNodes.ql +ql/javascript/ql/src/meta/analysis-quality/UncalledFunctions.ql +ql/javascript/ql/src/meta/analysis-quality/UnmodelledSteps.ql +ql/javascript/ql/src/meta/analysis-quality/UnpromotedRouteHandlerCandidate.ql +ql/javascript/ql/src/meta/analysis-quality/UnpromotedRouteSetupCandidate.ql +ql/javascript/ql/src/meta/analysis-quality/UnresolvableCalls.ql +ql/javascript/ql/src/meta/analysis-quality/UnresolvableImports.ql +ql/javascript/ql/src/meta/extraction-metrics/FileData.ql +ql/javascript/ql/src/meta/extraction-metrics/MissingMetrics.ql +ql/javascript/ql/src/meta/extraction-metrics/PhaseTimings.ql +ql/javascript/ql/src/meta/types/TypedExprs.ql +ql/javascript/ql/src/meta/types/TypesWithQualifiedName.ql diff --git a/javascript/ql/integration-tests/query-suite/test.py b/javascript/ql/integration-tests/query-suite/test.py new file mode 100644 index 000000000000..54b6f94043f5 --- /dev/null +++ b/javascript/ql/integration-tests/query-suite/test.py @@ -0,0 +1,14 @@ +import runs_on +import pytest +from query_suites import * + +well_known_query_suites = ['javascript-code-quality.qls', 'javascript-security-and-quality.qls', 'javascript-security-extended.qls', 'javascript-code-scanning.qls'] + +@runs_on.posix +@pytest.mark.parametrize("query_suite", well_known_query_suites) +def test(codeql, javascript, check_query_suite, query_suite): + check_query_suite(query_suite) + +@runs_on.posix +def test_not_included_queries(codeql, javascript, check_queries_not_included): + check_queries_not_included('javascript', well_known_query_suites) diff --git a/ruby/ql/integration-tests/query-suite/not_included_in_qls.expected b/ruby/ql/integration-tests/query-suite/not_included_in_qls.expected new file mode 100644 index 000000000000..ea96d413106e --- /dev/null +++ b/ruby/ql/integration-tests/query-suite/not_included_in_qls.expected @@ -0,0 +1,36 @@ +ql/ruby/ql/src/AlertSuppression.ql +ql/ruby/ql/src/experimental/CWE-522-DecompressionBombs/DecompressionBombs.ql +ql/ruby/ql/src/experimental/cwe-022-zipslip/ZipSlip.ql +ql/ruby/ql/src/experimental/cwe-176/UnicodeBypassValidation.ql +ql/ruby/ql/src/experimental/cwe-208/UnsafeHmacComparison.ql +ql/ruby/ql/src/experimental/cwe-347/EmptyJWTSecret.ql +ql/ruby/ql/src/experimental/cwe-347/MissingJWTVerification.ql +ql/ruby/ql/src/experimental/cwe-502/UnsafeYamlDeserialization.ql +ql/ruby/ql/src/experimental/cwe-807/ConditionalBypass.ql +ql/ruby/ql/src/experimental/decompression-api/DecompressionApi.ql +ql/ruby/ql/src/experimental/improper-memoization/ImproperMemoization.ql +ql/ruby/ql/src/experimental/insecure-randomness/InsecureRandomness.ql +ql/ruby/ql/src/experimental/ldap-improper-auth/ImproperLdapAuth.ql +ql/ruby/ql/src/experimental/ldap-injection/LdapInjection.ql +ql/ruby/ql/src/experimental/manually-check-http-verb/ManuallyCheckHttpVerb.ql +ql/ruby/ql/src/experimental/performance/UseDetect.ql +ql/ruby/ql/src/experimental/template-injection/TemplateInjection.ql +ql/ruby/ql/src/experimental/weak-params/WeakParams.ql +ql/ruby/ql/src/experimental/xpath-injection/XpathInjection.ql +ql/ruby/ql/src/filters/ClassifyFiles.ql +ql/ruby/ql/src/queries/analysis/Definitions.ql +ql/ruby/ql/src/queries/diagnostics/PerformanceDiagnostics.ql +ql/ruby/ql/src/queries/meta/CallGraph.ql +ql/ruby/ql/src/queries/meta/SummarizedCallableCallSites.ql +ql/ruby/ql/src/queries/meta/TaintSinks.ql +ql/ruby/ql/src/queries/meta/TaintSources.ql +ql/ruby/ql/src/queries/meta/TaintedNodes.ql +ql/ruby/ql/src/queries/metrics/FLines.ql +ql/ruby/ql/src/queries/metrics/FLinesOfCode.ql +ql/ruby/ql/src/queries/metrics/FLinesOfComments.ql +ql/ruby/ql/src/queries/modeling/GenerateModel.ql +ql/ruby/ql/src/queries/security/cwe-732/WeakFilePermissions.ql +ql/ruby/ql/src/queries/variables/UnusedParameter.ql +ql/ruby/ql/src/utils/modeleditor/ApplicationModeEndpoints.ql +ql/ruby/ql/src/utils/modeleditor/FrameworkModeAccessPaths.ql +ql/ruby/ql/src/utils/modeleditor/FrameworkModeEndpoints.ql diff --git a/ruby/ql/integration-tests/query-suite/ruby-code-quality.qls.expected b/ruby/ql/integration-tests/query-suite/ruby-code-quality.qls.expected new file mode 100644 index 000000000000..94b2f19caaa8 --- /dev/null +++ b/ruby/ql/integration-tests/query-suite/ruby-code-quality.qls.expected @@ -0,0 +1,3 @@ +ql/ruby/ql/src/queries/performance/DatabaseQueryInLoop.ql +ql/ruby/ql/src/queries/variables/DeadStoreOfLocal.ql +ql/ruby/ql/src/queries/variables/UninitializedLocal.ql diff --git a/ruby/ql/integration-tests/query-suite/ruby-code-scanning.qls.expected b/ruby/ql/integration-tests/query-suite/ruby-code-scanning.qls.expected new file mode 100644 index 000000000000..b20eee65577b --- /dev/null +++ b/ruby/ql/integration-tests/query-suite/ruby-code-scanning.qls.expected @@ -0,0 +1,44 @@ +ql/ruby/ql/src/queries/diagnostics/ExtractedFiles.ql +ql/ruby/ql/src/queries/diagnostics/ExtractionErrors.ql +ql/ruby/ql/src/queries/diagnostics/ExtractionWarnings.ql +ql/ruby/ql/src/queries/security/cwe-020/IncompleteHostnameRegExp.ql +ql/ruby/ql/src/queries/security/cwe-020/IncompleteUrlSubstringSanitization.ql +ql/ruby/ql/src/queries/security/cwe-020/MissingFullAnchor.ql +ql/ruby/ql/src/queries/security/cwe-020/OverlyLargeRange.ql +ql/ruby/ql/src/queries/security/cwe-022/PathInjection.ql +ql/ruby/ql/src/queries/security/cwe-078/CommandInjection.ql +ql/ruby/ql/src/queries/security/cwe-078/KernelOpen.ql +ql/ruby/ql/src/queries/security/cwe-078/NonConstantKernelOpen.ql +ql/ruby/ql/src/queries/security/cwe-078/UnsafeShellCommandConstruction.ql +ql/ruby/ql/src/queries/security/cwe-079/ReflectedXSS.ql +ql/ruby/ql/src/queries/security/cwe-079/StoredXSS.ql +ql/ruby/ql/src/queries/security/cwe-079/UnsafeHtmlConstruction.ql +ql/ruby/ql/src/queries/security/cwe-089/SqlInjection.ql +ql/ruby/ql/src/queries/security/cwe-094/CodeInjection.ql +ql/ruby/ql/src/queries/security/cwe-116/BadTagFilter.ql +ql/ruby/ql/src/queries/security/cwe-116/IncompleteMultiCharacterSanitization.ql +ql/ruby/ql/src/queries/security/cwe-116/IncompleteSanitization.ql +ql/ruby/ql/src/queries/security/cwe-1333/PolynomialReDoS.ql +ql/ruby/ql/src/queries/security/cwe-1333/ReDoS.ql +ql/ruby/ql/src/queries/security/cwe-1333/RegExpInjection.ql +ql/ruby/ql/src/queries/security/cwe-134/TaintedFormatString.ql +ql/ruby/ql/src/queries/security/cwe-209/StackTraceExposure.ql +ql/ruby/ql/src/queries/security/cwe-300/InsecureDependencyResolution.ql +ql/ruby/ql/src/queries/security/cwe-312/CleartextLogging.ql +ql/ruby/ql/src/queries/security/cwe-312/CleartextStorage.ql +ql/ruby/ql/src/queries/security/cwe-327/BrokenCryptoAlgorithm.ql +ql/ruby/ql/src/queries/security/cwe-327/WeakSensitiveDataHashing.ql +ql/ruby/ql/src/queries/security/cwe-352/CSRFProtectionDisabled.ql +ql/ruby/ql/src/queries/security/cwe-352/CSRFProtectionNotEnabled.ql +ql/ruby/ql/src/queries/security/cwe-502/UnsafeDeserialization.ql +ql/ruby/ql/src/queries/security/cwe-598/SensitiveGetQuery.ql +ql/ruby/ql/src/queries/security/cwe-601/UrlRedirect.ql +ql/ruby/ql/src/queries/security/cwe-611/Xxe.ql +ql/ruby/ql/src/queries/security/cwe-732/WeakCookieConfiguration.ql +ql/ruby/ql/src/queries/security/cwe-829/InsecureDownload.ql +ql/ruby/ql/src/queries/security/cwe-915/MassAssignment.ql +ql/ruby/ql/src/queries/security/cwe-918/ServerSideRequestForgery.ql +ql/ruby/ql/src/queries/summary/LinesOfCode.ql +ql/ruby/ql/src/queries/summary/LinesOfUserCode.ql +ql/ruby/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql +ql/ruby/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql diff --git a/ruby/ql/integration-tests/query-suite/ruby-security-and-quality.qls.expected b/ruby/ql/integration-tests/query-suite/ruby-security-and-quality.qls.expected new file mode 100644 index 000000000000..604a4c223fbd --- /dev/null +++ b/ruby/ql/integration-tests/query-suite/ruby-security-and-quality.qls.expected @@ -0,0 +1,54 @@ +ql/ruby/ql/src/queries/diagnostics/ExtractedFiles.ql +ql/ruby/ql/src/queries/diagnostics/ExtractionErrors.ql +ql/ruby/ql/src/queries/diagnostics/ExtractionWarnings.ql +ql/ruby/ql/src/queries/performance/DatabaseQueryInLoop.ql +ql/ruby/ql/src/queries/security/cwe-020/IncompleteHostnameRegExp.ql +ql/ruby/ql/src/queries/security/cwe-020/IncompleteUrlSubstringSanitization.ql +ql/ruby/ql/src/queries/security/cwe-020/MissingFullAnchor.ql +ql/ruby/ql/src/queries/security/cwe-020/MissingRegExpAnchor.ql +ql/ruby/ql/src/queries/security/cwe-020/OverlyLargeRange.ql +ql/ruby/ql/src/queries/security/cwe-022/PathInjection.ql +ql/ruby/ql/src/queries/security/cwe-078/CommandInjection.ql +ql/ruby/ql/src/queries/security/cwe-078/KernelOpen.ql +ql/ruby/ql/src/queries/security/cwe-078/NonConstantKernelOpen.ql +ql/ruby/ql/src/queries/security/cwe-078/UnsafeShellCommandConstruction.ql +ql/ruby/ql/src/queries/security/cwe-079/ReflectedXSS.ql +ql/ruby/ql/src/queries/security/cwe-079/StoredXSS.ql +ql/ruby/ql/src/queries/security/cwe-079/UnsafeHtmlConstruction.ql +ql/ruby/ql/src/queries/security/cwe-089/SqlInjection.ql +ql/ruby/ql/src/queries/security/cwe-094/CodeInjection.ql +ql/ruby/ql/src/queries/security/cwe-094/UnsafeCodeConstruction.ql +ql/ruby/ql/src/queries/security/cwe-116/BadTagFilter.ql +ql/ruby/ql/src/queries/security/cwe-116/IncompleteMultiCharacterSanitization.ql +ql/ruby/ql/src/queries/security/cwe-116/IncompleteSanitization.ql +ql/ruby/ql/src/queries/security/cwe-117/LogInjection.ql +ql/ruby/ql/src/queries/security/cwe-1333/PolynomialReDoS.ql +ql/ruby/ql/src/queries/security/cwe-1333/ReDoS.ql +ql/ruby/ql/src/queries/security/cwe-1333/RegExpInjection.ql +ql/ruby/ql/src/queries/security/cwe-134/TaintedFormatString.ql +ql/ruby/ql/src/queries/security/cwe-209/StackTraceExposure.ql +ql/ruby/ql/src/queries/security/cwe-295/RequestWithoutValidation.ql +ql/ruby/ql/src/queries/security/cwe-300/InsecureDependencyResolution.ql +ql/ruby/ql/src/queries/security/cwe-312/CleartextLogging.ql +ql/ruby/ql/src/queries/security/cwe-312/CleartextStorage.ql +ql/ruby/ql/src/queries/security/cwe-327/BrokenCryptoAlgorithm.ql +ql/ruby/ql/src/queries/security/cwe-327/WeakSensitiveDataHashing.ql +ql/ruby/ql/src/queries/security/cwe-352/CSRFProtectionDisabled.ql +ql/ruby/ql/src/queries/security/cwe-352/CSRFProtectionNotEnabled.ql +ql/ruby/ql/src/queries/security/cwe-502/UnsafeDeserialization.ql +ql/ruby/ql/src/queries/security/cwe-506/HardcodedDataInterpretedAsCode.ql +ql/ruby/ql/src/queries/security/cwe-598/SensitiveGetQuery.ql +ql/ruby/ql/src/queries/security/cwe-601/UrlRedirect.ql +ql/ruby/ql/src/queries/security/cwe-611/Xxe.ql +ql/ruby/ql/src/queries/security/cwe-732/WeakCookieConfiguration.ql +ql/ruby/ql/src/queries/security/cwe-798/HardcodedCredentials.ql +ql/ruby/ql/src/queries/security/cwe-829/InsecureDownload.ql +ql/ruby/ql/src/queries/security/cwe-912/HttpToFileAccess.ql +ql/ruby/ql/src/queries/security/cwe-915/MassAssignment.ql +ql/ruby/ql/src/queries/security/cwe-918/ServerSideRequestForgery.ql +ql/ruby/ql/src/queries/summary/LinesOfCode.ql +ql/ruby/ql/src/queries/summary/LinesOfUserCode.ql +ql/ruby/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql +ql/ruby/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql +ql/ruby/ql/src/queries/variables/DeadStoreOfLocal.ql +ql/ruby/ql/src/queries/variables/UninitializedLocal.ql diff --git a/ruby/ql/integration-tests/query-suite/ruby-security-extended.qls.expected b/ruby/ql/integration-tests/query-suite/ruby-security-extended.qls.expected new file mode 100644 index 000000000000..706b9a9a363a --- /dev/null +++ b/ruby/ql/integration-tests/query-suite/ruby-security-extended.qls.expected @@ -0,0 +1,51 @@ +ql/ruby/ql/src/queries/diagnostics/ExtractedFiles.ql +ql/ruby/ql/src/queries/diagnostics/ExtractionErrors.ql +ql/ruby/ql/src/queries/diagnostics/ExtractionWarnings.ql +ql/ruby/ql/src/queries/security/cwe-020/IncompleteHostnameRegExp.ql +ql/ruby/ql/src/queries/security/cwe-020/IncompleteUrlSubstringSanitization.ql +ql/ruby/ql/src/queries/security/cwe-020/MissingFullAnchor.ql +ql/ruby/ql/src/queries/security/cwe-020/MissingRegExpAnchor.ql +ql/ruby/ql/src/queries/security/cwe-020/OverlyLargeRange.ql +ql/ruby/ql/src/queries/security/cwe-022/PathInjection.ql +ql/ruby/ql/src/queries/security/cwe-078/CommandInjection.ql +ql/ruby/ql/src/queries/security/cwe-078/KernelOpen.ql +ql/ruby/ql/src/queries/security/cwe-078/NonConstantKernelOpen.ql +ql/ruby/ql/src/queries/security/cwe-078/UnsafeShellCommandConstruction.ql +ql/ruby/ql/src/queries/security/cwe-079/ReflectedXSS.ql +ql/ruby/ql/src/queries/security/cwe-079/StoredXSS.ql +ql/ruby/ql/src/queries/security/cwe-079/UnsafeHtmlConstruction.ql +ql/ruby/ql/src/queries/security/cwe-089/SqlInjection.ql +ql/ruby/ql/src/queries/security/cwe-094/CodeInjection.ql +ql/ruby/ql/src/queries/security/cwe-094/UnsafeCodeConstruction.ql +ql/ruby/ql/src/queries/security/cwe-116/BadTagFilter.ql +ql/ruby/ql/src/queries/security/cwe-116/IncompleteMultiCharacterSanitization.ql +ql/ruby/ql/src/queries/security/cwe-116/IncompleteSanitization.ql +ql/ruby/ql/src/queries/security/cwe-117/LogInjection.ql +ql/ruby/ql/src/queries/security/cwe-1333/PolynomialReDoS.ql +ql/ruby/ql/src/queries/security/cwe-1333/ReDoS.ql +ql/ruby/ql/src/queries/security/cwe-1333/RegExpInjection.ql +ql/ruby/ql/src/queries/security/cwe-134/TaintedFormatString.ql +ql/ruby/ql/src/queries/security/cwe-209/StackTraceExposure.ql +ql/ruby/ql/src/queries/security/cwe-295/RequestWithoutValidation.ql +ql/ruby/ql/src/queries/security/cwe-300/InsecureDependencyResolution.ql +ql/ruby/ql/src/queries/security/cwe-312/CleartextLogging.ql +ql/ruby/ql/src/queries/security/cwe-312/CleartextStorage.ql +ql/ruby/ql/src/queries/security/cwe-327/BrokenCryptoAlgorithm.ql +ql/ruby/ql/src/queries/security/cwe-327/WeakSensitiveDataHashing.ql +ql/ruby/ql/src/queries/security/cwe-352/CSRFProtectionDisabled.ql +ql/ruby/ql/src/queries/security/cwe-352/CSRFProtectionNotEnabled.ql +ql/ruby/ql/src/queries/security/cwe-502/UnsafeDeserialization.ql +ql/ruby/ql/src/queries/security/cwe-506/HardcodedDataInterpretedAsCode.ql +ql/ruby/ql/src/queries/security/cwe-598/SensitiveGetQuery.ql +ql/ruby/ql/src/queries/security/cwe-601/UrlRedirect.ql +ql/ruby/ql/src/queries/security/cwe-611/Xxe.ql +ql/ruby/ql/src/queries/security/cwe-732/WeakCookieConfiguration.ql +ql/ruby/ql/src/queries/security/cwe-798/HardcodedCredentials.ql +ql/ruby/ql/src/queries/security/cwe-829/InsecureDownload.ql +ql/ruby/ql/src/queries/security/cwe-912/HttpToFileAccess.ql +ql/ruby/ql/src/queries/security/cwe-915/MassAssignment.ql +ql/ruby/ql/src/queries/security/cwe-918/ServerSideRequestForgery.ql +ql/ruby/ql/src/queries/summary/LinesOfCode.ql +ql/ruby/ql/src/queries/summary/LinesOfUserCode.ql +ql/ruby/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql +ql/ruby/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql diff --git a/ruby/ql/integration-tests/query-suite/test.py b/ruby/ql/integration-tests/query-suite/test.py new file mode 100644 index 000000000000..7ebb9d9c9b5b --- /dev/null +++ b/ruby/ql/integration-tests/query-suite/test.py @@ -0,0 +1,14 @@ +import runs_on +import pytest +from query_suites import * + +well_known_query_suites = ['ruby-code-quality.qls', 'ruby-security-and-quality.qls', 'ruby-security-extended.qls', 'ruby-code-scanning.qls'] + +@runs_on.posix +@pytest.mark.parametrize("query_suite", well_known_query_suites) +def test(codeql, ruby, check_query_suite, query_suite): + check_query_suite(query_suite) + +@runs_on.posix +def test_not_included_queries(codeql, ruby, check_queries_not_included): + check_queries_not_included('ruby', well_known_query_suites) diff --git a/rust/ql/integration-tests/query-suite/not_included_in_qls.expected b/rust/ql/integration-tests/query-suite/not_included_in_qls.expected new file mode 100644 index 000000000000..a2ce74fe4df8 --- /dev/null +++ b/rust/ql/integration-tests/query-suite/not_included_in_qls.expected @@ -0,0 +1,16 @@ +ql/rust/ql/src/queries/summary/CryptographicOperations.ql +ql/rust/ql/src/queries/summary/LinesOfUserCodeInFiles.ql +ql/rust/ql/src/queries/summary/QuerySinks.ql +ql/rust/ql/src/queries/summary/SensitiveData.ql +ql/rust/ql/src/queries/summary/TaintSources.ql +ql/rust/ql/src/queries/unusedentities/UnreachableCode.ql +ql/rust/ql/src/queries/unusedentities/UnusedValue.ql +ql/rust/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql +ql/rust/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql +ql/rust/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql +ql/rust/ql/src/utils/modelgenerator/CaptureNeutralModels.ql +ql/rust/ql/src/utils/modelgenerator/CaptureSinkModels.ql +ql/rust/ql/src/utils/modelgenerator/CaptureSourceModels.ql +ql/rust/ql/src/utils/modelgenerator/CaptureSummaryModels.ql +ql/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql +ql/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql diff --git a/rust/ql/integration-tests/query-suite/rust-code-quality.qls.expected b/rust/ql/integration-tests/query-suite/rust-code-quality.qls.expected new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/rust/ql/integration-tests/query-suite/rust-code-quality.qls.expected @@ -0,0 +1 @@ + diff --git a/rust/ql/integration-tests/query-suite/rust-code-scanning.qls.expected b/rust/ql/integration-tests/query-suite/rust-code-scanning.qls.expected new file mode 100644 index 000000000000..0e619031ed59 --- /dev/null +++ b/rust/ql/integration-tests/query-suite/rust-code-scanning.qls.expected @@ -0,0 +1,26 @@ +ql/rust/ql/src/queries/diagnostics/AstConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/CfgConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/DataFlowConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/ExtractedFiles.ql +ql/rust/ql/src/queries/diagnostics/ExtractionErrors.ql +ql/rust/ql/src/queries/diagnostics/ExtractionWarnings.ql +ql/rust/ql/src/queries/diagnostics/SsaConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/UnextractedElements.ql +ql/rust/ql/src/queries/diagnostics/UnresolvedMacroCalls.ql +ql/rust/ql/src/queries/security/CWE-020/RegexInjection.ql +ql/rust/ql/src/queries/security/CWE-022/TaintedPath.ql +ql/rust/ql/src/queries/security/CWE-089/SqlInjection.ql +ql/rust/ql/src/queries/security/CWE-311/CleartextTransmission.ql +ql/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql +ql/rust/ql/src/queries/security/CWE-327/BrokenCryptoAlgorithm.ql +ql/rust/ql/src/queries/security/CWE-328/WeakSensitiveDataHashing.ql +ql/rust/ql/src/queries/security/CWE-825/AccessInvalidPointer.ql +ql/rust/ql/src/queries/summary/LinesOfCode.ql +ql/rust/ql/src/queries/summary/LinesOfUserCode.ql +ql/rust/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql +ql/rust/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql +ql/rust/ql/src/queries/summary/QuerySinkCounts.ql +ql/rust/ql/src/queries/summary/SummaryStats.ql +ql/rust/ql/src/queries/summary/SummaryStatsReduced.ql +ql/rust/ql/src/queries/telemetry/DatabaseQualityDiagnostics.ql +ql/rust/ql/src/queries/telemetry/ExtractorInformation.ql diff --git a/rust/ql/integration-tests/query-suite/rust-security-and-quality.qls.expected b/rust/ql/integration-tests/query-suite/rust-security-and-quality.qls.expected new file mode 100644 index 000000000000..c21b79749d17 --- /dev/null +++ b/rust/ql/integration-tests/query-suite/rust-security-and-quality.qls.expected @@ -0,0 +1,29 @@ +ql/rust/ql/src/queries/diagnostics/AstConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/CfgConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/DataFlowConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/ExtractedFiles.ql +ql/rust/ql/src/queries/diagnostics/ExtractionErrors.ql +ql/rust/ql/src/queries/diagnostics/ExtractionWarnings.ql +ql/rust/ql/src/queries/diagnostics/SsaConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/UnextractedElements.ql +ql/rust/ql/src/queries/diagnostics/UnresolvedMacroCalls.ql +ql/rust/ql/src/queries/security/CWE-020/RegexInjection.ql +ql/rust/ql/src/queries/security/CWE-022/TaintedPath.ql +ql/rust/ql/src/queries/security/CWE-089/SqlInjection.ql +ql/rust/ql/src/queries/security/CWE-311/CleartextTransmission.ql +ql/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql +ql/rust/ql/src/queries/security/CWE-327/BrokenCryptoAlgorithm.ql +ql/rust/ql/src/queries/security/CWE-328/WeakSensitiveDataHashing.ql +ql/rust/ql/src/queries/security/CWE-696/BadCtorInitialization.ql +ql/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql +ql/rust/ql/src/queries/security/CWE-825/AccessInvalidPointer.ql +ql/rust/ql/src/queries/summary/LinesOfCode.ql +ql/rust/ql/src/queries/summary/LinesOfUserCode.ql +ql/rust/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql +ql/rust/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql +ql/rust/ql/src/queries/summary/QuerySinkCounts.ql +ql/rust/ql/src/queries/summary/SummaryStats.ql +ql/rust/ql/src/queries/summary/SummaryStatsReduced.ql +ql/rust/ql/src/queries/telemetry/DatabaseQualityDiagnostics.ql +ql/rust/ql/src/queries/telemetry/ExtractorInformation.ql +ql/rust/ql/src/queries/unusedentities/UnusedVariable.ql diff --git a/rust/ql/integration-tests/query-suite/rust-security-extended.qls.expected b/rust/ql/integration-tests/query-suite/rust-security-extended.qls.expected new file mode 100644 index 000000000000..b3683f02d927 --- /dev/null +++ b/rust/ql/integration-tests/query-suite/rust-security-extended.qls.expected @@ -0,0 +1,27 @@ +ql/rust/ql/src/queries/diagnostics/AstConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/CfgConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/DataFlowConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/ExtractedFiles.ql +ql/rust/ql/src/queries/diagnostics/ExtractionErrors.ql +ql/rust/ql/src/queries/diagnostics/ExtractionWarnings.ql +ql/rust/ql/src/queries/diagnostics/SsaConsistencyCounts.ql +ql/rust/ql/src/queries/diagnostics/UnextractedElements.ql +ql/rust/ql/src/queries/diagnostics/UnresolvedMacroCalls.ql +ql/rust/ql/src/queries/security/CWE-020/RegexInjection.ql +ql/rust/ql/src/queries/security/CWE-022/TaintedPath.ql +ql/rust/ql/src/queries/security/CWE-089/SqlInjection.ql +ql/rust/ql/src/queries/security/CWE-311/CleartextTransmission.ql +ql/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql +ql/rust/ql/src/queries/security/CWE-327/BrokenCryptoAlgorithm.ql +ql/rust/ql/src/queries/security/CWE-328/WeakSensitiveDataHashing.ql +ql/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql +ql/rust/ql/src/queries/security/CWE-825/AccessInvalidPointer.ql +ql/rust/ql/src/queries/summary/LinesOfCode.ql +ql/rust/ql/src/queries/summary/LinesOfUserCode.ql +ql/rust/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql +ql/rust/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql +ql/rust/ql/src/queries/summary/QuerySinkCounts.ql +ql/rust/ql/src/queries/summary/SummaryStats.ql +ql/rust/ql/src/queries/summary/SummaryStatsReduced.ql +ql/rust/ql/src/queries/telemetry/DatabaseQualityDiagnostics.ql +ql/rust/ql/src/queries/telemetry/ExtractorInformation.ql diff --git a/rust/ql/integration-tests/query-suite/test.py b/rust/ql/integration-tests/query-suite/test.py new file mode 100644 index 000000000000..5f48fb428531 --- /dev/null +++ b/rust/ql/integration-tests/query-suite/test.py @@ -0,0 +1,14 @@ +import runs_on +import pytest +from query_suites import * + +well_known_query_suites = ['rust-code-quality.qls', 'rust-security-and-quality.qls', 'rust-security-extended.qls', 'rust-code-scanning.qls'] + +@runs_on.posix +@pytest.mark.parametrize("query_suite", well_known_query_suites) +def test(codeql, rust, check_query_suite, query_suite): + check_query_suite(query_suite) + +@runs_on.posix +def test_not_included_queries(codeql, rust, check_queries_not_included): + check_queries_not_included('rust', well_known_query_suites) From c54b684132620d99e47c171cd7f4653ca04a3b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Vajk?= Date: Thu, 24 Apr 2025 10:29:48 +0200 Subject: [PATCH 207/240] Apply suggestions from code review - code quality improvements Co-authored-by: Paolo Tranquilli --- misc/pytest/lib/query_suites.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/pytest/lib/query_suites.py b/misc/pytest/lib/query_suites.py index b0b8aea8cf8c..fcbb1f16bde0 100644 --- a/misc/pytest/lib/query_suites.py +++ b/misc/pytest/lib/query_suites.py @@ -5,18 +5,18 @@ @pytest.fixture def check_query_suite(codeql, cwd, expected_files, semmle_code_dir): def ret(query_suite): - actual = codeql.resolve.queries(query_suite, _capture=True).strip() + actual = codeql.resolve.queries(query_suite, _capture=True) actual = sorted(actual.splitlines()) actual = [os.path.relpath(q, semmle_code_dir) for q in actual] actual_file_name = query_suite + '.actual' expected_files.add(actual_file_name) - (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') + (cwd / actual_file_name).write_text('\n'.join(actual) + '\n') return ret @pytest.fixture def check_queries_not_included(codeql, cwd, expected_files, semmle_code_dir): def ret(lang_folder_name, query_suites): - all_queries = codeql.resolve.queries(semmle_code_dir / 'ql' / lang_folder_name / 'ql' / 'src', _capture=True).strip().splitlines() + all_queries = codeql.resolve.queries(semmle_code_dir / 'ql' / lang_folder_name / 'ql' / 'src', _capture=True).splitlines() included_in_qls = set() for query_suite in query_suites: @@ -26,5 +26,5 @@ def ret(lang_folder_name, query_suites): not_included = [os.path.relpath(q, semmle_code_dir) for q in not_included] not_included_file_name = 'not_included_in_qls.actual' expected_files.add(not_included_file_name) - (cwd / not_included_file_name).write_text('\n'.join(not_included)+'\n') + (cwd / not_included_file_name).write_text('\n'.join(not_included) + '\n') return ret From 998e64baf3c7753500ebec5b819a8943661a25bb Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Fri, 25 Apr 2025 09:15:43 +0200 Subject: [PATCH 208/240] Fix failing C# test --- .../posix/query-suite/csharp-code-quality.qls.expected | 1 + 1 file changed, 1 insertion(+) diff --git a/csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected b/csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected index 533344cbbc27..472e79575ca5 100644 --- a/csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected +++ b/csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected @@ -1,3 +1,4 @@ +ql/csharp/ql/src/API Abuse/FormatInvalid.ql ql/csharp/ql/src/API Abuse/NoDisposeCallOnLocalIDisposable.ql ql/csharp/ql/src/Bad Practices/Control-Flow/ConstantCondition.ql ql/csharp/ql/src/Dead Code/DeadStoreOfLocal.ql From e71e7a08bbad2f94d6ead8b86d8ead936b8070bc Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 25 Apr 2025 15:20:20 +0200 Subject: [PATCH 209/240] Swift: add more debug logs --- swift/extractor/SwiftExtractor.cpp | 6 ++++++ swift/extractor/main.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/swift/extractor/SwiftExtractor.cpp b/swift/extractor/SwiftExtractor.cpp index b0de6a7a2a49..cdec678b8abf 100644 --- a/swift/extractor/SwiftExtractor.cpp +++ b/swift/extractor/SwiftExtractor.cpp @@ -210,6 +210,7 @@ void codeql::extractSwiftFiles(SwiftExtractorState& state, swift::CompilerInstan auto inputFiles = collectInputFilenames(compiler); std::vector todo = collectLoadedModules(compiler); state.encounteredModules.insert(todo.begin(), todo.end()); + LOG_DEBUG("{} modules loaded", todo.size()); while (!todo.empty()) { auto module = todo.back(); @@ -223,13 +224,18 @@ void codeql::extractSwiftFiles(SwiftExtractorState& state, swift::CompilerInstan } isFromSourceFile = true; if (inputFiles.count(sourceFile->getFilename().str()) == 0) { + LOG_DEBUG("skipping module {} from file {}, not in input files", module->getName(), + sourceFile->getFilename()); continue; } + LOG_DEBUG("extracting module {} from input file {}", module->getName(), + sourceFile->getFilename()); archiveFile(state.configuration, *sourceFile); encounteredModules = extractDeclarations(state, compiler, *module, sourceFile, /*lazy declaration*/ nullptr); } if (!isFromSourceFile) { + LOG_DEBUG("extracting module {} from non-source file", module->getName()); encounteredModules = extractDeclarations(state, compiler, *module, /*source file*/ nullptr, /*lazy declaration*/ nullptr); } diff --git a/swift/extractor/main.cpp b/swift/extractor/main.cpp index 24c295e50f29..e28ebc5aa8c1 100644 --- a/swift/extractor/main.cpp +++ b/swift/extractor/main.cpp @@ -93,6 +93,7 @@ class Observer : public swift::FrontendObserver { explicit Observer(const codeql::SwiftExtractorConfiguration& config) : state{config} {} void parsedArgs(swift::CompilerInvocation& invocation) override { + LOG_DEBUG("{}(...)", __func__); auto& options = invocation.getFrontendOptions(); options.KeepASTContext = true; lockOutputSwiftModuleTraps(state, options); @@ -101,18 +102,21 @@ class Observer : public swift::FrontendObserver { } void configuredCompiler(swift::CompilerInstance& instance) override { + LOG_DEBUG("{}(...)", __func__); // remove default consumers to avoid double messaging instance.getDiags().takeConsumers(); instance.addDiagnosticConsumer(&diagConsumer); } void performedCompilation(swift::CompilerInstance& compiler) override { + LOG_DEBUG("{}(...)", __func__); codeql::extractSwiftFiles(state, compiler); codeql::extractSwiftInvocation(state, compiler, invocationTrap); codeql::extractExtractLazyDeclarations(state, compiler); } void markSuccessfullyExtractedFiles() { + LOG_DEBUG("{}()", __func__); codeql::SwiftLocationExtractor locExtractor{invocationTrap}; for (const auto& src : state.sourceFiles) { auto fileLabel = locExtractor.emitFile(src); From d9a6a630e5c6fd2c714b750764391329c385f283 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 25 Apr 2025 15:37:08 +0200 Subject: [PATCH 210/240] Swift: fix log compilation --- swift/extractor/SwiftExtractor.cpp | 6 +++--- swift/extractor/main.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/swift/extractor/SwiftExtractor.cpp b/swift/extractor/SwiftExtractor.cpp index cdec678b8abf..37ee75a0813c 100644 --- a/swift/extractor/SwiftExtractor.cpp +++ b/swift/extractor/SwiftExtractor.cpp @@ -224,18 +224,18 @@ void codeql::extractSwiftFiles(SwiftExtractorState& state, swift::CompilerInstan } isFromSourceFile = true; if (inputFiles.count(sourceFile->getFilename().str()) == 0) { - LOG_DEBUG("skipping module {} from file {}, not in input files", module->getName(), + LOG_DEBUG("skipping module {} from file {}, not in input files", module->getName().get(), sourceFile->getFilename()); continue; } - LOG_DEBUG("extracting module {} from input file {}", module->getName(), + LOG_DEBUG("extracting module {} from input file {}", module->getName().get(), sourceFile->getFilename()); archiveFile(state.configuration, *sourceFile); encounteredModules = extractDeclarations(state, compiler, *module, sourceFile, /*lazy declaration*/ nullptr); } if (!isFromSourceFile) { - LOG_DEBUG("extracting module {} from non-source file", module->getName()); + LOG_DEBUG("extracting module {} from non-source file", module->getName().get()); encounteredModules = extractDeclarations(state, compiler, *module, /*source file*/ nullptr, /*lazy declaration*/ nullptr); } diff --git a/swift/extractor/main.cpp b/swift/extractor/main.cpp index e28ebc5aa8c1..8019d1bfc660 100644 --- a/swift/extractor/main.cpp +++ b/swift/extractor/main.cpp @@ -93,7 +93,7 @@ class Observer : public swift::FrontendObserver { explicit Observer(const codeql::SwiftExtractorConfiguration& config) : state{config} {} void parsedArgs(swift::CompilerInvocation& invocation) override { - LOG_DEBUG("{}(...)", __func__); + LOG_DEBUG("{}()", __func__); auto& options = invocation.getFrontendOptions(); options.KeepASTContext = true; lockOutputSwiftModuleTraps(state, options); @@ -102,14 +102,14 @@ class Observer : public swift::FrontendObserver { } void configuredCompiler(swift::CompilerInstance& instance) override { - LOG_DEBUG("{}(...)", __func__); + LOG_DEBUG("{}()", __func__); // remove default consumers to avoid double messaging instance.getDiags().takeConsumers(); instance.addDiagnosticConsumer(&diagConsumer); } void performedCompilation(swift::CompilerInstance& compiler) override { - LOG_DEBUG("{}(...)", __func__); + LOG_DEBUG("{}()", __func__); codeql::extractSwiftFiles(state, compiler); codeql::extractSwiftInvocation(state, compiler, invocationTrap); codeql::extractExtractLazyDeclarations(state, compiler); From 2a8fe53b04f9ae232bbe5b3cc5bff84a99ea4784 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 13:09:11 +0200 Subject: [PATCH 211/240] Shared: Remove --with-mixed-summaries logic. --- .../models-as-data/generate_flow_model.py | 43 ++++++------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/misc/scripts/models-as-data/generate_flow_model.py b/misc/scripts/models-as-data/generate_flow_model.py index 61712d96d264..dba468762b7f 100755 --- a/misc/scripts/models-as-data/generate_flow_model.py +++ b/misc/scripts/models-as-data/generate_flow_model.py @@ -34,7 +34,6 @@ def __init__ (self, language): self.generateSources = False self.generateSummaries = False self.generateNeutrals = False - self.generateMixedSummaries = False self.generateMixedNeutrals = False self.generateTypeBasedSummaries = False self.dryRun = False @@ -53,8 +52,7 @@ def printHelp(self): --with-sources --with-summaries --with-neutrals - --with-mixed-summaries. May not be used in conjunction with --with-summaries. - --with-mixed-neutrals. Should only be used in conjunction with --with-mixed-summaries. + --with-mixed-neutrals. Should only be used in conjunction with --with-summaries. --with-typebased-summaries (Experimental) If none of these flags are specified, all models are generated except for the type based models. @@ -86,9 +84,10 @@ def make(language): generator.printHelp() sys.exit(0) - if "--with-summaries" in sys.argv and "--with-mixed-summaries" in sys.argv: - generator.printHelp() - sys.exit(0) + # Convert --with-mixed-summaries to --with-summaries for backward compatibility + if "--with-mixed-summaries" in sys.argv: + sys.argv.remove("--with-mixed-summaries") + sys.argv.append("--with-summaries") if "--with-sinks" in sys.argv: sys.argv.remove("--with-sinks") @@ -106,10 +105,6 @@ def make(language): sys.argv.remove("--with-neutrals") generator.generateNeutrals = True - if "--with-mixed-summaries" in sys.argv: - sys.argv.remove("--with-mixed-summaries") - generator.generateMixedSummaries = True - if "--with-mixed-neutrals" in sys.argv: sys.argv.remove("--with-mixed-neutrals") generator.generateMixedNeutrals = True @@ -127,7 +122,6 @@ def make(language): not generator.generateSummaries and not generator.generateNeutrals and not generator.generateTypeBasedSummaries and - not generator.generateMixedSummaries and not generator.generateMixedNeutrals): generator.generateSinks = generator.generateSources = generator.generateSummaries = generator.generateNeutrals = True @@ -166,37 +160,27 @@ def getAddsTo(self, query, predicate): return self.asAddsTo(rows, predicate) def makeContent(self): + summaryAddsTo = {} if self.generateSummaries: - summaryAddsTo = self.getAddsTo("CaptureSummaryModels.ql", helpers.summaryModelPredicate) - else: - summaryAddsTo = { } + summaryAddsTo = self.getAddsTo("CaptureMixedSummaryModels.ql", helpers.summaryModelPredicate) + sinkAddsTo = {} if self.generateSinks: sinkAddsTo = self.getAddsTo("CaptureSinkModels.ql", helpers.sinkModelPredicate) - else: - sinkAddsTo = { } + sourceAddsTo = {} if self.generateSources: sourceAddsTo = self.getAddsTo("CaptureSourceModels.ql", helpers.sourceModelPredicate) - else: - sourceAddsTo = {} + neutralAddsTo = {} if self.generateNeutrals: neutralAddsTo = self.getAddsTo("CaptureNeutralModels.ql", helpers.neutralModelPredicate) - else: - neutralAddsTo = { } - - if self.generateMixedSummaries: - mixedSummaryAddsTo = self.getAddsTo("CaptureMixedSummaryModels.ql", helpers.summaryModelPredicate) - else: - mixedSummaryAddsTo = { } + mixedNeutralAddsTo = {} if self.generateMixedNeutrals: mixedNeutralAddsTo = self.getAddsTo("CaptureMixedNeutralModels.ql", helpers.neutralModelPredicate) - else: - mixedNeutralAddsTo = { } - return helpers.merge(summaryAddsTo, mixedSummaryAddsTo, sinkAddsTo, sourceAddsTo, neutralAddsTo, mixedNeutralAddsTo) + return helpers.merge(summaryAddsTo, sinkAddsTo, sourceAddsTo, neutralAddsTo, mixedNeutralAddsTo) def makeTypeBasedContent(self): if self.generateTypeBasedSummaries: @@ -232,8 +216,7 @@ def run(self): self.generateSources or self.generateSummaries or self.generateNeutrals or - self.generateMixedSummaries or - self.generatedMixedNeutrals): + self.generateMixedNeutrals): self.save(content, ".model.yml") if self.generateTypeBasedSummaries: From fa5162fb138ae6c83784ca39b391c0ddfb53b0bf Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 13:12:00 +0200 Subject: [PATCH 212/240] Shared: Remove the backwards compatbility flag. --- misc/scripts/models-as-data/generate_flow_model.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/misc/scripts/models-as-data/generate_flow_model.py b/misc/scripts/models-as-data/generate_flow_model.py index dba468762b7f..a17b6f328b25 100755 --- a/misc/scripts/models-as-data/generate_flow_model.py +++ b/misc/scripts/models-as-data/generate_flow_model.py @@ -84,11 +84,6 @@ def make(language): generator.printHelp() sys.exit(0) - # Convert --with-mixed-summaries to --with-summaries for backward compatibility - if "--with-mixed-summaries" in sys.argv: - sys.argv.remove("--with-mixed-summaries") - sys.argv.append("--with-summaries") - if "--with-sinks" in sys.argv: sys.argv.remove("--with-sinks") generator.generateSinks = True From ae70c76a07f76adce5fdce817159b6ccb570ddc1 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 13:13:22 +0200 Subject: [PATCH 213/240] Shared: Use the CaptureSummaryModels instead of CaptureMixedSummaryModels. --- misc/scripts/models-as-data/generate_flow_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/scripts/models-as-data/generate_flow_model.py b/misc/scripts/models-as-data/generate_flow_model.py index a17b6f328b25..885a9234c3d7 100755 --- a/misc/scripts/models-as-data/generate_flow_model.py +++ b/misc/scripts/models-as-data/generate_flow_model.py @@ -157,7 +157,7 @@ def getAddsTo(self, query, predicate): def makeContent(self): summaryAddsTo = {} if self.generateSummaries: - summaryAddsTo = self.getAddsTo("CaptureMixedSummaryModels.ql", helpers.summaryModelPredicate) + summaryAddsTo = self.getAddsTo("CaptureSummaryModels.ql", helpers.summaryModelPredicate) sinkAddsTo = {} if self.generateSinks: From 2357a69d55ff72850e5328f17185a5714d67520c Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 13:16:59 +0200 Subject: [PATCH 214/240] Shared: Remove the --with-mixed-neutrals logic. --- .../models-as-data/generate_flow_model.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/misc/scripts/models-as-data/generate_flow_model.py b/misc/scripts/models-as-data/generate_flow_model.py index 885a9234c3d7..1d108015fa0b 100755 --- a/misc/scripts/models-as-data/generate_flow_model.py +++ b/misc/scripts/models-as-data/generate_flow_model.py @@ -34,7 +34,6 @@ def __init__ (self, language): self.generateSources = False self.generateSummaries = False self.generateNeutrals = False - self.generateMixedNeutrals = False self.generateTypeBasedSummaries = False self.dryRun = False self.dirname = "modelgenerator" @@ -52,7 +51,6 @@ def printHelp(self): --with-sources --with-summaries --with-neutrals - --with-mixed-neutrals. Should only be used in conjunction with --with-summaries. --with-typebased-summaries (Experimental) If none of these flags are specified, all models are generated except for the type based models. @@ -100,10 +98,6 @@ def make(language): sys.argv.remove("--with-neutrals") generator.generateNeutrals = True - if "--with-mixed-neutrals" in sys.argv: - sys.argv.remove("--with-mixed-neutrals") - generator.generateMixedNeutrals = True - if "--with-typebased-summaries" in sys.argv: sys.argv.remove("--with-typebased-summaries") generator.generateTypeBasedSummaries = True @@ -116,8 +110,7 @@ def make(language): not generator.generateSources and not generator.generateSummaries and not generator.generateNeutrals and - not generator.generateTypeBasedSummaries and - not generator.generateMixedNeutrals): + not generator.generateTypeBasedSummaries): generator.generateSinks = generator.generateSources = generator.generateSummaries = generator.generateNeutrals = True n = len(sys.argv) @@ -171,11 +164,7 @@ def makeContent(self): if self.generateNeutrals: neutralAddsTo = self.getAddsTo("CaptureNeutralModels.ql", helpers.neutralModelPredicate) - mixedNeutralAddsTo = {} - if self.generateMixedNeutrals: - mixedNeutralAddsTo = self.getAddsTo("CaptureMixedNeutralModels.ql", helpers.neutralModelPredicate) - - return helpers.merge(summaryAddsTo, sinkAddsTo, sourceAddsTo, neutralAddsTo, mixedNeutralAddsTo) + return helpers.merge(summaryAddsTo, sinkAddsTo, sourceAddsTo, neutralAddsTo) def makeTypeBasedContent(self): if self.generateTypeBasedSummaries: @@ -210,8 +199,7 @@ def run(self): if (self.generateSinks or self.generateSources or self.generateSummaries or - self.generateNeutrals or - self.generateMixedNeutrals): + self.generateNeutrals): self.save(content, ".model.yml") if self.generateTypeBasedSummaries: From f78be91af2257501712a4130679ca19aa48c5b29 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 14:10:17 +0200 Subject: [PATCH 215/240] Shared: Re-factor the model generator and put the heuristic queries in its own module. --- .../internal/ModelGeneratorImpl.qll | 522 +++++++++--------- 1 file changed, 265 insertions(+), 257 deletions(-) diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll index 37934b921147..afb500b3ed1c 100644 --- a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll +++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll @@ -338,10 +338,6 @@ module MakeModelGenerator< } } - private string getOutput(ReturnNodeExt node) { - result = PrintReturnNodeExt::getOutput(node) - } - final private class SummaryTargetApiFinal = SummaryTargetApi; class DataFlowSummaryTargetApi extends SummaryTargetApiFinal { @@ -352,16 +348,6 @@ module MakeModelGenerator< class DataFlowSinkTargetApi = SinkTargetApi; - private module ModelPrintingInput implements Printing::ModelPrintingSig { - class SummaryApi = DataFlowSummaryTargetApi; - - class SourceOrSinkApi = SourceOrSinkTargetApi; - - string getProvenance() { result = "df-generated" } - } - - module ModelPrinting = Printing::ModelPrinting; - /** * Holds if `c` is a relevant content kind, where the underlying type is relevant. */ @@ -369,19 +355,6 @@ module MakeModelGenerator< isRelevantType(getUnderlyingContentType(c)) } - /** - * Holds if data can flow from `node1` to `node2` either via a read or a write of an intermediate field `f`. - */ - private predicate isRelevantTaintStep(DataFlow::Node node1, DataFlow::Node node2) { - exists(DataFlow::ContentSet f | - DataFlow::readStep(node1, f, node2) and - // Partially restrict the content types used for intermediate steps. - (not exists(getUnderlyingContentType(f)) or isRelevantTypeInContent(f)) - ) - or - exists(DataFlow::ContentSet f | DataFlow::storeStep(node1, f, node2) | containerContent(f)) - } - /** * Holds if content `c` is either a field, a synthetic field or language specific * content of a relevant type or a container like content. @@ -393,177 +366,302 @@ module MakeModelGenerator< } /** - * Gets the MaD string representation of the parameter node `p`. + * Provides classes and predicates related to capturing summary models + * based on heuristic data flow. */ - string parameterNodeAsInput(DataFlow::ParameterNode p) { - result = parameterAccess(asParameter(p)) - or - result = qualifierString() and p instanceof InstanceParameterNode - } + module Heuristic { + private module ModelPrintingInput implements Printing::ModelPrintingSig { + class SummaryApi = DataFlowSummaryTargetApi; - /** - * Gets the MaD input string representation of `source`. - */ - string asInputArgument(NodeExtended source) { result = getInputArgument(source) } + class SourceOrSinkApi = SourceOrSinkTargetApi; - /** - * Gets the summary model of `api`, if it follows the `fluent` programming pattern (returns `this`). - */ - private string captureQualifierFlow(DataFlowSummaryTargetApi api) { - exists(ReturnNodeExt ret | - api = returnNodeEnclosingCallable(ret) and - isOwnInstanceAccessNode(ret) - ) and - result = ModelPrinting::asLiftedValueModel(api, qualifierString(), "ReturnValue") - } + string getProvenance() { result = "df-generated" } + } - private int accessPathLimit0() { result = 2 } + module ModelPrinting = Printing::ModelPrinting; - private newtype TTaintState = - TTaintRead(int n) { n in [0 .. accessPathLimit0()] } or - TTaintStore(int n) { n in [1 .. accessPathLimit0()] } + private string getOutput(ReturnNodeExt node) { + result = PrintReturnNodeExt::getOutput(node) + } - abstract private class TaintState extends TTaintState { - abstract string toString(); - } + /** + * Holds if data can flow from `node1` to `node2` either via a read or a write of an intermediate field `f`. + */ + private predicate isRelevantTaintStep(DataFlow::Node node1, DataFlow::Node node2) { + exists(DataFlow::ContentSet f | + DataFlow::readStep(node1, f, node2) and + // Partially restrict the content types used for intermediate steps. + (not exists(getUnderlyingContentType(f)) or isRelevantTypeInContent(f)) + ) + or + exists(DataFlow::ContentSet f | DataFlow::storeStep(node1, f, node2) | containerContent(f)) + } - /** - * A FlowState representing a tainted read. - */ - private class TaintRead extends TaintState, TTaintRead { - private int step; + /** + * Gets the MaD string representation of the parameter node `p`. + */ + string parameterNodeAsInput(DataFlow::ParameterNode p) { + result = parameterAccess(asParameter(p)) + or + result = qualifierString() and p instanceof InstanceParameterNode + } - TaintRead() { this = TTaintRead(step) } + /** + * Gets the MaD input string representation of `source`. + */ + private string asInputArgument(NodeExtended source) { result = getInputArgument(source) } /** - * Gets the flow state step number. + * Gets the summary model of `api`, if it follows the `fluent` programming pattern (returns `this`). */ - int getStep() { result = step } + private string captureQualifierFlow(DataFlowSummaryTargetApi api) { + exists(ReturnNodeExt ret | + api = returnNodeEnclosingCallable(ret) and + isOwnInstanceAccessNode(ret) + ) and + result = ModelPrinting::asLiftedValueModel(api, qualifierString(), "ReturnValue") + } - override string toString() { result = "TaintRead(" + step + ")" } - } + private int accessPathLimit0() { result = 2 } - /** - * A FlowState representing a tainted write. - */ - private class TaintStore extends TaintState, TTaintStore { - private int step; + private newtype TTaintState = + TTaintRead(int n) { n in [0 .. accessPathLimit0()] } or + TTaintStore(int n) { n in [1 .. accessPathLimit0()] } - TaintStore() { this = TTaintStore(step) } + abstract private class TaintState extends TTaintState { + abstract string toString(); + } /** - * Gets the flow state step number. + * A FlowState representing a tainted read. */ - int getStep() { result = step } + private class TaintRead extends TaintState, TTaintRead { + private int step; - override string toString() { result = "TaintStore(" + step + ")" } - } + TaintRead() { this = TTaintRead(step) } - /** - * A data flow configuration for tracking flow through APIs. - * The sources are the parameters of an API and the sinks are the return values (excluding `this`) and parameters. - * - * This can be used to generate Flow summaries for APIs from parameter to return. - */ - module PropagateFlowConfig implements DataFlow::StateConfigSig { - class FlowState = TaintState; - - predicate isSource(DataFlow::Node source, FlowState state) { - source instanceof DataFlow::ParameterNode and - exists(Callable c | - c = getEnclosingCallable(source) and - c instanceof DataFlowSummaryTargetApi and - not isUninterestingForHeuristicDataFlowModels(c) - ) and - state.(TaintRead).getStep() = 0 + /** + * Gets the flow state step number. + */ + int getStep() { result = step } + + override string toString() { result = "TaintRead(" + step + ")" } } - predicate isSink(DataFlow::Node sink, FlowState state) { - sink instanceof ReturnNodeExt and - not isOwnInstanceAccessNode(sink) and - not exists(captureQualifierFlow(getAsExprEnclosingCallable(sink))) and - (state instanceof TaintRead or state instanceof TaintStore) + /** + * A FlowState representing a tainted write. + */ + private class TaintStore extends TaintState, TTaintStore { + private int step; + + TaintStore() { this = TTaintStore(step) } + + /** + * Gets the flow state step number. + */ + int getStep() { result = step } + + override string toString() { result = "TaintStore(" + step + ")" } } - predicate isAdditionalFlowStep( - DataFlow::Node node1, FlowState state1, DataFlow::Node node2, FlowState state2 - ) { - exists(DataFlow::NodeEx n1, DataFlow::NodeEx n2, DataFlow::ContentSet c | - node1 = n1.asNode() and - node2 = n2.asNode() and - DataFlow::storeEx(n1, c.getAStoreContent(), n2, _, _) and - isRelevantContent0(c) and - ( - state1 instanceof TaintRead and state2.(TaintStore).getStep() = 1 - or - state1.(TaintStore).getStep() + 1 = state2.(TaintStore).getStep() + /** + * A data flow configuration for tracking flow through APIs. + * The sources are the parameters of an API and the sinks are the return values (excluding `this`) and parameters. + * + * This can be used to generate Flow summaries for APIs from parameter to return. + */ + private module PropagateFlowConfig implements DataFlow::StateConfigSig { + class FlowState = TaintState; + + predicate isSource(DataFlow::Node source, FlowState state) { + source instanceof DataFlow::ParameterNode and + exists(Callable c | + c = getEnclosingCallable(source) and + c instanceof DataFlowSummaryTargetApi and + not isUninterestingForHeuristicDataFlowModels(c) + ) and + state.(TaintRead).getStep() = 0 + } + + predicate isSink(DataFlow::Node sink, FlowState state) { + sink instanceof ReturnNodeExt and + not isOwnInstanceAccessNode(sink) and + not exists(captureQualifierFlow(getAsExprEnclosingCallable(sink))) and + (state instanceof TaintRead or state instanceof TaintStore) + } + + predicate isAdditionalFlowStep( + DataFlow::Node node1, FlowState state1, DataFlow::Node node2, FlowState state2 + ) { + exists(DataFlow::NodeEx n1, DataFlow::NodeEx n2, DataFlow::ContentSet c | + node1 = n1.asNode() and + node2 = n2.asNode() and + DataFlow::storeEx(n1, c.getAStoreContent(), n2, _, _) and + isRelevantContent0(c) and + ( + state1 instanceof TaintRead and state2.(TaintStore).getStep() = 1 + or + state1.(TaintStore).getStep() + 1 = state2.(TaintStore).getStep() + ) ) + or + exists(DataFlow::ContentSet c | + DataFlow::readStep(node1, c, node2) and + isRelevantContent0(c) and + state1.(TaintRead).getStep() + 1 = state2.(TaintRead).getStep() + ) + } + + predicate isBarrier(DataFlow::Node n) { + exists(Type t | t = n.(NodeExtended).getType() and not isRelevantType(t)) + } + + DataFlow::FlowFeature getAFeature() { + result instanceof DataFlow::FeatureEqualSourceSinkCallContext + } + } + + module PropagateFlow = TaintTracking::GlobalWithState; + + /** + * Gets the summary model(s) of `api`, if there is flow from parameters to return value or parameter. + */ + string captureThroughFlow0( + DataFlowSummaryTargetApi api, DataFlow::ParameterNode p, ReturnNodeExt returnNodeExt + ) { + exists(string input, string output | + getEnclosingCallable(p) = api and + getEnclosingCallable(returnNodeExt) = api and + input = parameterNodeAsInput(p) and + output = getOutput(returnNodeExt) and + input != output and + result = ModelPrinting::asLiftedTaintModel(api, input, output) ) - or - exists(DataFlow::ContentSet c | - DataFlow::readStep(node1, c, node2) and - isRelevantContent0(c) and - state1.(TaintRead).getStep() + 1 = state2.(TaintRead).getStep() + } + + /** + * Gets the summary model(s) of `api`, if there is flow from parameters to return value or parameter. + */ + private string captureThroughFlow(DataFlowSummaryTargetApi api) { + exists(DataFlow::ParameterNode p, ReturnNodeExt returnNodeExt | + PropagateFlow::flow(p, returnNodeExt) and + result = captureThroughFlow0(api, p, returnNodeExt) ) } - predicate isBarrier(DataFlow::Node n) { - exists(Type t | t = n.(NodeExtended).getType() and not isRelevantType(t)) + /** + * Gets the summary model(s) of `api`, if there is flow from parameters to the + * return value or parameter or if `api` is a fluent API. + */ + string captureFlow(DataFlowSummaryTargetApi api) { + result = captureQualifierFlow(api) or + result = captureThroughFlow(api) + } + + /** + * Gets the neutral summary model for `api`, if any. + * A neutral summary model is generated, if we are not generating + * a summary model that applies to `api`. + */ + string captureNoFlow(DataFlowSummaryTargetApi api) { + not exists(DataFlowSummaryTargetApi api0 | + exists(captureFlow(api0)) and api0.lift() = api.lift() + ) and + api.isRelevant() and + result = ModelPrinting::asNeutralSummaryModel(api) } - DataFlow::FlowFeature getAFeature() { - result instanceof DataFlow::FeatureEqualSourceSinkCallContext + /** + * A data flow configuration used for finding new sources. + * The sources are the already known existing sources and the sinks are the API return nodes. + * + * This can be used to generate Source summaries for an API, if the API expose an already known source + * via its return (then the API itself becomes a source). + */ + module PropagateFromSourceConfig implements DataFlow::ConfigSig { + predicate isSource(DataFlow::Node source) { + exists(string kind | + isRelevantSourceKind(kind) and + sourceNode(source, kind) + ) + } + + predicate isSink(DataFlow::Node sink) { + sink instanceof ReturnNodeExt and + getEnclosingCallable(sink) instanceof DataFlowSourceTargetApi + } + + DataFlow::FlowFeature getAFeature() { result instanceof DataFlow::FeatureHasSinkCallContext } + + predicate isBarrier(DataFlow::Node n) { + exists(Type t | t = n.(NodeExtended).getType() and not isRelevantType(t)) + } + + predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) { + isRelevantTaintStep(node1, node2) + } } - } - module PropagateFlow = TaintTracking::GlobalWithState; + private module PropagateFromSource = TaintTracking::Global; - /** - * Gets the summary model(s) of `api`, if there is flow from parameters to return value or parameter. - */ - string captureThroughFlow0( - DataFlowSummaryTargetApi api, DataFlow::ParameterNode p, ReturnNodeExt returnNodeExt - ) { - exists(string input, string output | - getEnclosingCallable(p) = api and - getEnclosingCallable(returnNodeExt) = api and - input = parameterNodeAsInput(p) and - output = getOutput(returnNodeExt) and - input != output and - result = ModelPrinting::asLiftedTaintModel(api, input, output) - ) - } + /** + * Gets the source model(s) of `api`, if there is flow from an existing known source to the return of `api`. + */ + string captureSource(DataFlowSourceTargetApi api) { + exists(NodeExtended source, ReturnNodeExt sink, string kind | + PropagateFromSource::flow(source, sink) and + sourceNode(source, kind) and + api = getEnclosingCallable(sink) and + not irrelevantSourceSinkApi(getEnclosingCallable(source), api) and + result = ModelPrinting::asSourceModel(api, getOutput(sink), kind) + ) + } - /** - * Gets the summary model(s) of `api`, if there is flow from parameters to return value or parameter. - */ - private string captureThroughFlow(DataFlowSummaryTargetApi api) { - exists(DataFlow::ParameterNode p, ReturnNodeExt returnNodeExt | - PropagateFlow::flow(p, returnNodeExt) and - result = captureThroughFlow0(api, p, returnNodeExt) - ) - } + /** + * A data flow configuration used for finding new sinks. + * The sources are the parameters of the API and the fields of the enclosing type. + * + * This can be used to generate Sink summaries for APIs, if the API propagates a parameter (or enclosing type field) + * into an existing known sink (then the API itself becomes a sink). + */ + module PropagateToSinkConfig implements DataFlow::ConfigSig { + predicate isSource(DataFlow::Node source) { + apiSource(source) and + getEnclosingCallable(source) instanceof DataFlowSinkTargetApi + } - /** - * Gets the summary model(s) of `api`, if there is flow from parameters to the - * return value or parameter or if `api` is a fluent API. - */ - string captureFlow(DataFlowSummaryTargetApi api) { - result = captureQualifierFlow(api) or - result = captureThroughFlow(api) - } + predicate isSink(DataFlow::Node sink) { + exists(string kind | isRelevantSinkKind(kind) and sinkNode(sink, kind)) + } - /** - * Gets the neutral summary model for `api`, if any. - * A neutral summary model is generated, if we are not generating - * a summary model that applies to `api`. - */ - string captureNoFlow(DataFlowSummaryTargetApi api) { - not exists(DataFlowSummaryTargetApi api0 | - exists(captureFlow(api0)) and api0.lift() = api.lift() - ) and - api.isRelevant() and - result = ModelPrinting::asNeutralSummaryModel(api) + predicate isBarrier(DataFlow::Node node) { + exists(Type t | t = node.(NodeExtended).getType() and not isRelevantType(t)) + or + sinkModelSanitizer(node) + } + + DataFlow::FlowFeature getAFeature() { + result instanceof DataFlow::FeatureHasSourceCallContext + } + + predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) { + isRelevantTaintStep(node1, node2) + } + } + + private module PropagateToSink = TaintTracking::Global; + + /** + * Gets the sink model(s) of `api`, if there is flow from a parameter to an existing known sink. + */ + string captureSink(DataFlowSinkTargetApi api) { + exists(NodeExtended src, NodeExtended sink, string kind | + PropagateToSink::flow(src, sink) and + sinkNode(sink, kind) and + api = getEnclosingCallable(src) and + result = ModelPrinting::asSinkModel(api, asInputArgument(src), kind) + ) + } } /** @@ -943,7 +1041,7 @@ module MakeModelGenerator< * 2. If content based flow does not yield any summary for an API, then we try and * generate flow summaries using the non-content based summary generator. */ - string captureMixedFlow(DataFlowSummaryTargetApi api, boolean lift) { + string captureFlow(DataFlowSummaryTargetApi api, boolean lift) { result = ContentSensitive::captureFlow(api, lift) or not exists(DataFlowSummaryTargetApi api0 | @@ -953,7 +1051,7 @@ module MakeModelGenerator< api0.lift() = api.lift() and exists(ContentSensitive::captureFlow(api0, true)) ) and - result = captureFlow(api) and + result = Heuristic::captureFlow(api) and lift = true } @@ -962,9 +1060,9 @@ module MakeModelGenerator< * A neutral summary model is generated, if we are not generating * a mixed summary model that applies to `api`. */ - string captureMixedNeutral(DataFlowSummaryTargetApi api) { + string captureNeutral(DataFlowSummaryTargetApi api) { not exists(DataFlowSummaryTargetApi api0, boolean lift | - exists(captureMixedFlow(api0, lift)) and + exists(captureFlow(api0, lift)) and ( lift = false and (api0 = api or api0 = api.lift()) @@ -973,96 +1071,6 @@ module MakeModelGenerator< ) ) and api.isRelevant() and - result = ModelPrinting::asNeutralSummaryModel(api) - } - - /** - * A data flow configuration used for finding new sources. - * The sources are the already known existing sources and the sinks are the API return nodes. - * - * This can be used to generate Source summaries for an API, if the API expose an already known source - * via its return (then the API itself becomes a source). - */ - module PropagateFromSourceConfig implements DataFlow::ConfigSig { - predicate isSource(DataFlow::Node source) { - exists(string kind | - isRelevantSourceKind(kind) and - sourceNode(source, kind) - ) - } - - predicate isSink(DataFlow::Node sink) { - sink instanceof ReturnNodeExt and - getEnclosingCallable(sink) instanceof DataFlowSourceTargetApi - } - - DataFlow::FlowFeature getAFeature() { result instanceof DataFlow::FeatureHasSinkCallContext } - - predicate isBarrier(DataFlow::Node n) { - exists(Type t | t = n.(NodeExtended).getType() and not isRelevantType(t)) - } - - predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) { - isRelevantTaintStep(node1, node2) - } - } - - private module PropagateFromSource = TaintTracking::Global; - - /** - * Gets the source model(s) of `api`, if there is flow from an existing known source to the return of `api`. - */ - string captureSource(DataFlowSourceTargetApi api) { - exists(NodeExtended source, ReturnNodeExt sink, string kind | - PropagateFromSource::flow(source, sink) and - sourceNode(source, kind) and - api = getEnclosingCallable(sink) and - not irrelevantSourceSinkApi(getEnclosingCallable(source), api) and - result = ModelPrinting::asSourceModel(api, getOutput(sink), kind) - ) - } - - /** - * A data flow configuration used for finding new sinks. - * The sources are the parameters of the API and the fields of the enclosing type. - * - * This can be used to generate Sink summaries for APIs, if the API propagates a parameter (or enclosing type field) - * into an existing known sink (then the API itself becomes a sink). - */ - module PropagateToSinkConfig implements DataFlow::ConfigSig { - predicate isSource(DataFlow::Node source) { - apiSource(source) and - getEnclosingCallable(source) instanceof DataFlowSinkTargetApi - } - - predicate isSink(DataFlow::Node sink) { - exists(string kind | isRelevantSinkKind(kind) and sinkNode(sink, kind)) - } - - predicate isBarrier(DataFlow::Node node) { - exists(Type t | t = node.(NodeExtended).getType() and not isRelevantType(t)) - or - sinkModelSanitizer(node) - } - - DataFlow::FlowFeature getAFeature() { result instanceof DataFlow::FeatureHasSourceCallContext } - - predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) { - isRelevantTaintStep(node1, node2) - } - } - - private module PropagateToSink = TaintTracking::Global; - - /** - * Gets the sink model(s) of `api`, if there is flow from a parameter to an existing known sink. - */ - string captureSink(DataFlowSinkTargetApi api) { - exists(NodeExtended src, NodeExtended sink, string kind | - PropagateToSink::flow(src, sink) and - sinkNode(sink, kind) and - api = getEnclosingCallable(src) and - result = ModelPrinting::asSinkModel(api, asInputArgument(src), kind) - ) + result = Heuristic::ModelPrinting::asNeutralSummaryModel(api) } } From 2a0097ea56354f9f141fdd1b51335e8b9eade1e9 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 13:39:52 +0200 Subject: [PATCH 216/240] C#/Java/Rust: Use Mixed flow from capture summary models queries and adjust other queries to the re-factored implementation. --- .../modelgenerator/CaptureMixedNeutralModels.ql | 13 ------------- .../modelgenerator/CaptureMixedSummaryModels.ql | 13 ------------- .../utils/modelgenerator/CaptureNeutralModels.ql | 2 +- .../src/utils/modelgenerator/CaptureSinkModels.ql | 2 +- .../src/utils/modelgenerator/CaptureSourceModels.ql | 2 +- .../utils/modelgenerator/CaptureSummaryModels.ql | 2 +- .../debug/CaptureSummaryModelsPartialPath.ql | 2 +- .../debug/CaptureSummaryModelsPath.ql | 1 + .../modelgenerator/CaptureMixedNeutralModels.ql | 13 ------------- .../modelgenerator/CaptureMixedSummaryModels.ql | 13 ------------- .../utils/modelgenerator/CaptureNeutralModels.ql | 2 +- .../src/utils/modelgenerator/CaptureSinkModels.ql | 2 +- .../src/utils/modelgenerator/CaptureSourceModels.ql | 2 +- .../utils/modelgenerator/CaptureSummaryModels.ql | 2 +- .../debug/CaptureSummaryModelsPartialPath.ql | 2 +- .../debug/CaptureSummaryModelsPath.ql | 1 + .../modelgenerator/CaptureMixedNeutralModels.ql | 13 ------------- .../modelgenerator/CaptureMixedSummaryModels.ql | 13 ------------- .../utils/modelgenerator/CaptureNeutralModels.ql | 2 +- .../src/utils/modelgenerator/CaptureSinkModels.ql | 2 +- .../src/utils/modelgenerator/CaptureSourceModels.ql | 2 +- .../utils/modelgenerator/CaptureSummaryModels.ql | 2 +- .../debug/CaptureSummaryModelsPartialPath.ql | 2 +- .../debug/CaptureSummaryModelsPath.ql | 1 + 24 files changed, 18 insertions(+), 93 deletions(-) delete mode 100644 csharp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql delete mode 100644 csharp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql delete mode 100644 java/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql delete mode 100644 java/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql delete mode 100644 rust/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql delete mode 100644 rust/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql diff --git a/csharp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql b/csharp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql deleted file mode 100644 index 6d7004fcc090..000000000000 --- a/csharp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @name Capture mixed neutral models. - * @description Finds neutral models to be used by other queries. - * @kind diagnostic - * @id cs/utils/modelgenerator/mixed-neutral-models - * @tags modelgenerator - */ - -import internal.CaptureModels - -from DataFlowSummaryTargetApi api, string noflow -where noflow = captureMixedNeutral(api) -select noflow order by noflow diff --git a/csharp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql b/csharp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql deleted file mode 100644 index 4a0bf7c9e227..000000000000 --- a/csharp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @name Capture mixed summary models. - * @description Finds applicable summary models to be used by other queries. - * @kind diagnostic - * @id cs/utils/modelgenerator/mixed-summary-models - * @tags modelgenerator - */ - -import internal.CaptureModels - -from DataFlowSummaryTargetApi api, string flow -where flow = captureMixedFlow(api, _) -select flow order by flow diff --git a/csharp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql b/csharp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql index 7a53125e21c1..2afb0ea02845 100644 --- a/csharp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql +++ b/csharp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSummaryTargetApi api, string noflow -where noflow = captureNoFlow(api) +where noflow = captureNeutral(api) select noflow order by noflow diff --git a/csharp/ql/src/utils/modelgenerator/CaptureSinkModels.ql b/csharp/ql/src/utils/modelgenerator/CaptureSinkModels.ql index 69701cd93720..f4c9405c96a7 100644 --- a/csharp/ql/src/utils/modelgenerator/CaptureSinkModels.ql +++ b/csharp/ql/src/utils/modelgenerator/CaptureSinkModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSinkTargetApi api, string sink -where sink = captureSink(api) +where sink = Heuristic::captureSink(api) select sink order by sink diff --git a/csharp/ql/src/utils/modelgenerator/CaptureSourceModels.ql b/csharp/ql/src/utils/modelgenerator/CaptureSourceModels.ql index 246551ce1457..70f853b35a95 100644 --- a/csharp/ql/src/utils/modelgenerator/CaptureSourceModels.ql +++ b/csharp/ql/src/utils/modelgenerator/CaptureSourceModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSourceTargetApi api, string source -where source = captureSource(api) +where source = Heuristic::captureSource(api) select source order by source diff --git a/csharp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql b/csharp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql index 991e593474e2..a0193397eb2e 100644 --- a/csharp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql +++ b/csharp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSummaryTargetApi api, string flow -where flow = captureFlow(api) +where flow = captureFlow(api, _) select flow order by flow diff --git a/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql b/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql index 62d3ad7f9f48..2aa2eafe69e1 100644 --- a/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql +++ b/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql @@ -14,7 +14,7 @@ import PartialFlow::PartialPathGraph int explorationLimit() { result = 3 } -module PartialFlow = PropagateFlow::FlowExplorationFwd; +module PartialFlow = Heuristic::PropagateFlow::FlowExplorationFwd; from PartialFlow::PartialPathNode source, PartialFlow::PartialPathNode sink, diff --git a/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql b/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql index 7be5a1fc00ec..d2df7382a514 100644 --- a/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql +++ b/csharp/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql @@ -10,6 +10,7 @@ import csharp import utils.modelgenerator.internal.CaptureModels +import Heuristic import PropagateFlow::PathGraph from diff --git a/java/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql b/java/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql deleted file mode 100644 index 6ad943137697..000000000000 --- a/java/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @name Capture mixed neutral models. - * @description Finds neutral models to be used by other queries. - * @kind diagnostic - * @id java/utils/modelgenerator/mixed-neutral-models - * @tags modelgenerator - */ - -import internal.CaptureModels - -from DataFlowSummaryTargetApi api, string noflow -where noflow = captureMixedNeutral(api) -select noflow order by noflow diff --git a/java/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql b/java/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql deleted file mode 100644 index b6f6fc9ff3aa..000000000000 --- a/java/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @name Capture mixed summary models. - * @description Finds applicable summary models to be used by other queries. - * @kind diagnostic - * @id java/utils/modelgenerator/mixed-summary-models - * @tags modelgenerator - */ - -import internal.CaptureModels - -from DataFlowSummaryTargetApi api, string flow -where flow = captureMixedFlow(api, _) -select flow order by flow diff --git a/java/ql/src/utils/modelgenerator/CaptureNeutralModels.ql b/java/ql/src/utils/modelgenerator/CaptureNeutralModels.ql index c91f182f6038..d17c11d4a7b0 100644 --- a/java/ql/src/utils/modelgenerator/CaptureNeutralModels.ql +++ b/java/ql/src/utils/modelgenerator/CaptureNeutralModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSummaryTargetApi api, string noflow -where noflow = captureNoFlow(api) +where noflow = captureNeutral(api) select noflow order by noflow diff --git a/java/ql/src/utils/modelgenerator/CaptureSinkModels.ql b/java/ql/src/utils/modelgenerator/CaptureSinkModels.ql index d7b3713c5b74..7c316a02b090 100644 --- a/java/ql/src/utils/modelgenerator/CaptureSinkModels.ql +++ b/java/ql/src/utils/modelgenerator/CaptureSinkModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSinkTargetApi api, string sink -where sink = captureSink(api) +where sink = Heuristic::captureSink(api) select sink order by sink diff --git a/java/ql/src/utils/modelgenerator/CaptureSourceModels.ql b/java/ql/src/utils/modelgenerator/CaptureSourceModels.ql index 960ed0b19ecd..4a955d4614b7 100644 --- a/java/ql/src/utils/modelgenerator/CaptureSourceModels.ql +++ b/java/ql/src/utils/modelgenerator/CaptureSourceModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSourceTargetApi api, string source -where source = captureSource(api) +where source = Heuristic::captureSource(api) select source order by source diff --git a/java/ql/src/utils/modelgenerator/CaptureSummaryModels.ql b/java/ql/src/utils/modelgenerator/CaptureSummaryModels.ql index 7fc7c0f7a571..34b6521e7b22 100644 --- a/java/ql/src/utils/modelgenerator/CaptureSummaryModels.ql +++ b/java/ql/src/utils/modelgenerator/CaptureSummaryModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSummaryTargetApi api, string flow -where flow = captureFlow(api) +where flow = captureFlow(api, _) select flow order by flow diff --git a/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql b/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql index 1d9724abef87..a9dd1d2384ea 100644 --- a/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql +++ b/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql @@ -15,7 +15,7 @@ import PartialFlow::PartialPathGraph int explorationLimit() { result = 3 } -module PartialFlow = PropagateFlow::FlowExplorationFwd; +module PartialFlow = Heuristic::PropagateFlow::FlowExplorationFwd; from PartialFlow::PartialPathNode source, PartialFlow::PartialPathNode sink, diff --git a/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql b/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql index 88d45dc1f5b0..36de195573ba 100644 --- a/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql +++ b/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql @@ -11,6 +11,7 @@ import java import semmle.code.java.dataflow.DataFlow import utils.modelgenerator.internal.CaptureModels +import Heuristic import PropagateFlow::PathGraph from diff --git a/rust/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql b/rust/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql deleted file mode 100644 index 7cd58a60335a..000000000000 --- a/rust/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @name Capture mixed neutral models. - * @description Finds neutral models to be used by other queries. - * @kind diagnostic - * @id rust/utils/modelgenerator/mixed-neutral-models - * @tags modelgenerator - */ - -import internal.CaptureModels - -from DataFlowSummaryTargetApi api, string noflow -where noflow = captureMixedNeutral(api) -select noflow order by noflow diff --git a/rust/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql b/rust/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql deleted file mode 100644 index 76d6a4022dba..000000000000 --- a/rust/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @name Capture mixed summary models. - * @description Finds applicable summary models to be used by other queries. - * @kind diagnostic - * @id rust/utils/modelgenerator/mixed-summary-models - * @tags modelgenerator - */ - -import internal.CaptureModels - -from DataFlowSummaryTargetApi api, string flow -where flow = captureMixedFlow(api, _) -select flow order by flow diff --git a/rust/ql/src/utils/modelgenerator/CaptureNeutralModels.ql b/rust/ql/src/utils/modelgenerator/CaptureNeutralModels.ql index fe23b4e382f3..8efc8a485e12 100644 --- a/rust/ql/src/utils/modelgenerator/CaptureNeutralModels.ql +++ b/rust/ql/src/utils/modelgenerator/CaptureNeutralModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSummaryTargetApi api, string noflow -where noflow = captureNoFlow(api) +where noflow = Heuristic::captureNoFlow(api) select noflow order by noflow diff --git a/rust/ql/src/utils/modelgenerator/CaptureSinkModels.ql b/rust/ql/src/utils/modelgenerator/CaptureSinkModels.ql index 615e87f8a6ff..36b1b8132977 100644 --- a/rust/ql/src/utils/modelgenerator/CaptureSinkModels.ql +++ b/rust/ql/src/utils/modelgenerator/CaptureSinkModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSinkTargetApi api, string sink -where sink = captureSink(api) +where sink = Heuristic::captureSink(api) select sink order by sink diff --git a/rust/ql/src/utils/modelgenerator/CaptureSourceModels.ql b/rust/ql/src/utils/modelgenerator/CaptureSourceModels.ql index 9c65bdcefae1..7086f719b2d8 100644 --- a/rust/ql/src/utils/modelgenerator/CaptureSourceModels.ql +++ b/rust/ql/src/utils/modelgenerator/CaptureSourceModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSourceTargetApi api, string source -where source = captureSource(api) +where source = Heuristic::captureSource(api) select source order by source diff --git a/rust/ql/src/utils/modelgenerator/CaptureSummaryModels.ql b/rust/ql/src/utils/modelgenerator/CaptureSummaryModels.ql index 19e29c36d9b5..8947dd015310 100644 --- a/rust/ql/src/utils/modelgenerator/CaptureSummaryModels.ql +++ b/rust/ql/src/utils/modelgenerator/CaptureSummaryModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSummaryTargetApi api, string flow -where flow = captureFlow(api) +where flow = captureFlow(api, _) select flow order by flow diff --git a/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql b/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql index b6b4016acad1..fc557c91207b 100644 --- a/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql +++ b/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql @@ -14,7 +14,7 @@ import PartialFlow::PartialPathGraph int explorationLimit() { result = 3 } -module PartialFlow = PropagateFlow::FlowExplorationFwd; +module PartialFlow = Heuristic::PropagateFlow::FlowExplorationFwd; from PartialFlow::PartialPathNode source, PartialFlow::PartialPathNode sink, diff --git a/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql b/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql index 17b2e357513a..38437d0346f8 100644 --- a/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql +++ b/rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql @@ -10,6 +10,7 @@ private import codeql.rust.dataflow.DataFlow import utils.modelgenerator.internal.CaptureModels +import Heuristic import PropagateFlow::PathGraph from From 7801fc321d8af2c6c0fe382daab5dd3af41738b2 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 14:12:35 +0200 Subject: [PATCH 217/240] C#: Re-factor tests to use the new implementations. --- .../test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql | 2 +- .../ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql | 2 +- .../test/utils/modelgenerator/dataflow/CaptureSourceModels.ql | 2 +- .../test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql index 719eca840f46..a5cdae532f4f 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql +++ b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = captureNoFlow(c) } + string getCapturedModel(Callable c) { result = Heuristic::captureNoFlow(c) } string getKind() { result = "neutral" } } diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql index ecd5a8e9e323..cc84ede4235e 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql +++ b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = captureSink(c) } + string getCapturedModel(Callable c) { result = Heuristic::captureSink(c) } string getKind() { result = "sink" } } diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql index f5f09b153f82..4c10362960a2 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql +++ b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = captureSource(c) } + string getCapturedModel(Callable c) { result = Heuristic::captureSource(c) } string getKind() { result = "source" } } diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql index 93c8520caa1b..e273eadfbe14 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql +++ b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = captureFlow(c) } + string getCapturedModel(Callable c) { result = Heuristic::captureFlow(c) } string getKind() { result = "summary" } } From da99c75a139e053d93151662c40e25b05edf55ab Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 14:17:43 +0200 Subject: [PATCH 218/240] C#: Rename some of the model generator tests. --- ...tralModels.expected => CaptureHeuristicNeutralModels.expected} | 0 ...eutralModels.ext.yml => CaptureHeuristicNeutralModels.ext.yml} | 0 .../{CaptureNeutralModels.ql => CaptureHeuristicNeutralModels.ql} | 0 ...maryModels.expected => CaptureHeuristicSummaryModels.expected} | 0 ...ummaryModels.ext.yml => CaptureHeuristicSummaryModels.ext.yml} | 0 .../{CaptureSummaryModels.ql => CaptureHeuristicSummaryModels.ql} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename csharp/ql/test/utils/modelgenerator/dataflow/{CaptureNeutralModels.expected => CaptureHeuristicNeutralModels.expected} (100%) rename csharp/ql/test/utils/modelgenerator/dataflow/{CaptureNeutralModels.ext.yml => CaptureHeuristicNeutralModels.ext.yml} (100%) rename csharp/ql/test/utils/modelgenerator/dataflow/{CaptureNeutralModels.ql => CaptureHeuristicNeutralModels.ql} (100%) rename csharp/ql/test/utils/modelgenerator/dataflow/{CaptureSummaryModels.expected => CaptureHeuristicSummaryModels.expected} (100%) rename csharp/ql/test/utils/modelgenerator/dataflow/{CaptureSummaryModels.ext.yml => CaptureHeuristicSummaryModels.ext.yml} (100%) rename csharp/ql/test/utils/modelgenerator/dataflow/{CaptureSummaryModels.ql => CaptureHeuristicSummaryModels.ql} (100%) diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.expected b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.expected similarity index 100% rename from csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.expected rename to csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.expected diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ext.yml b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.ext.yml similarity index 100% rename from csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ext.yml rename to csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.ext.yml diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.ql similarity index 100% rename from csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql rename to csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.ql diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.expected similarity index 100% rename from csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected rename to csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.expected diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ext.yml b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ext.yml similarity index 100% rename from csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ext.yml rename to csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ext.yml diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql similarity index 100% rename from csharp/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql rename to csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql From 539a06dcb47755392924e6f6ac7bd398a99ccd5c Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 14:51:08 +0200 Subject: [PATCH 219/240] C#: Re-factor the heuristic summary test to use heuristic-summary tag in tests. --- .../dataflow/CaptureHeuristicSummaryModels.ql | 2 +- .../modelgenerator/dataflow/Summaries.cs | 172 +++++++++--------- 2 files changed, 87 insertions(+), 87 deletions(-) diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql index e273eadfbe14..24cb66e427e7 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql +++ b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql @@ -5,7 +5,7 @@ import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { string getCapturedModel(Callable c) { result = Heuristic::captureFlow(c) } - string getKind() { result = "summary" } + string getKind() { result = "heuristic-summary" } } import InlineMadTest diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs b/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs index 7a6f16f383e5..98d8b3e3bb81 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs +++ b/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs @@ -12,29 +12,29 @@ public class BasicFlow private string tainted; - // summary=Models;BasicFlow;false;ReturnThis;(System.Object);;Argument[this];ReturnValue;value;df-generated + // heuristic-summary=Models;BasicFlow;false;ReturnThis;(System.Object);;Argument[this];ReturnValue;value;df-generated // contentbased-summary=Models;BasicFlow;false;ReturnThis;(System.Object);;Argument[this];ReturnValue;value;dfc-generated public BasicFlow ReturnThis(object input) { return this; } - // summary=Models;BasicFlow;false;ReturnParam0;(System.String,System.Object);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;BasicFlow;false;ReturnParam0;(System.String,System.Object);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;BasicFlow;false;ReturnParam0;(System.String,System.Object);;Argument[0];ReturnValue;value;dfc-generated public string ReturnParam0(string input0, object input1) { return input0; } - // summary=Models;BasicFlow;false;ReturnParam1;(System.String,System.Object);;Argument[1];ReturnValue;taint;df-generated + // heuristic-summary=Models;BasicFlow;false;ReturnParam1;(System.String,System.Object);;Argument[1];ReturnValue;taint;df-generated // contentbased-summary=Models;BasicFlow;false;ReturnParam1;(System.String,System.Object);;Argument[1];ReturnValue;value;dfc-generated public object ReturnParam1(string input0, object input1) { return input1; } - // summary=Models;BasicFlow;false;ReturnParamMultiple;(System.Object,System.Object);;Argument[0];ReturnValue;taint;df-generated - // summary=Models;BasicFlow;false;ReturnParamMultiple;(System.Object,System.Object);;Argument[1];ReturnValue;taint;df-generated + // heuristic-summary=Models;BasicFlow;false;ReturnParamMultiple;(System.Object,System.Object);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;BasicFlow;false;ReturnParamMultiple;(System.Object,System.Object);;Argument[1];ReturnValue;taint;df-generated // contentbased-summary=Models;BasicFlow;false;ReturnParamMultiple;(System.Object,System.Object);;Argument[0];ReturnValue;value;dfc-generated // contentbased-summary=Models;BasicFlow;false;ReturnParamMultiple;(System.Object,System.Object);;Argument[1];ReturnValue;value;dfc-generated public object ReturnParamMultiple(object input0, object input1) @@ -42,21 +42,21 @@ public object ReturnParamMultiple(object input0, object input1) return (System.DateTime.Now.DayOfWeek == System.DayOfWeek.Monday) ? input0 : input1; } - // summary=Models;BasicFlow;false;ReturnSubstring;(System.String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;BasicFlow;false;ReturnSubstring;(System.String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;BasicFlow;false;ReturnSubstring;(System.String);;Argument[0];ReturnValue;taint;dfc-generated public string ReturnSubstring(string s) { return s.Substring(0, 1); } - // summary=Models;BasicFlow;false;SetField;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;BasicFlow;false;SetField;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;BasicFlow;false;SetField;(System.String);;Argument[0];Argument[this].SyntheticField[Models.BasicFlow.tainted];value;dfc-generated public void SetField(string s) { tainted = s; } - // summary=Models;BasicFlow;false;ReturnField;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;BasicFlow;false;ReturnField;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;BasicFlow;false;ReturnField;();;Argument[this].SyntheticField[Models.BasicFlow.tainted];ReturnValue;value;dfc-generated public string ReturnField() { @@ -64,8 +64,8 @@ public string ReturnField() } public Func MyFunction; - // summary=Models;BasicFlow;false;ApplyMyFunction;(System.Object);;Argument[0];Argument[this];taint;df-generated - // summary=Models;BasicFlow;false;ApplyMyFunction;(System.Object);;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;BasicFlow;false;ApplyMyFunction;(System.Object);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;BasicFlow;false;ApplyMyFunction;(System.Object);;Argument[this];ReturnValue;taint;df-generated // No content based flow as MaD doesn't support callback logic in fields and properties. public object ApplyMyFunction(object o) { @@ -77,91 +77,91 @@ public class CollectionFlow { private readonly string tainted; - // summary=Models;CollectionFlow;false;CollectionFlow;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;CollectionFlow;false;CollectionFlow;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;CollectionFlow;false;CollectionFlow;(System.String);;Argument[0];Argument[this].SyntheticField[Models.CollectionFlow.tainted];value;dfc-generated public CollectionFlow(string s) { tainted = s; } - // summary=Models;CollectionFlow;false;ReturnArrayElement;(System.Object[]);;Argument[0].Element;ReturnValue;taint;df-generated + // heuristic-summary=Models;CollectionFlow;false;ReturnArrayElement;(System.Object[]);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;ReturnArrayElement;(System.Object[]);;Argument[0].Element;ReturnValue;value;dfc-generated public object ReturnArrayElement(object[] input) { return input[0]; } - // summary=Models;CollectionFlow;false;AssignToArray;(System.Object,System.Object[]);;Argument[0];Argument[1].Element;taint;df-generated + // heuristic-summary=Models;CollectionFlow;false;AssignToArray;(System.Object,System.Object[]);;Argument[0];Argument[1].Element;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;AssignToArray;(System.Object,System.Object[]);;Argument[0];Argument[1].Element;value;dfc-generated public void AssignToArray(object data, object[] target) { target[0] = data; } - // summary=Models;CollectionFlow;false;AssignFieldToArray;(System.Object[]);;Argument[this];Argument[0].Element;taint;df-generated + // heuristic-summary=Models;CollectionFlow;false;AssignFieldToArray;(System.Object[]);;Argument[this];Argument[0].Element;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;AssignFieldToArray;(System.Object[]);;Argument[this].SyntheticField[Models.CollectionFlow.tainted];Argument[0].Element;value;dfc-generated public void AssignFieldToArray(object[] target) { target[0] = tainted; } - // summary=Models;CollectionFlow;false;ReturnListElement;(System.Collections.Generic.List);;Argument[0].Element;ReturnValue;taint;df-generated + // heuristic-summary=Models;CollectionFlow;false;ReturnListElement;(System.Collections.Generic.List);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;ReturnListElement;(System.Collections.Generic.List);;Argument[0].Element;ReturnValue;value;dfc-generated public object ReturnListElement(List input) { return input[0]; } - // summary=Models;CollectionFlow;false;AddToList;(System.Collections.Generic.List,System.Object);;Argument[1];Argument[0].Element;taint;df-generated + // heuristic-summary=Models;CollectionFlow;false;AddToList;(System.Collections.Generic.List,System.Object);;Argument[1];Argument[0].Element;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;AddToList;(System.Collections.Generic.List,System.Object);;Argument[1];Argument[0].Element;value;dfc-generated public void AddToList(List input, object data) { input.Add(data); } - // summary=Models;CollectionFlow;false;AddFieldToList;(System.Collections.Generic.List);;Argument[this];Argument[0].Element;taint;df-generated + // heuristic-summary=Models;CollectionFlow;false;AddFieldToList;(System.Collections.Generic.List);;Argument[this];Argument[0].Element;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;AddFieldToList;(System.Collections.Generic.List);;Argument[this].SyntheticField[Models.CollectionFlow.tainted];Argument[0].Element;value;dfc-generated public void AddFieldToList(List input) { input.Add(tainted); } - // summary=Models;CollectionFlow;false;ReturnFieldInAList;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;CollectionFlow;false;ReturnFieldInAList;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;ReturnFieldInAList;();;Argument[this].SyntheticField[Models.CollectionFlow.tainted];ReturnValue.Element;value;dfc-generated public List ReturnFieldInAList() { return new List { tainted }; } - // SPURIOUS-summary=Models;CollectionFlow;false;ReturnComplexTypeArray;(System.String[]);;Argument[0].Element;ReturnValue;taint;df-generated + // SPURIOUS-heuristic-summary=Models;CollectionFlow;false;ReturnComplexTypeArray;(System.String[]);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;ReturnComplexTypeArray;(System.String[]);;Argument[0];ReturnValue;value;dfc-generated public string[] ReturnComplexTypeArray(string[] a) { return a; } - // SPURIOUS-summary=Models;CollectionFlow;false;ReturnBulkTypeList;(System.Collections.Generic.List);;Argument[0].Element;ReturnValue;taint;df-generated + // SPURIOUS-heuristic-summary=Models;CollectionFlow;false;ReturnBulkTypeList;(System.Collections.Generic.List);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;ReturnBulkTypeList;(System.Collections.Generic.List);;Argument[0];ReturnValue;value;dfc-generated public List ReturnBulkTypeList(List a) { return a; } - // SPURIOUS-summary=Models;CollectionFlow;false;ReturnComplexTypeDictionary;(System.Collections.Generic.Dictionary);;Argument[0].Element;ReturnValue;taint;df-generated + // SPURIOUS-heuristic-summary=Models;CollectionFlow;false;ReturnComplexTypeDictionary;(System.Collections.Generic.Dictionary);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;ReturnComplexTypeDictionary;(System.Collections.Generic.Dictionary);;Argument[0];ReturnValue;value;dfc-generated public Dictionary ReturnComplexTypeDictionary(Dictionary a) { return a; } - // SPURIOUS-summary=Models;CollectionFlow;false;ReturnUntypedArray;(System.Array);;Argument[0].Element;ReturnValue;taint;df-generated + // SPURIOUS-heuristic-summary=Models;CollectionFlow;false;ReturnUntypedArray;(System.Array);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;ReturnUntypedArray;(System.Array);;Argument[0];ReturnValue;value;dfc-generated public Array ReturnUntypedArray(Array a) { return a; } - // SPURIOUS-summary=Models;CollectionFlow;false;ReturnUntypedList;(System.Collections.IList);;Argument[0].Element;ReturnValue;taint;df-generated + // SPURIOUS-heuristic-summary=Models;CollectionFlow;false;ReturnUntypedList;(System.Collections.IList);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;CollectionFlow;false;ReturnUntypedList;(System.Collections.IList);;Argument[0];ReturnValue;value;dfc-generated public IList ReturnUntypedList(IList a) { @@ -195,28 +195,28 @@ public class IEnumerableFlow { private readonly string tainted; - // summary=Models;IEnumerableFlow;false;IEnumerableFlow;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;IEnumerableFlow;false;IEnumerableFlow;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;IEnumerableFlow;false;IEnumerableFlow;(System.String);;Argument[0];Argument[this].SyntheticField[Models.IEnumerableFlow.tainted];value;dfc-generated public IEnumerableFlow(string s) { tainted = s; } - // SPURIOUS-summary=Models;IEnumerableFlow;false;ReturnIEnumerable;(System.Collections.Generic.IEnumerable);;Argument[0].Element;ReturnValue;taint;df-generated + // SPURIOUS-heuristic-summary=Models;IEnumerableFlow;false;ReturnIEnumerable;(System.Collections.Generic.IEnumerable);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;IEnumerableFlow;false;ReturnIEnumerable;(System.Collections.Generic.IEnumerable);;Argument[0];ReturnValue;value;dfc-generated public IEnumerable ReturnIEnumerable(IEnumerable input) { return input; } - // summary=Models;IEnumerableFlow;false;ReturnIEnumerableElement;(System.Collections.Generic.IEnumerable);;Argument[0].Element;ReturnValue;taint;df-generated + // heuristic-summary=Models;IEnumerableFlow;false;ReturnIEnumerableElement;(System.Collections.Generic.IEnumerable);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;IEnumerableFlow;false;ReturnIEnumerableElement;(System.Collections.Generic.IEnumerable);;Argument[0].Element;ReturnValue;value;dfc-generated public object ReturnIEnumerableElement(IEnumerable input) { return input.First(); } - // summary=Models;IEnumerableFlow;false;ReturnFieldInIEnumerable;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;IEnumerableFlow;false;ReturnFieldInIEnumerable;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;IEnumerableFlow;false;ReturnFieldInIEnumerable;();;Argument[this].SyntheticField[Models.IEnumerableFlow.tainted];ReturnValue.Element;value;dfc-generated public IEnumerable ReturnFieldInIEnumerable() { @@ -228,49 +228,49 @@ public class GenericFlow { private T tainted; - // summary=Models;GenericFlow;false;SetGenericField;(T);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;GenericFlow;false;SetGenericField;(T);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;GenericFlow;false;SetGenericField;(T);;Argument[0];Argument[this].SyntheticField[Models.GenericFlow`1.tainted];value;dfc-generated public void SetGenericField(T t) { tainted = t; } - // summary=Models;GenericFlow;false;ReturnGenericField;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;GenericFlow;false;ReturnGenericField;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;GenericFlow;false;ReturnGenericField;();;Argument[this].SyntheticField[Models.GenericFlow`1.tainted];ReturnValue;value;dfc-generated public T ReturnGenericField() { return tainted; } - // summary=Models;GenericFlow;false;AddFieldToGenericList;(System.Collections.Generic.List);;Argument[this];Argument[0].Element;taint;df-generated + // heuristic-summary=Models;GenericFlow;false;AddFieldToGenericList;(System.Collections.Generic.List);;Argument[this];Argument[0].Element;taint;df-generated // contentbased-summary=Models;GenericFlow;false;AddFieldToGenericList;(System.Collections.Generic.List);;Argument[this].SyntheticField[Models.GenericFlow`1.tainted];Argument[0].Element;value;dfc-generated public void AddFieldToGenericList(List input) { input.Add(tainted); } - // summary=Models;GenericFlow;false;ReturnFieldInGenericList;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;GenericFlow;false;ReturnFieldInGenericList;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;GenericFlow;false;ReturnFieldInGenericList;();;Argument[this].SyntheticField[Models.GenericFlow`1.tainted];ReturnValue.Element;value;dfc-generated public List ReturnFieldInGenericList() { return new List { tainted }; } - // summary=Models;GenericFlow;false;ReturnGenericParam;(S);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;GenericFlow;false;ReturnGenericParam;(S);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;GenericFlow;false;ReturnGenericParam;(S);;Argument[0];ReturnValue;value;dfc-generated public S ReturnGenericParam(S input) { return input; } - // summary=Models;GenericFlow;false;ReturnGenericElement;(System.Collections.Generic.List);;Argument[0].Element;ReturnValue;taint;df-generated + // heuristic-summary=Models;GenericFlow;false;ReturnGenericElement;(System.Collections.Generic.List);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;GenericFlow;false;ReturnGenericElement;(System.Collections.Generic.List);;Argument[0].Element;ReturnValue;value;dfc-generated public S ReturnGenericElement(List input) { return input[0]; } - // summary=Models;GenericFlow;false;AddToGenericList;(System.Collections.Generic.List,S);;Argument[1];Argument[0].Element;taint;df-generated + // heuristic-summary=Models;GenericFlow;false;AddToGenericList;(System.Collections.Generic.List,S);;Argument[1];Argument[0].Element;taint;df-generated // contentbased-summary=Models;GenericFlow;false;AddToGenericList;(System.Collections.Generic.List,S);;Argument[1];Argument[0].Element;value;dfc-generated public void AddToGenericList(List input, S data) { @@ -280,7 +280,7 @@ public void AddToGenericList(List input, S data) public abstract class BaseClassFlow { - // summary=Models;BaseClassFlow;true;ReturnParam;(System.Object);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;BaseClassFlow;true;ReturnParam;(System.Object);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;BaseClassFlow;true;ReturnParam;(System.Object);;Argument[0];ReturnValue;value;dfc-generated public virtual object ReturnParam(object input) { @@ -290,7 +290,7 @@ public virtual object ReturnParam(object input) public class DerivedClass1Flow : BaseClassFlow { - // summary=Models;DerivedClass1Flow;false;ReturnParam1;(System.String,System.String);;Argument[1];ReturnValue;taint;df-generated + // heuristic-summary=Models;DerivedClass1Flow;false;ReturnParam1;(System.String,System.String);;Argument[1];ReturnValue;taint;df-generated // contentbased-summary=Models;DerivedClass1Flow;false;ReturnParam1;(System.String,System.String);;Argument[1];ReturnValue;value;dfc-generated public string ReturnParam1(string input0, string input1) { @@ -300,14 +300,14 @@ public string ReturnParam1(string input0, string input1) public class DerivedClass2Flow : BaseClassFlow { - // summary=Models;BaseClassFlow;true;ReturnParam;(System.Object);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;BaseClassFlow;true;ReturnParam;(System.Object);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;BaseClassFlow;true;ReturnParam;(System.Object);;Argument[0];ReturnValue;value;dfc-generated public override object ReturnParam(object input) { return input; } - // summary=Models;DerivedClass2Flow;false;ReturnParam0;(System.String,System.Int32);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;DerivedClass2Flow;false;ReturnParam0;(System.String,System.Int32);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;DerivedClass2Flow;false;ReturnParam0;(System.String,System.Int32);;Argument[0];ReturnValue;value;dfc-generated public string ReturnParam0(string input0, int input1) { @@ -319,7 +319,7 @@ public class OperatorFlow { public readonly object Field; - // summary=Models;OperatorFlow;false;OperatorFlow;(System.Object);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;OperatorFlow;false;OperatorFlow;(System.Object);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;OperatorFlow;false;OperatorFlow;(System.Object);;Argument[0];Argument[this].Field[Models.OperatorFlow.Field];value;dfc-generated public OperatorFlow(object o) { @@ -327,7 +327,7 @@ public OperatorFlow(object o) } // Flow Summary. - // summary=Models;OperatorFlow;false;op_Addition;(Models.OperatorFlow,Models.OperatorFlow);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;OperatorFlow;false;op_Addition;(Models.OperatorFlow,Models.OperatorFlow);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;OperatorFlow;false;op_Addition;(Models.OperatorFlow,Models.OperatorFlow);;Argument[0];ReturnValue;value;dfc-generated public static OperatorFlow operator +(OperatorFlow a, OperatorFlow b) { @@ -368,7 +368,7 @@ public override bool Equals(object obj) return boolTainted; } - // summary=Models;EqualsGetHashCodeNoFlow;false;Equals;(System.String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;EqualsGetHashCodeNoFlow;false;Equals;(System.String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;EqualsGetHashCodeNoFlow;false;Equals;(System.String);;Argument[0];ReturnValue;value;dfc-generated public string Equals(string s) { @@ -386,14 +386,14 @@ public class Properties { private string tainted; - // summary=Models;Properties;false;get_Prop1;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;Properties;false;get_Prop1;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;Properties;false;get_Prop1;();;Argument[this].SyntheticField[Models.Properties.tainted];ReturnValue;value;dfc-generated public string Prop1 { get { return tainted; } } - // summary=Models;Properties;false;set_Prop2;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;Properties;false;set_Prop2;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;Properties;false;set_Prop2;(System.String);;Argument[0];Argument[this].SyntheticField[Models.Properties.tainted];value;dfc-generated public string Prop2 { @@ -611,7 +611,7 @@ public abstract class BasePublic public class AImplBasePublic : BasePublic { - // summary=Models;Inheritance+BasePublic;true;Id;(System.String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;Inheritance+BasePublic;true;Id;(System.String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;Inheritance+BasePublic;true;Id;(System.String);;Argument[0];ReturnValue;value;dfc-generated public override string Id(string x) { @@ -641,7 +641,7 @@ private abstract class C : IPublic2 public class BImpl : B { - // summary=Models;Inheritance+IPublic1;true;Id;(System.String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;Inheritance+IPublic1;true;Id;(System.String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;Inheritance+IPublic1;true;Id;(System.String);;Argument[0];ReturnValue;value;dfc-generated public override string Id(string x) { @@ -651,7 +651,7 @@ public override string Id(string x) private class CImpl : C { - // summary=Models;Inheritance+IPublic2;true;Id;(System.String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;Inheritance+IPublic2;true;Id;(System.String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;Inheritance+IPublic2;true;Id;(System.String);;Argument[0];ReturnValue;value;dfc-generated public override string Id(string x) { @@ -673,14 +673,14 @@ public class DImpl : D { private readonly string tainted; - // summary=Models;Inheritance+DImpl;false;DImpl;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;Inheritance+DImpl;false;DImpl;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;Inheritance+DImpl;false;DImpl;(System.String);;Argument[0];Argument[this].SyntheticField[Models.Inheritance+DImpl.tainted];value;dfc-generated public DImpl(string s) { tainted = s; } - // summary=Models;Inheritance+IPublic3;true;get_Prop;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;Inheritance+IPublic3;true;get_Prop;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;Inheritance+DImpl;true;get_Prop;();;Argument[this].SyntheticField[Models.Inheritance+DImpl.tainted];ReturnValue;value;dfc-generated public override string Prop { get { return tainted; } } } @@ -696,13 +696,13 @@ private class Content1 : BaseContent { private object field; - // summary=Models;Inheritance+BaseContent;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;Inheritance+BaseContent;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated public override object GetValue() { return field; } - // summary=Models;Inheritance+BaseContent;true;SetValue;(System.Object);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;Inheritance+BaseContent;true;SetValue;(System.Object);;Argument[0];Argument[this];taint;df-generated public override void SetValue(object o) { field = o; @@ -719,14 +719,14 @@ public class C public string Field; } - // summary=Models;MemberFlow;false;M1;(Models.MemberFlow+C);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;MemberFlow;false;M1;(Models.MemberFlow+C);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;MemberFlow;false;M1;(Models.MemberFlow+C);;Argument[0].Property[Models.MemberFlow+C.Prop];ReturnValue;value;dfc-generated public string M1(C c) { return c.Prop; } - // summary=Models;MemberFlow;false;M2;(Models.MemberFlow+C);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;MemberFlow;false;M2;(Models.MemberFlow+C);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;MemberFlow;false;M2;(Models.MemberFlow+C);;Argument[0].Field[Models.MemberFlow+C.Field];ReturnValue;value;dfc-generated public string M2(C c) { @@ -736,7 +736,7 @@ public string M2(C c) public class IDictionaryFlow { - // summary=Models;IDictionaryFlow;false;ReturnIDictionaryValue;(System.Collections.Generic.IDictionary,System.Object);;Argument[0].Element;ReturnValue;taint;df-generated + // heuristic-summary=Models;IDictionaryFlow;false;ReturnIDictionaryValue;(System.Collections.Generic.IDictionary,System.Object);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=Models;IDictionaryFlow;false;ReturnIDictionaryValue;(System.Collections.Generic.IDictionary,System.Object);;Argument[0].Element.Property[System.Collections.Generic.KeyValuePair`2.Value];ReturnValue;value;dfc-generated public object ReturnIDictionaryValue(IDictionary input, object key) { @@ -749,21 +749,21 @@ public class NestedFieldFlow public NestedFieldFlow FieldA; public NestedFieldFlow FieldB; - // summary=Models;NestedFieldFlow;false;Move;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;NestedFieldFlow;false;Move;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;NestedFieldFlow;false;Move;();;Argument[this].Field[Models.NestedFieldFlow.FieldA];ReturnValue.Field[Models.NestedFieldFlow.FieldB];value;dfc-generated public NestedFieldFlow Move() { return new NestedFieldFlow() { FieldB = this.FieldA }; } - // summary=Models;NestedFieldFlow;false;MoveNested;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;NestedFieldFlow;false;MoveNested;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;NestedFieldFlow;false;MoveNested;();;Argument[this].Field[Models.NestedFieldFlow.FieldB].Field[Models.NestedFieldFlow.FieldA];ReturnValue.Field[Models.NestedFieldFlow.FieldA].Field[Models.NestedFieldFlow.FieldB];value;dfc-generated public NestedFieldFlow MoveNested() { return new NestedFieldFlow() { FieldA = FieldB.Move() }; } - // summary=Models;NestedFieldFlow;false;ReverseFields;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;NestedFieldFlow;false;ReverseFields;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;NestedFieldFlow;false;ReverseFields;();;Argument[this].Field[Models.NestedFieldFlow.FieldA].Field[Models.NestedFieldFlow.FieldB];ReturnValue.Field[Models.NestedFieldFlow.FieldA].Field[Models.NestedFieldFlow.FieldB];value;dfc-generated public NestedFieldFlow ReverseFields() { @@ -784,42 +784,42 @@ public class SyntheticFields private string brokenChainBegin; private string brokenChainEnd; - // summary=Models;SyntheticFields;false;SyntheticFields;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;SyntheticFields;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;SyntheticFields;false;SyntheticFields;(System.String);;Argument[0];Argument[this].SyntheticField[Models.SyntheticFields.value1];value;dfc-generated public SyntheticFields(string v1) { value1 = v1; } - // summary=Models;SyntheticFields;false;GetValue1;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;GetValue1;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;SyntheticFields;false;GetValue1;();;Argument[this].SyntheticField[Models.SyntheticFields.value1];ReturnValue;value;dfc-generated public string GetValue1() { return value1; } - // summary=Models;SyntheticFields;false;GetValue2;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;GetValue2;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;SyntheticFields;false;GetValue2;();;Argument[this].SyntheticField[Models.SyntheticFields.value2];ReturnValue;value;dfc-generated public string GetValue2() { return value2; } - // summary=Models;SyntheticFields;false;SetValue2;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;SetValue2;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;SyntheticFields;false;SetValue2;(System.String);;Argument[0];Argument[this].SyntheticField[Models.SyntheticFields.value2];value;dfc-generated public void SetValue2(string v2) { value2 = v2; } - // summary=Models;SyntheticFields;false;SetValue3;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;SetValue3;(System.String);;Argument[0];Argument[this];taint;df-generated // No content based summary as value3 is a dead synthetic field. public void SetValue3(string v3) { value3 = v3; } - // summary=Models;SyntheticFields;false;SetChainBegin;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;SetChainBegin;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;SyntheticFields;false;SetChainBegin;(System.String);;Argument[0];Argument[this].SyntheticField[Models.SyntheticFields.chainBegin];value;dfc-generated public void SetChainBegin(string v) { @@ -833,21 +833,21 @@ public void CopyChainValue() chainEnd = chainBegin; } - // summary=Models;SyntheticFields;false;GetChainEnd;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;GetChainEnd;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;SyntheticFields;false;GetChainEnd;();;Argument[this].SyntheticField[Models.SyntheticFields.chainEnd];ReturnValue;value;dfc-generated public string GetChainEnd() { return chainEnd; } - // summary=Models;SyntheticFields;false;SetBrokenChainBegin;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;SetBrokenChainBegin;(System.String);;Argument[0];Argument[this];taint;df-generated // No content based summary as brokenChainBegin is a dead synthetic field. public void SetBrokenChainBegin(string v) { brokenChainBegin = v; } - // summary=Models;SyntheticFields;false;GetBrokenChainEnd;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;GetBrokenChainEnd;();;Argument[this];ReturnValue;taint;df-generated // No content based summary as brokenChainEnd is a dead synthetic field. public string GetBrokenChainEnd() { @@ -858,14 +858,14 @@ public class InnerSyntheticFields { private readonly string value; - // summary=Models;SyntheticFields+InnerSyntheticFields;false;InnerSyntheticFields;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;SyntheticFields+InnerSyntheticFields;false;InnerSyntheticFields;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;SyntheticFields+InnerSyntheticFields;false;InnerSyntheticFields;(System.String);;Argument[0];Argument[this].SyntheticField[Models.SyntheticFields+InnerSyntheticFields.value];value;dfc-generated public InnerSyntheticFields(string v) { value = v; } - // summary=Models;SyntheticFields+InnerSyntheticFields;false;GetValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;SyntheticFields+InnerSyntheticFields;false;GetValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;SyntheticFields+InnerSyntheticFields;false;GetValue;();;Argument[this].SyntheticField[Models.SyntheticFields+InnerSyntheticFields.value];ReturnValue;value;dfc-generated public string GetValue() { @@ -873,7 +873,7 @@ public string GetValue() } } - // summary=Models;SyntheticFields;false;MakeInner;(System.String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;SyntheticFields;false;MakeInner;(System.String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=Models;SyntheticFields;false;MakeInner;(System.String);;Argument[0];ReturnValue.SyntheticField[Models.SyntheticFields+InnerSyntheticFields.value];value;dfc-generated public InnerSyntheticFields MakeInner(string v) { @@ -887,21 +887,21 @@ public class SyntheticProperties private string Prop2 { get; set; } - // summary=Models;SyntheticProperties;false;SyntheticProperties;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;SyntheticProperties;false;SyntheticProperties;(System.String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=Models;SyntheticProperties;false;SyntheticProperties;(System.String);;Argument[0];Argument[this].SyntheticField[Models.SyntheticProperties.Prop1];value;dfc-generated public SyntheticProperties(string v1) { Prop1 = v1; } - // summary=Models;SyntheticProperties;false;GetProp1;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;SyntheticProperties;false;GetProp1;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;SyntheticProperties;false;GetProp1;();;Argument[this].SyntheticField[Models.SyntheticProperties.Prop1];ReturnValue;value;dfc-generated public string GetProp1() { return Prop1; } - // summary=Models;SyntheticProperties;false;SetProp2;(System.String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=Models;SyntheticProperties;false;SetProp2;(System.String);;Argument[0];Argument[this];taint;df-generated // No content based summary as Prop2 is a dead synthetic field. public void SetProp2(string v) { @@ -913,14 +913,14 @@ public class SyntheticCollections { private object[] array; - // summary=Models;SyntheticCollections;false;SyntheticCollections;(System.Object[]);;Argument[0].Element;Argument[this];taint;df-generated + // heuristic-summary=Models;SyntheticCollections;false;SyntheticCollections;(System.Object[]);;Argument[0].Element;Argument[this];taint;df-generated // contentbased-summary=Models;SyntheticCollections;false;SyntheticCollections;(System.Object[]);;Argument[0];Argument[this].SyntheticField[Models.SyntheticCollections.array];value;dfc-generated public SyntheticCollections(object[] array) { this.array = array; } - // summary=Models;SyntheticCollections;false;GetElement;(System.Int32);;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;SyntheticCollections;false;GetElement;(System.Int32);;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;SyntheticCollections;false;GetElement;(System.Int32);;Argument[this].SyntheticField[Models.SyntheticCollections.array].Element;ReturnValue;value;dfc-generated public object GetElement(int index) { @@ -942,7 +942,7 @@ public class Impl1 : Base1 { public string Prop { get; set; } - // summary=Models;Fanout+Base1;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;Fanout+Base1;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;Fanout+Impl1;true;GetValue;();;Argument[this].Property[Models.Fanout+Impl1.Prop];ReturnValue;value;dfc-generated public override string GetValue() { @@ -954,7 +954,7 @@ public class Impl2 : Base2 { public string Prop { get; set; } - // summary=Models;Fanout+Base1;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;Fanout+Base1;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;Fanout+Impl2;true;GetValue;();;Argument[this].Property[Models.Fanout+Impl2.Prop];ReturnValue;value;dfc-generated public override string GetValue() { @@ -966,7 +966,7 @@ public class Impl3 : Base2 { public string Prop { get; set; } - // summary=Models;Fanout+Base1;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;Fanout+Base1;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;Fanout+Impl3;true;GetValue;();;Argument[this].Property[Models.Fanout+Impl3.Prop];ReturnValue;value;dfc-generated public override string GetValue() { @@ -978,7 +978,7 @@ public class Impl4 : Base2 { public string Prop { get; set; } - // summary=Models;Fanout+Base1;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;Fanout+Base1;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=Models;Fanout+Impl4;true;GetValue;();;Argument[this].Property[Models.Fanout+Impl4.Prop];ReturnValue;value;dfc-generated public override string GetValue() { @@ -986,8 +986,8 @@ public override string GetValue() } } - // summary=Models;Fanout;false;ConcatValueOnBase1;(System.String,Models.Fanout+Base1);;Argument[0];ReturnValue;taint;df-generated - // summary=Models;Fanout;false;ConcatValueOnBase1;(System.String,Models.Fanout+Base1);;Argument[1];ReturnValue;taint;df-generated + // heuristic-summary=Models;Fanout;false;ConcatValueOnBase1;(System.String,Models.Fanout+Base1);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;Fanout;false;ConcatValueOnBase1;(System.String,Models.Fanout+Base1);;Argument[1];ReturnValue;taint;df-generated // No content based summaries are expected for this method on parameter `b1` // as the fanout (number of content flows) exceeds the limit of 3. // contentbased-summary=Models;Fanout;false;ConcatValueOnBase1;(System.String,Models.Fanout+Base1);;Argument[0];ReturnValue;taint;dfc-generated @@ -996,8 +996,8 @@ public string ConcatValueOnBase1(string other, Base1 b1) return other + b1.GetValue(); } - // summary=Models;Fanout;false;ConcatValueOnBase2;(System.String,Models.Fanout+Base2);;Argument[0];ReturnValue;taint;df-generated - // summary=Models;Fanout;false;ConcatValueOnBase2;(System.String,Models.Fanout+Base2);;Argument[1];ReturnValue;taint;df-generated + // heuristic-summary=Models;Fanout;false;ConcatValueOnBase2;(System.String,Models.Fanout+Base2);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;Fanout;false;ConcatValueOnBase2;(System.String,Models.Fanout+Base2);;Argument[1];ReturnValue;taint;df-generated // contentbased-summary=Models;Fanout;false;ConcatValueOnBase2;(System.String,Models.Fanout+Base2);;Argument[0];ReturnValue;taint;dfc-generated // contentbased-summary=Models;Fanout;false;ConcatValueOnBase2;(System.String,Models.Fanout+Base2);;Argument[1].Property[Models.Fanout+Impl2.Prop];ReturnValue;taint;dfc-generated // contentbased-summary=Models;Fanout;false;ConcatValueOnBase2;(System.String,Models.Fanout+Base2);;Argument[1].Property[Models.Fanout+Impl3.Prop];ReturnValue;taint;dfc-generated @@ -1015,7 +1015,7 @@ public class A public object Prop { get; set; } // contentbased-summary=Models;AvoidDuplicateLifted+A;true;GetValue;();;Argument[this].Property[Models.AvoidDuplicateLifted+A.Prop];ReturnValue;value;dfc-generated - // summary=Models;AvoidDuplicateLifted+A;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;AvoidDuplicateLifted+A;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated public virtual object GetValue() { return Prop; @@ -1027,7 +1027,7 @@ public class B : A private object field; // No content based summary as field is a dead synthetic field. - // summary=Models;AvoidDuplicateLifted+A;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=Models;AvoidDuplicateLifted+A;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated public override object GetValue() { return field; @@ -1038,14 +1038,14 @@ public override object GetValue() public class ParameterModifiers { // contentbased-summary=Models;ParameterModifiers;false;Copy;(System.Object,System.Object);;Argument[0];Argument[1];value;dfc-generated - // summary=Models;ParameterModifiers;false;Copy;(System.Object,System.Object);;Argument[0];Argument[1];taint;df-generated + // heuristic-summary=Models;ParameterModifiers;false;Copy;(System.Object,System.Object);;Argument[0];Argument[1];taint;df-generated public void Copy(object key, out object value) { value = key; } // contentbased-summary=Models;ParameterModifiers;false;CopyToRef;(System.Object,System.Object);;Argument[0];Argument[1];value;dfc-generated - // summary=Models;ParameterModifiers;false;CopyToRef;(System.Object,System.Object);;Argument[0];Argument[1];taint;df-generated + // heuristic-summary=Models;ParameterModifiers;false;CopyToRef;(System.Object,System.Object);;Argument[0];Argument[1];taint;df-generated public void CopyToRef(object key, ref object value) { value = key; @@ -1065,7 +1065,7 @@ public void RefParamUse(ref object value) } // contentbased-summary=Models;ParameterModifiers;false;InReturn;(System.Object);;Argument[0];ReturnValue;value;dfc-generated - // summary=Models;ParameterModifiers;false;InReturn;(System.Object);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=Models;ParameterModifiers;false;InReturn;(System.Object);;Argument[0];ReturnValue;taint;df-generated public object InReturn(in object v) { return v; From 1d6c36704976471db404af9b94dcc5feeba88ede Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 16 Apr 2025 09:52:22 +0200 Subject: [PATCH 220/240] C#: Change the capture neutral model test to use the content/heuristic version instead. --- ...tralModels.expected => CaptureNeutralModels.expected} | 0 ...eutralModels.ext.yml => CaptureNeutralModels.ext.yml} | 0 ...HeuristicNeutralModels.ql => CaptureNeutralModels.ql} | 2 +- .../ql/test/utils/modelgenerator/dataflow/Summaries.cs | 9 +++------ 4 files changed, 4 insertions(+), 7 deletions(-) rename csharp/ql/test/utils/modelgenerator/dataflow/{CaptureHeuristicNeutralModels.expected => CaptureNeutralModels.expected} (100%) rename csharp/ql/test/utils/modelgenerator/dataflow/{CaptureHeuristicNeutralModels.ext.yml => CaptureNeutralModels.ext.yml} (100%) rename csharp/ql/test/utils/modelgenerator/dataflow/{CaptureHeuristicNeutralModels.ql => CaptureNeutralModels.ql} (75%) diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.expected b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.expected similarity index 100% rename from csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.expected rename to csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.expected diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.ext.yml b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ext.yml similarity index 100% rename from csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.ext.yml rename to csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ext.yml diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.ql b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql similarity index 75% rename from csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.ql rename to csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql index a5cdae532f4f..d5aa685bfe31 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicNeutralModels.ql +++ b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = Heuristic::captureNoFlow(c) } + string getCapturedModel(Callable c) { result = captureNeutral(c) } string getKind() { result = "neutral" } } diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs b/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs index 98d8b3e3bb81..f1dbc02512ab 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs +++ b/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs @@ -510,14 +510,12 @@ public Type M6(Type t) // the content based model generation is able to produce flow summaries for them. public class HigherOrderParameters { - // neutral=Models;HigherOrderParameters;M1;(System.String,System.Func);summary;df-generated // contentbased-summary=Models;HigherOrderParameters;false;M1;(System.String,System.Func);;Argument[0];ReturnValue;value;dfc-generated public string M1(string s, Func map) { return s; } - // neutral=Models;HigherOrderParameters;Apply;(System.Func,System.Object);summary;df-generated // contentbased-summary=Models;HigherOrderParameters;false;Apply;(System.Func,System.Object);;Argument[1];Argument[0].Parameter[0];value;dfc-generated // contentbased-summary=Models;HigherOrderParameters;false;Apply;(System.Func,System.Object);;Argument[0].ReturnValue;ReturnValue;value;dfc-generated public object Apply(Func f, object o) @@ -525,7 +523,6 @@ public object Apply(Func f, object o) return f(o); } - // neutral=Models;HigherOrderParameters;Apply2;(System.Object,System.Func);summary;df-generated // contentbased-summary=Models;HigherOrderParameters;false;Apply2;(System.Object,System.Func);;Argument[0];Argument[1].Parameter[1];value;dfc-generated // contentbased-summary=Models;HigherOrderParameters;false;Apply2;(System.Object,System.Func);;Argument[1].ReturnValue;ReturnValue;value;dfc-generated public object Apply2(object o, Func f) @@ -534,7 +531,6 @@ public object Apply2(object o, Func f) return x; } - // neutral=Models;HigherOrderParameters;Apply;(System.Action,System.Object);summary;df-generated // contentbased-summary=Models;HigherOrderParameters;false;Apply;(System.Action,System.Object);;Argument[1];Argument[0].Parameter[0];value;dfc-generated public void Apply(Action a, object o) { @@ -544,7 +540,6 @@ public void Apply(Action a, object o) public static class HigherOrderExtensionMethods { - // neutral=Models;HigherOrderExtensionMethods;Select;(System.Collections.Generic.IEnumerable,System.Func);summary;df-generated // contentbased-summary=Models;HigherOrderExtensionMethods;false;Select;(System.Collections.Generic.IEnumerable,System.Func);;Argument[0].Element;Argument[1].Parameter[0];value;dfc-generated // contentbased-summary=Models;HigherOrderExtensionMethods;false;Select;(System.Collections.Generic.IEnumerable,System.Func);;Argument[1].ReturnValue;ReturnValue.Element;value;dfc-generated public static IEnumerable Select( @@ -661,11 +656,13 @@ public override string Id(string x) public interface IPublic3 { + // neutral=Models;Inheritance+IPublic3;get_Prop;();summary;df-generated string Prop { get; } } public abstract class D : IPublic3 { + // neutral=Models;Inheritance+D;get_Prop;();summary;df-generated public abstract string Prop { get; } } @@ -826,7 +823,6 @@ public void SetChainBegin(string v) chainBegin = v; } - // neutral=Models;SyntheticFields;CopyChainValue;();summary;df-generated // contentbased-summary=Models;SyntheticFields;false;CopyChainValue;();;Argument[this].SyntheticField[Models.SyntheticFields.chainBegin];Argument[this].SyntheticField[Models.SyntheticFields.chainEnd];value;dfc-generated public void CopyChainValue() { @@ -933,6 +929,7 @@ public class Fanout public abstract class Base1 { + // neutral=Models;Fanout+Base1;GetValue;();summary;df-generated public abstract string GetValue(); } From 08f7caaf39cf339d883166f2424b84c3742604b1 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 16 Apr 2025 10:40:38 +0200 Subject: [PATCH 221/240] Java: Adjust model generator test cases to the new implementation. --- ...ryModels.expected => CaptureHeuristicSummaryModels.expected} | 0 ...CaptureSummaryModels.ql => CaptureHeuristicSummaryModels.ql} | 2 +- .../test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql | 2 +- java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql | 2 +- .../test/utils/modelgenerator/dataflow/CaptureSourceModels.ql | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename java/ql/test/utils/modelgenerator/dataflow/{CaptureSummaryModels.expected => CaptureHeuristicSummaryModels.expected} (100%) rename java/ql/test/utils/modelgenerator/dataflow/{CaptureSummaryModels.ql => CaptureHeuristicSummaryModels.ql} (76%) diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected b/java/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.expected similarity index 100% rename from java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.expected rename to java/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.expected diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql similarity index 76% rename from java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql rename to java/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql index 482dce0ab28e..0ef8af1b6100 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSummaryModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = captureFlow(c) } + string getCapturedModel(Callable c) { result = Heuristic::captureFlow(c) } string getKind() { result = "summary" } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql index f9ac9d8da366..973d470af419 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = captureNoFlow(c) } + string getCapturedModel(Callable c) { result = Heuristic::captureNoFlow(c) } string getKind() { result = "neutral" } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql index a7d3126df570..027670316c33 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = captureSink(c) } + string getCapturedModel(Callable c) { result = Heuristic::captureSink(c) } string getKind() { result = "sink" } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql index d8ac4d9d6034..d8346f0e3dca 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = captureSource(c) } + string getCapturedModel(Callable c) { result = Heuristic::captureSource(c) } string getKind() { result = "source" } } From 7e51dae743374da45ceb997a1fc7dd50a67b6924 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 16 Apr 2025 10:43:20 +0200 Subject: [PATCH 222/240] Java: Change the heuristic summary test tag to heuristic-summary. --- .../dataflow/CaptureHeuristicSummaryModels.ql | 2 +- .../modelgenerator/dataflow/p/Factory.java | 6 ++-- .../modelgenerator/dataflow/p/Fanout.java | 16 +++++----- .../modelgenerator/dataflow/p/FinalClass.java | 2 +- .../modelgenerator/dataflow/p/FluentAPI.java | 2 +- .../dataflow/p/ImmutablePojo.java | 8 ++--- .../dataflow/p/Inheritance.java | 12 ++++---- .../dataflow/p/InnerClasses.java | 4 +-- .../dataflow/p/InnerHolder.java | 10 +++---- .../modelgenerator/dataflow/p/Joiner.java | 18 +++++------ .../modelgenerator/dataflow/p/MultiPaths.java | 2 +- .../dataflow/p/MultipleImpl2.java | 2 +- .../dataflow/p/MultipleImpls.java | 6 ++-- .../modelgenerator/dataflow/p/ParamFlow.java | 22 +++++++------- .../utils/modelgenerator/dataflow/p/Pojo.java | 30 +++++++++---------- .../p/PrivateFlowViaPublicInterface.java | 4 +-- .../dataflow/p/SyntheticCollections.java | 4 +-- 17 files changed, 75 insertions(+), 75 deletions(-) diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql index 0ef8af1b6100..45485a8009a5 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql @@ -5,7 +5,7 @@ import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { string getCapturedModel(Callable c) { result = Heuristic::captureFlow(c) } - string getKind() { result = "summary" } + string getKind() { result = "heuristic-summary" } } import InlineMadTest diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java b/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java index d168bff3675a..58beff302b99 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Factory.java @@ -6,13 +6,13 @@ public final class Factory { private int intValue; - // summary=p;Factory;false;create;(String,int);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Factory;false;create;(String,int);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;Factory;false;create;(String,int);;Argument[0];ReturnValue.Field[p.Factory.value];value;dfc-generated public static Factory create(String value, int foo) { return new Factory(value, foo); } - // summary=p;Factory;false;create;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Factory;false;create;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;Factory;false;create;(String);;Argument[0];ReturnValue.Field[p.Factory.value];value;dfc-generated public static Factory create(String value) { return new Factory(value, 0); @@ -23,7 +23,7 @@ private Factory(String value, int intValue) { this.intValue = intValue; } - // summary=p;Factory;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Factory;false;getValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Factory;false;getValue;();;Argument[this].Field[p.Factory.value];ReturnValue;value;dfc-generated public String getValue() { return value; diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Fanout.java b/java/ql/test/utils/modelgenerator/dataflow/p/Fanout.java index 65dd715cc528..270ffb50f66e 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Fanout.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Fanout.java @@ -10,7 +10,7 @@ public interface I2 extends I1 {} public class Impl1 implements I1 { public String v; - // summary=p;Fanout$I1;true;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Fanout$I1;true;getValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Fanout$Impl1;true;getValue;();;Argument[this].Field[p.Fanout$Impl1.v];ReturnValue;value;dfc-generated public String getValue() { return v; @@ -20,7 +20,7 @@ public String getValue() { public class Impl2 implements I2 { public String v; - // summary=p;Fanout$I1;true;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Fanout$I1;true;getValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Fanout$Impl2;true;getValue;();;Argument[this].Field[p.Fanout$Impl2.v];ReturnValue;value;dfc-generated public String getValue() { return v; @@ -30,7 +30,7 @@ public String getValue() { public class Impl3 implements I2 { public String v; - // summary=p;Fanout$I1;true;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Fanout$I1;true;getValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Fanout$Impl3;true;getValue;();;Argument[this].Field[p.Fanout$Impl3.v];ReturnValue;value;dfc-generated public String getValue() { return v; @@ -40,15 +40,15 @@ public String getValue() { public class Impl4 implements I2 { public String v; - // summary=p;Fanout$I1;true;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Fanout$I1;true;getValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Fanout$Impl4;true;getValue;();;Argument[this].Field[p.Fanout$Impl4.v];ReturnValue;value;dfc-generated public String getValue() { return v; } } - // summary=p;Fanout;true;concatGetValueOnI1;(String,Fanout$I1);;Argument[0];ReturnValue;taint;df-generated - // summary=p;Fanout;true;concatGetValueOnI1;(String,Fanout$I1);;Argument[1];ReturnValue;taint;df-generated + // heuristic-summary=p;Fanout;true;concatGetValueOnI1;(String,Fanout$I1);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Fanout;true;concatGetValueOnI1;(String,Fanout$I1);;Argument[1];ReturnValue;taint;df-generated // No content based summaries are expected for this method on parameter `i` // as the fanout (number of content flows) exceeds the limit of 3. // contentbased-summary=p;Fanout;true;concatGetValueOnI1;(String,Fanout$I1);;Argument[0];ReturnValue;taint;dfc-generated @@ -56,8 +56,8 @@ public String concatGetValueOnI1(String other, I1 i) { return other + i.getValue(); } - // summary=p;Fanout;true;concatGetValueOnI2;(String,Fanout$I2);;Argument[0];ReturnValue;taint;df-generated - // summary=p;Fanout;true;concatGetValueOnI2;(String,Fanout$I2);;Argument[1];ReturnValue;taint;df-generated + // heuristic-summary=p;Fanout;true;concatGetValueOnI2;(String,Fanout$I2);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Fanout;true;concatGetValueOnI2;(String,Fanout$I2);;Argument[1];ReturnValue;taint;df-generated // contentbased-summary=p;Fanout;true;concatGetValueOnI2;(String,Fanout$I2);;Argument[0];ReturnValue;taint;dfc-generated // contentbased-summary=p;Fanout;true;concatGetValueOnI2;(String,Fanout$I2);;Argument[1].Field[p.Fanout$Impl2.v];ReturnValue;taint;dfc-generated // contentbased-summary=p;Fanout;true;concatGetValueOnI2;(String,Fanout$I2);;Argument[1].Field[p.Fanout$Impl3.v];ReturnValue;taint;dfc-generated diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java b/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java index f34f5c9c0ba0..993248f9bf80 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/FinalClass.java @@ -4,7 +4,7 @@ public final class FinalClass { private static final String C = "constant"; - // summary=p;FinalClass;false;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;FinalClass;false;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;FinalClass;false;returnsInput;(String);;Argument[0];ReturnValue;value;dfc-generated public String returnsInput(String input) { return input; diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java b/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java index 39d0590aa3c1..d886c64bcf10 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/FluentAPI.java @@ -2,7 +2,7 @@ public final class FluentAPI { - // summary=p;FluentAPI;false;returnsThis;(String);;Argument[this];ReturnValue;value;df-generated + // heuristic-summary=p;FluentAPI;false;returnsThis;(String);;Argument[this];ReturnValue;value;df-generated // contentbased-summary=p;FluentAPI;false;returnsThis;(String);;Argument[this];ReturnValue;value;dfc-generated public FluentAPI returnsThis(String input) { return this; diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java index 0b2da302d7a1..711d49cc1fc3 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/ImmutablePojo.java @@ -6,14 +6,14 @@ public final class ImmutablePojo { private final long x; - // summary=p;ImmutablePojo;false;ImmutablePojo;(String,int);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;ImmutablePojo;false;ImmutablePojo;(String,int);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=p;ImmutablePojo;false;ImmutablePojo;(String,int);;Argument[0];Argument[this].SyntheticField[p.ImmutablePojo.value];value;dfc-generated public ImmutablePojo(String value, int x) { this.value = value; this.x = x; } - // summary=p;ImmutablePojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;ImmutablePojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;ImmutablePojo;false;getValue;();;Argument[this].SyntheticField[p.ImmutablePojo.value];ReturnValue;value;dfc-generated public String getValue() { return value; @@ -24,8 +24,8 @@ public long getX() { return x; } - // summary=p;ImmutablePojo;false;or;(String);;Argument[0];ReturnValue;taint;df-generated - // summary=p;ImmutablePojo;false;or;(String);;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;ImmutablePojo;false;or;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;ImmutablePojo;false;or;(String);;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;ImmutablePojo;false;or;(String);;Argument[0];ReturnValue;value;dfc-generated // contentbased-summary=p;ImmutablePojo;false;or;(String);;Argument[this].SyntheticField[p.ImmutablePojo.value];ReturnValue;value;dfc-generated public String or(String defaultValue) { diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Inheritance.java b/java/ql/test/utils/modelgenerator/dataflow/p/Inheritance.java index b5d03fdc8a1d..4253ee0d6ead 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Inheritance.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Inheritance.java @@ -10,7 +10,7 @@ public abstract class BasePublic { } public class AImplBasePrivateImpl extends BasePrivate { - // summary=p;Inheritance$AImplBasePrivateImpl;true;id;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Inheritance$AImplBasePrivateImpl;true;id;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;Inheritance$AImplBasePrivateImpl;true;id;(String);;Argument[0];ReturnValue;value;dfc-generated @Override public String id(String s) { @@ -19,7 +19,7 @@ public String id(String s) { } public class AImplBasePublic extends BasePublic { - // summary=p;Inheritance$BasePublic;true;id;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Inheritance$BasePublic;true;id;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;Inheritance$BasePublic;true;id;(String);;Argument[0];ReturnValue;value;dfc-generated @Override public String id(String s) { @@ -60,7 +60,7 @@ private abstract class E implements IPrivate2 { } public class BImpl extends B { - // summary=p;Inheritance$IPublic1;true;id;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Inheritance$IPublic1;true;id;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;Inheritance$IPublic1;true;id;(String);;Argument[0];ReturnValue;value;dfc-generated @Override public String id(String s) { @@ -69,7 +69,7 @@ public String id(String s) { } public class CImpl extends C { - // summary=p;Inheritance$C;true;id;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Inheritance$C;true;id;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;Inheritance$C;true;id;(String);;Argument[0];ReturnValue;value;dfc-generated @Override public String id(String s) { @@ -78,7 +78,7 @@ public String id(String s) { } public class DImpl extends D { - // summary=p;Inheritance$IPublic2;true;id;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Inheritance$IPublic2;true;id;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;Inheritance$IPublic2;true;id;(String);;Argument[0];ReturnValue;value;dfc-generated @Override public String id(String s) { @@ -87,7 +87,7 @@ public String id(String s) { } public class EImpl extends E { - // summary=p;Inheritance$EImpl;true;id;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Inheritance$EImpl;true;id;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;Inheritance$EImpl;true;id;(String);;Argument[0];ReturnValue;value;dfc-generated @Override public String id(String s) { diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java b/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java index b9aaeb638930..283bcfd5c6e2 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/InnerClasses.java @@ -9,14 +9,14 @@ public String no(String input) { } public class CaptureMe { - // summary=p;InnerClasses$CaptureMe;true;yesCm;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;InnerClasses$CaptureMe;true;yesCm;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;InnerClasses$CaptureMe;true;yesCm;(String);;Argument[0];ReturnValue;value;dfc-generated public String yesCm(String input) { return input; } } - // summary=p;InnerClasses;true;yes;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;InnerClasses;true;yes;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;InnerClasses;true;yes;(String);;Argument[0];ReturnValue;value;dfc-generated public String yes(String input) { return input; diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java b/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java index 01655cb413f3..b4a1ca20aedb 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/InnerHolder.java @@ -18,31 +18,31 @@ public String getValue() { private StringBuilder sb = new StringBuilder(); - // summary=p;InnerHolder;false;setContext;(String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;InnerHolder;false;setContext;(String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=p;InnerHolder;false;setContext;(String);;Argument[0];Argument[this].SyntheticField[p.InnerHolder.context].SyntheticField[p.InnerHolder$Context.value];value;dfc-generated public void setContext(String value) { context = new Context(value); } - // summary=p;InnerHolder;false;explicitSetContext;(String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;InnerHolder;false;explicitSetContext;(String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=p;InnerHolder;false;explicitSetContext;(String);;Argument[0];Argument[this].SyntheticField[p.InnerHolder.context].SyntheticField[p.InnerHolder$Context.value];value;dfc-generated public void explicitSetContext(String value) { this.context = new Context(value); } - // summary=p;InnerHolder;false;append;(String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;InnerHolder;false;append;(String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=p;InnerHolder;false;append;(String);;Argument[0];Argument[this].SyntheticField[p.InnerHolder.sb];taint;dfc-generated public void append(String value) { sb.append(value); } - // summary=p;InnerHolder;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;InnerHolder;false;getValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;InnerHolder;false;getValue;();;Argument[this].SyntheticField[p.InnerHolder.sb];ReturnValue;taint;dfc-generated public String getValue() { return sb.toString(); } - // summary=p;InnerHolder;false;getContextValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;InnerHolder;false;getContextValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;InnerHolder;false;getContextValue;();;Argument[this].SyntheticField[p.InnerHolder.context].SyntheticField[p.InnerHolder$Context.value];ReturnValue;value;dfc-generated public String getContextValue() { return context.getValue(); diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java b/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java index da1e7214a011..ffe68e6722db 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Joiner.java @@ -12,15 +12,15 @@ public final class Joiner { private int len; private String emptyValue; - // summary=p;Joiner;false;Joiner;(CharSequence);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;Joiner;false;Joiner;(CharSequence);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=p;Joiner;false;Joiner;(CharSequence);;Argument[0];Argument[this].SyntheticField[p.Joiner.delimiter];taint;dfc-generated public Joiner(CharSequence delimiter) { this(delimiter, "", ""); } - // summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[0];Argument[this];taint;df-generated - // summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[1];Argument[this];taint;df-generated - // summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[2];Argument[this];taint;df-generated + // heuristic-summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[1];Argument[this];taint;df-generated + // heuristic-summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[2];Argument[this];taint;df-generated // contentbased-summary=p;Joiner;false;Joiner;(CharSequence,CharSequence,CharSequence);;Argument[0];Argument[this].SyntheticField[p.Joiner.delimiter];taint;dfc-generated // No content based summaries for prefix and suffix as they are "dead" synthetic fields. public Joiner(CharSequence delimiter, CharSequence prefix, CharSequence suffix) { @@ -33,8 +33,8 @@ public Joiner(CharSequence delimiter, CharSequence prefix, CharSequence suffix) checkAddLength(0, 0); } - // summary=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[0];Argument[this];taint;df-generated - // summary=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[this];ReturnValue;value;df-generated + // heuristic-summary=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[this];ReturnValue;value;df-generated // No content based summary as emptyValue is "dead" (synthetic)field. // contentbased-summary=p;Joiner;false;setEmptyValue;(CharSequence);;Argument[this];ReturnValue;value;dfc-generated public Joiner setEmptyValue(CharSequence emptyValue) { @@ -43,7 +43,7 @@ public Joiner setEmptyValue(CharSequence emptyValue) { return this; } - // summary=p;Joiner;false;getDelimiter;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Joiner;false;getDelimiter;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Joiner;false;getDelimiter;();;Argument[this].SyntheticField[p.Joiner.delimiter];ReturnValue;value;dfc-generated public String getDelimiter() { return delimiter; @@ -81,7 +81,7 @@ public String toString() { return new String(chars); } - // summary=p;Joiner;false;add;(CharSequence);;Argument[this];ReturnValue;value;df-generated + // heuristic-summary=p;Joiner;false;add;(CharSequence);;Argument[this];ReturnValue;value;df-generated // contentbased-summary=p;Joiner;false;add;(CharSequence);;Argument[this];ReturnValue;value;dfc-generated // MISSING content based summaries for "elts". This could be a synthetic field. public Joiner add(CharSequence newElement) { @@ -106,7 +106,7 @@ private int checkAddLength(int oldLen, int inc) { return (int) newLen; } - // summary=p;Joiner;false;merge;(Joiner);;Argument[this];ReturnValue;value;df-generated + // heuristic-summary=p;Joiner;false;merge;(Joiner);;Argument[this];ReturnValue;value;df-generated // contentbased-summary=p;Joiner;false;merge;(Joiner);;Argument[this];ReturnValue;value;dfc-generated // MISSING content based summaries for "elts". This could be a synthetic field. public Joiner merge(Joiner other) { diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/MultiPaths.java b/java/ql/test/utils/modelgenerator/dataflow/p/MultiPaths.java index 827346604dfe..11d2f8f76f83 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/MultiPaths.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/MultiPaths.java @@ -2,7 +2,7 @@ public class MultiPaths { - // summary=p;MultiPaths;true;cond;(String,String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;MultiPaths;true;cond;(String,String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;MultiPaths;true;cond;(String,String);;Argument[0];ReturnValue;value;dfc-generated public String cond(String x, String other) { if (x == other) { diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java index 32c846cb1da5..d0fd31613d65 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpl2.java @@ -16,7 +16,7 @@ public Object m(Object value) { } public class Impl2 implements IInterface { - // summary=p;MultipleImpl2$IInterface;true;m;(Object);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;MultipleImpl2$IInterface;true;m;(Object);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;MultipleImpl2$IInterface;true;m;(Object);;Argument[0];ReturnValue;value;dfc-generated public Object m(Object value) { return value; diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java index c44c3268918e..5bdbb47fa483 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/MultipleImpls.java @@ -9,7 +9,7 @@ public static interface Strategy { } public static class Strat1 implements Strategy { - // summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];ReturnValue;value;dfc-generated public String doSomething(String value) { return value; @@ -29,7 +29,7 @@ public String call() throws Exception { public static class Strat2 implements Strategy { private String foo; - // summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;MultipleImpls$Strategy;true;doSomething;(String);;Argument[0];Argument[this];taint;df-generated // The content based summary is not lifted as it pertains to a (synthetic)field. // contentbased-summary=p;MultipleImpls$Strat2;true;doSomething;(String);;Argument[0];Argument[this].SyntheticField[p.MultipleImpls$Strat2.foo];value;dfc-generated public String doSomething(String value) { @@ -37,7 +37,7 @@ public String doSomething(String value) { return "none"; } - // summary=p;MultipleImpls$Strat2;true;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;MultipleImpls$Strat2;true;getValue;();;Argument[this];ReturnValue;taint;df-generated // The content based summary is not lifted as it pertains to a (synthetic)field. // contentbased-summary=p;MultipleImpls$Strat2;true;getValue;();;Argument[this].SyntheticField[p.MultipleImpls$Strat2.foo];ReturnValue;value;dfc-generated public String getValue() { diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java b/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java index 41268ff11561..81b9602e5577 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/ParamFlow.java @@ -7,7 +7,7 @@ public class ParamFlow { - // summary=p;ParamFlow;true;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;ParamFlow;true;returnsInput;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;ParamFlow;true;returnsInput;(String);;Argument[0];ReturnValue;value;dfc-generated public String returnsInput(String input) { return input; @@ -18,8 +18,8 @@ public int ignorePrimitiveReturnValue(String input) { return input.length(); } - // summary=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[0];ReturnValue;taint;df-generated - // summary=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[1];ReturnValue;taint;df-generated + // heuristic-summary=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[1];ReturnValue;taint;df-generated // contentbased-summary=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[0];ReturnValue;value;dfc-generated // contentbased-summary=p;ParamFlow;true;returnMultipleParameters;(String,String);;Argument[1];ReturnValue;value;dfc-generated public String returnMultipleParameters(String one, String two) { @@ -29,31 +29,31 @@ public String returnMultipleParameters(String one, String two) { return one; } - // summary=p;ParamFlow;true;returnArrayElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated + // heuristic-summary=p;ParamFlow;true;returnArrayElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated // contentbased-summary=p;ParamFlow;true;returnArrayElement;(String[]);;Argument[0].ArrayElement;ReturnValue;value;dfc-generated public String returnArrayElement(String[] input) { return input[0]; } - // summary=p;ParamFlow;true;returnVarArgElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated + // heuristic-summary=p;ParamFlow;true;returnVarArgElement;(String[]);;Argument[0].ArrayElement;ReturnValue;taint;df-generated // contentbased-summary=p;ParamFlow;true;returnVarArgElement;(String[]);;Argument[0].ArrayElement;ReturnValue;value;dfc-generated public String returnVarArgElement(String... input) { return input[0]; } - // summary=p;ParamFlow;true;returnCollectionElement;(List);;Argument[0].Element;ReturnValue;taint;df-generated + // heuristic-summary=p;ParamFlow;true;returnCollectionElement;(List);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=p;ParamFlow;true;returnCollectionElement;(List);;Argument[0].Element;ReturnValue;value;dfc-generated public String returnCollectionElement(List input) { return input.get(0); } - // summary=p;ParamFlow;true;returnIteratorElement;(Iterator);;Argument[0].Element;ReturnValue;taint;df-generated + // heuristic-summary=p;ParamFlow;true;returnIteratorElement;(Iterator);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=p;ParamFlow;true;returnIteratorElement;(Iterator);;Argument[0].Element;ReturnValue;value;dfc-generated public String returnIteratorElement(Iterator input) { return input.next(); } - // summary=p;ParamFlow;true;returnIterableElement;(Iterable);;Argument[0].Element;ReturnValue;taint;df-generated + // heuristic-summary=p;ParamFlow;true;returnIterableElement;(Iterable);;Argument[0].Element;ReturnValue;taint;df-generated // contentbased-summary=p;ParamFlow;true;returnIterableElement;(Iterable);;Argument[0].Element;ReturnValue;value;dfc-generated public String returnIterableElement(Iterable input) { return input.iterator().next(); @@ -64,19 +64,19 @@ public Class mapType(Class input) { return input; } - // summary=p;ParamFlow;true;writeChunked;(byte[],OutputStream);;Argument[0];Argument[1];taint;df-generated + // heuristic-summary=p;ParamFlow;true;writeChunked;(byte[],OutputStream);;Argument[0];Argument[1];taint;df-generated // contentbased-summary=p;ParamFlow;true;writeChunked;(byte[],OutputStream);;Argument[0];Argument[1];taint;dfc-generated public void writeChunked(byte[] data, OutputStream output) throws IOException { output.write(data, 0, data.length); } - // summary=p;ParamFlow;true;writeChunked;(char[],OutputStream);;Argument[0];Argument[1];taint;df-generated + // heuristic-summary=p;ParamFlow;true;writeChunked;(char[],OutputStream);;Argument[0];Argument[1];taint;df-generated // contentbased-summary=p;ParamFlow;true;writeChunked;(char[],OutputStream);;Argument[0];Argument[1];taint;dfc-generated public void writeChunked(char[] data, OutputStream output) throws IOException { output.write(String.valueOf(data).getBytes(), 0, data.length); } - // summary=p;ParamFlow;true;addTo;(String,List);;Argument[0];Argument[1].Element;taint;df-generated + // heuristic-summary=p;ParamFlow;true;addTo;(String,List);;Argument[0];Argument[1].Element;taint;df-generated // contentbased-summary=p;ParamFlow;true;addTo;(String,List);;Argument[0];Argument[1].Element;value;dfc-generated public void addTo(String data, List target) { target.add(data); diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java index 1c30f83bccfa..a2df705e0d38 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java @@ -32,8 +32,8 @@ int length() { private String stringValue1; private String stringValue2; - // summary=p;Pojo;false;Pojo;(Byte[],char[]);;Argument[0];Argument[this];taint;df-generated - // summary=p;Pojo;false;Pojo;(Byte[],char[]);;Argument[1];Argument[this];taint;df-generated + // heuristic-summary=p;Pojo;false;Pojo;(Byte[],char[]);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;Pojo;false;Pojo;(Byte[],char[]);;Argument[1];Argument[this];taint;df-generated // contentbased-summary=p;Pojo;false;Pojo;(Byte[],char[]);;Argument[0];Argument[this].SyntheticField[p.Pojo.byteObjectArray];value;dfc-generated // contentbased-summary=p;Pojo;false;Pojo;(Byte[],char[]);;Argument[1];Argument[this].SyntheticField[p.Pojo.charArray];value;dfc-generated public Pojo(Byte[] byteObjectArray, char[] charArray) { @@ -41,13 +41,13 @@ public Pojo(Byte[] byteObjectArray, char[] charArray) { this.charArray = charArray; } - // summary=p;Pojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Pojo;false;getValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Pojo;false;getValue;();;Argument[this].SyntheticField[p.Pojo.value];ReturnValue;value;dfc-generated public String getValue() { return value; } - // summary=p;Pojo;false;setValue;(String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;Pojo;false;setValue;(String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=p;Pojo;false;setValue;(String);;Argument[0];Argument[this].SyntheticField[p.Pojo.value];value;dfc-generated public void setValue(String value) { this.value = value; @@ -74,19 +74,19 @@ public int[] getPrimitiveArray() { return new int[] {intValue}; } - // summary=p;Pojo;false;getCharArray;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Pojo;false;getCharArray;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Pojo;false;getCharArray;();;Argument[this].SyntheticField[p.Pojo.charArray];ReturnValue;value;dfc-generated public char[] getCharArray() { return charArray; } - // summary=p;Pojo;false;getByteArray;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Pojo;false;getByteArray;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Pojo;false;getByteArray;();;Argument[this].Field[p.Pojo.byteArray];ReturnValue;value;dfc-generated public byte[] getByteArray() { return byteArray; } - // summary=p;Pojo;false;setByteArray;(byte[]);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;Pojo;false;setByteArray;(byte[]);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=p;Pojo;false;setByteArray;(byte[]);;Argument[0];Argument[this].Field[p.Pojo.byteArray];value;dfc-generated public void setByteArray(byte[] value) { byteArray = value; @@ -107,13 +107,13 @@ public Collection getBoxedCollection() { return List.of(Integer.valueOf(intValue)); } - // summary=p;Pojo;false;getBoxedChars;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Pojo;false;getBoxedChars;();;Argument[this];ReturnValue;taint;df-generated // No content based summary as charList is a "dead" (synthetic)field. public List getBoxedChars() { return charList; } - // summary=p;Pojo;false;getBoxedBytes;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Pojo;false;getBoxedBytes;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Pojo;false;getBoxedBytes;();;Argument[this].SyntheticField[p.Pojo.byteObjectArray];ReturnValue;value;dfc-generated public Byte[] getBoxedBytes() { return byteObjectArray; @@ -129,13 +129,13 @@ public BigDecimal getBigDecimal() { return new BigDecimal(value); } - // summary=p;Pojo;false;fillIn;(List);;Argument[this];Argument[0].Element;taint;df-generated + // heuristic-summary=p;Pojo;false;fillIn;(List);;Argument[this];Argument[0].Element;taint;df-generated // contentbased-summary=p;Pojo;false;fillIn;(List);;Argument[this].SyntheticField[p.Pojo.value];Argument[0].Element;value;dfc-generated public void fillIn(List target) { target.add(value); } - // summary=p;Pojo;false;setStringValue1;(String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;Pojo;false;setStringValue1;(String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=p;Pojo;false;setStringValue1;(String);;Argument[0];Argument[this].SyntheticField[p.Pojo.stringValue1];value;dfc-generated public void setStringValue1(String value) { this.stringValue1 = value; @@ -147,7 +147,7 @@ public void copyStringValue() { this.stringValue2 = this.stringValue1; } - // summary=p;Pojo;false;getStringValue2;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Pojo;false;getStringValue2;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Pojo;false;getStringValue2;();;Argument[this].SyntheticField[p.Pojo.stringValue2];ReturnValue;value;dfc-generated public String getStringValue2() { return this.stringValue2; @@ -156,20 +156,20 @@ public String getStringValue2() { public class InnerPojo { private String value; - // summary=p;Pojo$InnerPojo;true;InnerPojo;(String);;Argument[0];Argument[this];taint;df-generated + // heuristic-summary=p;Pojo$InnerPojo;true;InnerPojo;(String);;Argument[0];Argument[this];taint;df-generated // contentbased-summary=p;Pojo$InnerPojo;true;InnerPojo;(String);;Argument[0];Argument[this].SyntheticField[p.Pojo$InnerPojo.value];value;dfc-generated public InnerPojo(String value) { this.value = value; } - // summary=p;Pojo$InnerPojo;true;getValue;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;Pojo$InnerPojo;true;getValue;();;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;Pojo$InnerPojo;true;getValue;();;Argument[this].SyntheticField[p.Pojo$InnerPojo.value];ReturnValue;value;dfc-generated public String getValue() { return value; } } - // summary=p;Pojo;false;makeInnerPojo;(String);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;Pojo;false;makeInnerPojo;(String);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;Pojo;false;makeInnerPojo;(String);;Argument[0];ReturnValue.SyntheticField[p.Pojo$InnerPojo.value];value;dfc-generated public InnerPojo makeInnerPojo(String value) { return new InnerPojo(value); diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java index 282d0b077b7e..7eaf70c19ded 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java @@ -28,7 +28,7 @@ public PrivateImplWithSink(File file) { this.file = file; } - // summary=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated @Override public OutputStream openStream() throws IOException { return new FileOutputStream(file); @@ -50,7 +50,7 @@ public OutputStream openStreamNone() throws IOException { } } - // summary=p;PrivateFlowViaPublicInterface;true;createAnSPI;(File);;Argument[0];ReturnValue;taint;df-generated + // heuristic-summary=p;PrivateFlowViaPublicInterface;true;createAnSPI;(File);;Argument[0];ReturnValue;taint;df-generated // contentbased-summary=p;PrivateFlowViaPublicInterface;true;createAnSPI;(File);;Argument[0];ReturnValue.SyntheticField[p.PrivateFlowViaPublicInterface$PrivateImplWithSink.file];value;dfc-generated public static SPI createAnSPI(File file) { return new PrivateImplWithSink(file); diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/SyntheticCollections.java b/java/ql/test/utils/modelgenerator/dataflow/p/SyntheticCollections.java index 6dd351e12bfd..93f04291f4dd 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/SyntheticCollections.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/SyntheticCollections.java @@ -3,13 +3,13 @@ public class SyntheticCollections { private String[] array; - // summary=p;SyntheticCollections;true;SyntheticCollections;(String[]);;Argument[0].ArrayElement;Argument[this];taint;df-generated + // heuristic-summary=p;SyntheticCollections;true;SyntheticCollections;(String[]);;Argument[0].ArrayElement;Argument[this];taint;df-generated // contentbased-summary=p;SyntheticCollections;true;SyntheticCollections;(String[]);;Argument[0];Argument[this].SyntheticField[p.SyntheticCollections.array];value;dfc-generated public SyntheticCollections(String[] array) { this.array = array; } - // summary=p;SyntheticCollections;true;getElement;(Integer);;Argument[this];ReturnValue;taint;df-generated + // heuristic-summary=p;SyntheticCollections;true;getElement;(Integer);;Argument[this];ReturnValue;taint;df-generated // contentbased-summary=p;SyntheticCollections;true;getElement;(Integer);;Argument[this].SyntheticField[p.SyntheticCollections.array].ArrayElement;ReturnValue;value;dfc-generated public String getElement(Integer index) { return array[index]; From 71d0409bb755514e8f23665db78c1cf55c097b50 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 16 Apr 2025 10:47:48 +0200 Subject: [PATCH 223/240] Java: Convert the model generator neutral test to use the combined neutral generator. --- .../test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql | 2 +- java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql index 973d470af419..3578153ddb82 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureNeutralModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Callable c) { result = Heuristic::captureNoFlow(c) } + string getCapturedModel(Callable c) { result = captureNeutral(c) } string getKind() { result = "neutral" } } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java index a2df705e0d38..204af0efc345 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java @@ -141,7 +141,6 @@ public void setStringValue1(String value) { this.stringValue1 = value; } - // neutral=p;Pojo;copyStringValue;();summary;df-generated // contentbased-summary=p;Pojo;false;copyStringValue;();;Argument[this].SyntheticField[p.Pojo.stringValue1];Argument[this].SyntheticField[p.Pojo.stringValue2];value;dfc-generated public void copyStringValue() { this.stringValue2 = this.stringValue1; From 21553960b058f03c8bc20f0dd857d33e299ad663 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 16 Apr 2025 11:04:33 +0200 Subject: [PATCH 224/240] Rust: Adjust tests. --- rust/ql/test/utils-tests/modelgenerator/CaptureSinkModels.ql | 2 +- rust/ql/test/utils-tests/modelgenerator/CaptureSourceModels.ql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/ql/test/utils-tests/modelgenerator/CaptureSinkModels.ql b/rust/ql/test/utils-tests/modelgenerator/CaptureSinkModels.ql index aa1925451814..14edea3af8a1 100644 --- a/rust/ql/test/utils-tests/modelgenerator/CaptureSinkModels.ql +++ b/rust/ql/test/utils-tests/modelgenerator/CaptureSinkModels.ql @@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels import utils.test.InlineMadTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Function f) { result = captureSink(f) } + string getCapturedModel(Function f) { result = Heuristic::captureSink(f) } string getKind() { result = "sink" } } diff --git a/rust/ql/test/utils-tests/modelgenerator/CaptureSourceModels.ql b/rust/ql/test/utils-tests/modelgenerator/CaptureSourceModels.ql index 201816bd2f84..66f0780448c7 100644 --- a/rust/ql/test/utils-tests/modelgenerator/CaptureSourceModels.ql +++ b/rust/ql/test/utils-tests/modelgenerator/CaptureSourceModels.ql @@ -4,7 +4,7 @@ import utils.test.InlineMadTest import codeql.rust.dataflow.internal.ModelsAsData module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(Function c) { result = captureSource(c) } + string getCapturedModel(Function c) { result = Heuristic::captureSource(c) } string getKind() { result = "source" } } From 32125d2291aae9b76d7f17f19865674434ec5a18 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 16 Apr 2025 12:39:58 +0200 Subject: [PATCH 225/240] C#/Java/Rust: Add change notes. --- csharp/ql/src/change-notes/2025-04-16-model-generation.md | 4 ++++ java/ql/src/change-notes/2025-04-16-model-generation.md | 4 ++++ rust/ql/src/change-notes/2025-04-16-model-generation.md | 4 ++++ 3 files changed, 12 insertions(+) create mode 100644 csharp/ql/src/change-notes/2025-04-16-model-generation.md create mode 100644 java/ql/src/change-notes/2025-04-16-model-generation.md create mode 100644 rust/ql/src/change-notes/2025-04-16-model-generation.md diff --git a/csharp/ql/src/change-notes/2025-04-16-model-generation.md b/csharp/ql/src/change-notes/2025-04-16-model-generation.md new file mode 100644 index 000000000000..4c8c89c88455 --- /dev/null +++ b/csharp/ql/src/change-notes/2025-04-16-model-generation.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Changes to the MaD model generation infrastructure: Changed the query `cs/utils/modelgenerator/summary-models` to use the implementation from `cs/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `cs/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `cs/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). diff --git a/java/ql/src/change-notes/2025-04-16-model-generation.md b/java/ql/src/change-notes/2025-04-16-model-generation.md new file mode 100644 index 000000000000..980b2292ed6a --- /dev/null +++ b/java/ql/src/change-notes/2025-04-16-model-generation.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Changes to the MaD model generation infrastructure: Changed the query `java/utils/modelgenerator/summary-models` to use the implementation from `java/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `java/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `java/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). \ No newline at end of file diff --git a/rust/ql/src/change-notes/2025-04-16-model-generation.md b/rust/ql/src/change-notes/2025-04-16-model-generation.md new file mode 100644 index 000000000000..e90a44dbd093 --- /dev/null +++ b/rust/ql/src/change-notes/2025-04-16-model-generation.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Changes to the MaD model generation infrastructure: Changed the query `rust/utils/modelgenerator/summary-models` to use the implementation from `rust/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `rust/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `rust/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). \ No newline at end of file From d187a7d14426414c18c66bf42d0e1bda6cc54a1d Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 22 Apr 2025 11:59:22 +0200 Subject: [PATCH 226/240] Java: Update integration test that tracks queries not included in a query suite. --- .../java/query-suite/not_included_in_qls.expected | 2 -- 1 file changed, 2 deletions(-) diff --git a/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected b/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected index 38c0db1c66d0..f6e89eede03b 100644 --- a/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected +++ b/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected @@ -273,8 +273,6 @@ ql/java/ql/src/utils/modelconverter/ExtractSummaries.ql ql/java/ql/src/utils/modeleditor/ApplicationModeEndpoints.ql ql/java/ql/src/utils/modeleditor/FrameworkModeEndpoints.ql ql/java/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql -ql/java/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql -ql/java/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql ql/java/ql/src/utils/modelgenerator/CaptureNeutralModels.ql ql/java/ql/src/utils/modelgenerator/CaptureSinkModels.ql ql/java/ql/src/utils/modelgenerator/CaptureSourceModels.ql From f6135d507b8a914e4d2e5ecec74b3cca8ba1e7e8 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 23 Apr 2025 16:59:11 +0200 Subject: [PATCH 227/240] Shared: Address review comments. --- .../mad/modelgenerator/internal/ModelGeneratorImpl.qll | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll index afb500b3ed1c..27521b31d00b 100644 --- a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll +++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll @@ -366,7 +366,7 @@ module MakeModelGenerator< } /** - * Provides classes and predicates related to capturing summary models + * Provides classes and predicates related to capturing models * based on heuristic data flow. */ module Heuristic { @@ -784,7 +784,7 @@ module MakeModelGenerator< * If an API produces more content flow on a parameter, it is likely that * 1. Types are not sufficiently constrained on the parameter leading to a combinatorial * explosion in dispatch and thus in the generated summaries. - * 2. It is a reasonable approximation to use the non-content based flow + * 2. It is a reasonable approximation to use the heuristic based flow * detection instead, as reads and stores would use a significant * part of an objects internal state. */ @@ -1039,7 +1039,7 @@ module MakeModelGenerator< * The following heuristic is applied: * 1. If content based flow yields at lease one summary for an API, then we use that. * 2. If content based flow does not yield any summary for an API, then we try and - * generate flow summaries using the non-content based summary generator. + * generate flow summaries using the heuristic based summary generator. */ string captureFlow(DataFlowSummaryTargetApi api, boolean lift) { result = ContentSensitive::captureFlow(api, lift) From d05f604390f4a858291a09cec189f38a87e9fc97 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Thu, 24 Apr 2025 13:07:09 +0200 Subject: [PATCH 228/240] C++: Adjust the model generator queries to the new shared implementation. --- .../modelgenerator/CaptureMixedNeutralModels.ql | 13 ------------- .../modelgenerator/CaptureMixedSummaryModels.ql | 13 ------------- .../utils/modelgenerator/CaptureNeutralModels.ql | 2 +- .../src/utils/modelgenerator/CaptureSinkModels.ql | 1 + .../src/utils/modelgenerator/CaptureSourceModels.ql | 1 + .../utils/modelgenerator/CaptureSummaryModels.ql | 2 +- 6 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql delete mode 100644 cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql diff --git a/cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql deleted file mode 100644 index d03fa1b6030d..000000000000 --- a/cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @name Capture mixed neutral models. - * @description Finds neutral models to be used by other queries. - * @kind diagnostic - * @id cpp/utils/modelgenerator/mixed-neutral-models - * @tags modelgenerator - */ - -import internal.CaptureModels - -from DataFlowSummaryTargetApi api, string noflow -where noflow = captureMixedNeutral(api) -select noflow order by noflow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql deleted file mode 100644 index dc289a07ab12..000000000000 --- a/cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @name Capture mixed summary models. - * @description Finds applicable summary models to be used by other queries. - * @kind diagnostic - * @id cpp/utils/modelgenerator/mixed-summary-models - * @tags modelgenerator - */ - -import internal.CaptureModels - -from DataFlowSummaryTargetApi api, string flow -where flow = captureMixedFlow(api, _) -select flow order by flow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql index 8a244cabe869..e9a5ea24deca 100644 --- a/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql +++ b/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSummaryTargetApi api, string noflow -where noflow = captureNoFlow(api) +where noflow = captureNeutral(api) select noflow order by noflow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql index 8cbcac192a27..5485a2645bcb 100644 --- a/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql +++ b/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql @@ -7,6 +7,7 @@ */ import internal.CaptureModels +import Heuristic from DataFlowSinkTargetApi api, string sink where sink = captureSink(api) diff --git a/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql index b4614634ce6a..c2240c646886 100644 --- a/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql +++ b/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql @@ -7,6 +7,7 @@ */ import internal.CaptureModels +import Heuristic from DataFlowSourceTargetApi api, string source where source = captureSource(api) diff --git a/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql index ba6921351725..60341abc0b59 100644 --- a/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql +++ b/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql @@ -9,5 +9,5 @@ import internal.CaptureModels from DataFlowSummaryTargetApi api, string flow -where flow = captureFlow(api) +where flow = captureFlow(api, _) select flow order by flow From a589014243300962367fb080b76990daec6e1c72 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Thu, 24 Apr 2025 13:13:33 +0200 Subject: [PATCH 229/240] C++: Update model generator tests. --- ...=> CaptureHeuristicSummaryModels.expected} | 0 ... => CaptureHeuristicSummaryModels.ext.yml} | 0 ...ls.ql => CaptureHeuristicSummaryModels.ql} | 4 +- .../modelgenerator/dataflow/summaries.cpp | 70 +++++++++---------- 4 files changed, 37 insertions(+), 37 deletions(-) rename cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/{CaptureSummaryModels.expected => CaptureHeuristicSummaryModels.expected} (100%) rename cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/{CaptureSummaryModels.ext.yml => CaptureHeuristicSummaryModels.ext.yml} (100%) rename cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/{CaptureSummaryModels.ql => CaptureHeuristicSummaryModels.ql} (59%) diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureHeuristicSummaryModels.expected similarity index 100% rename from cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected rename to cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureHeuristicSummaryModels.expected diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ext.yml similarity index 100% rename from cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml rename to cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ext.yml diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql similarity index 59% rename from cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql rename to cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql index 65ec6060e87b..3ab1dc6c4710 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureHeuristicSummaryModels.ql @@ -3,9 +3,9 @@ import utils.modelgenerator.internal.CaptureModels import InlineModelsAsDataTest module InlineMadTestConfig implements InlineMadTestConfigSig { - string getCapturedModel(MadRelevantFunction c) { result = captureFlow(c) } + string getCapturedModel(MadRelevantFunction c) { result = Heuristic::captureFlow(c) } - string getKind() { result = "summary" } + string getKind() { result = "heuristic-summary" } } import InlineMadTest diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp index 8b6da3e8ac57..d7dc9f70e13e 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp @@ -10,32 +10,32 @@ namespace Models { //No model as destructors are excluded from model generation. ~BasicFlow() = default; - //summary=Models;BasicFlow;true;returnThis;(int *);;Argument[-1];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnThis;(int *);;Argument[-1];ReturnValue[*];taint;df-generated //contentbased-summary=Models;BasicFlow;true;returnThis;(int *);;Argument[-1];ReturnValue[*];value;dfc-generated BasicFlow* returnThis(int* input) { return this; } - //summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[0];ReturnValue;taint;df-generated - //summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[*0];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[0];ReturnValue;taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[*0];ReturnValue[*];taint;df-generated //contentbased-summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[0];ReturnValue;value;dfc-generated //contentbased-summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[*0];ReturnValue[*];value;dfc-generated int* returnParam0(int* input0, int* input1) { return input0; } - //summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[1];ReturnValue;taint;df-generated - //summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[*1];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[1];ReturnValue;taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[*1];ReturnValue[*];taint;df-generated //contentbased-summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[1];ReturnValue;value;dfc-generated //contentbased-summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[*1];ReturnValue[*];value;dfc-generated int* returnParam1(int* input0, int* input1) { return input1; } - //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[1];ReturnValue;taint;df-generated - //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*1];ReturnValue[*];taint;df-generated - //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[2];ReturnValue;taint;df-generated - //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*2];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[1];ReturnValue;taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*1];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[2];ReturnValue;taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*2];ReturnValue[*];taint;df-generated //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[1];ReturnValue;value;dfc-generated //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*1];ReturnValue[*];value;dfc-generated //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[2];ReturnValue;value;dfc-generated @@ -44,11 +44,11 @@ namespace Models { return b ? input0 : input1; } - //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];Argument[*1];taint;df-generated - //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];ReturnValue[*];taint;df-generated - //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];ReturnValue[*];taint;df-generated - //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[1];ReturnValue;taint;df-generated - //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];Argument[*1];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];Argument[*1];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[1];ReturnValue;taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];Argument[*1];taint;df-generated //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];Argument[*1];taint;dfc-generated //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];ReturnValue[*];taint;dfc-generated //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];ReturnValue[*];value;dfc-generated @@ -58,16 +58,16 @@ namespace Models { return strcpy(dest, source + 1); } - //summary=Models;BasicFlow;true;setField;(int *);;Argument[0];Argument[-1];taint;df-generated - //summary=Models;BasicFlow;true;setField;(int *);;Argument[*0];Argument[-1];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;setField;(int *);;Argument[0];Argument[-1];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;setField;(int *);;Argument[*0];Argument[-1];taint;df-generated //contentbased-summary=Models;BasicFlow;true;setField;(int *);;Argument[0];Argument[-1].Field[*tainted];value;dfc-generated //contentbased-summary=Models;BasicFlow;true;setField;(int *);;Argument[*0];Argument[-1].Field[**tainted];value;dfc-generated void setField(int* s) { tainted = s; } - //summary=Models;BasicFlow;true;returnField;();;Argument[-1];ReturnValue;taint;df-generated - //summary=Models;BasicFlow;true;returnField;();;Argument[-1];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnField;();;Argument[-1];ReturnValue;taint;df-generated + //heuristic-summary=Models;BasicFlow;true;returnField;();;Argument[-1];ReturnValue[*];taint;df-generated //contentbased-summary=Models;BasicFlow;true;returnField;();;Argument[-1].Field[*tainted];ReturnValue;value;dfc-generated //contentbased-summary=Models;BasicFlow;true;returnField;();;Argument[-1].Field[**tainted];ReturnValue[*];value;dfc-generated int* returnField() { @@ -79,34 +79,34 @@ namespace Models { struct TemplatedFlow { T tainted; - //summary=Models;TemplatedFlow;true;template_returnThis;(T);;Argument[-1];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;TemplatedFlow;true;template_returnThis;(T);;Argument[-1];ReturnValue[*];taint;df-generated //contentbased-summary=Models;TemplatedFlow;true;template_returnThis;(T);;Argument[-1];ReturnValue[*];value;dfc-generated TemplatedFlow* template_returnThis(T input) { return this; } - //summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[0];ReturnValue;taint;df-generated - //summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[*0];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[0];ReturnValue;taint;df-generated + //heuristic-summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[*0];ReturnValue[*];taint;df-generated //contentbased-summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[0];ReturnValue;value;dfc-generated //contentbased-summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[*0];ReturnValue[*];value;dfc-generated T* template_returnParam0(T* input0, T* input1) { return input0; } - //summary=Models;TemplatedFlow;true;template_setField;(T);;Argument[0];Argument[-1];taint;df-generated + //heuristic-summary=Models;TemplatedFlow;true;template_setField;(T);;Argument[0];Argument[-1];taint;df-generated //contentbased-summary=Models;TemplatedFlow;true;template_setField;(T);;Argument[0];Argument[-1].Field[*tainted];value;dfc-generated void template_setField(T s) { tainted = s; } - //summary=Models;TemplatedFlow;true;template_returnField;();;Argument[-1];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;TemplatedFlow;true;template_returnField;();;Argument[-1];ReturnValue[*];taint;df-generated //contentbased-summary=Models;TemplatedFlow;true;template_returnField;();;Argument[-1].Field[*tainted];ReturnValue[*];value;dfc-generated T& template_returnField() { return tainted; } - //summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[0];ReturnValue;taint;df-generated - //summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[*0];ReturnValue[*];taint;df-generated + //heuristic-summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[0];ReturnValue;taint;df-generated + //heuristic-summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[*0];ReturnValue[*];taint;df-generated //contentbased-summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[0];ReturnValue;value;dfc-generated //contentbased-summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[*0];ReturnValue[*];value;dfc-generated template @@ -129,8 +129,8 @@ namespace Models { } } -//summary=;;true;toplevel_function;(int *);;Argument[0];ReturnValue;taint;df-generated -//summary=;;true;toplevel_function;(int *);;Argument[*0];ReturnValue;taint;df-generated +//heuristic-summary=;;true;toplevel_function;(int *);;Argument[0];ReturnValue;taint;df-generated +//heuristic-summary=;;true;toplevel_function;(int *);;Argument[*0];ReturnValue;taint;df-generated //contentbased-summary=;;true;toplevel_function;(int *);;Argument[0];ReturnValue;taint;dfc-generated //contentbased-summary=;;true;toplevel_function;(int *);;Argument[*0];ReturnValue;value;dfc-generated int toplevel_function(int* p) { @@ -143,13 +143,13 @@ static int static_toplevel_function(int* p) { } struct NonFinalStruct { - //summary=;NonFinalStruct;true;public_not_final_member_function;(int);;Argument[0];ReturnValue;taint;df-generated + //heuristic-summary=;NonFinalStruct;true;public_not_final_member_function;(int);;Argument[0];ReturnValue;taint;df-generated //contentbased-summary=;NonFinalStruct;true;public_not_final_member_function;(int);;Argument[0];ReturnValue;value;dfc-generated virtual int public_not_final_member_function(int x) { return x; } - //summary=;NonFinalStruct;false;public_final_member_function;(int);;Argument[0];ReturnValue;taint;df-generated + //heuristic-summary=;NonFinalStruct;false;public_final_member_function;(int);;Argument[0];ReturnValue;taint;df-generated //contentbased-summary=;NonFinalStruct;false;public_final_member_function;(int);;Argument[0];ReturnValue;value;dfc-generated virtual int public_final_member_function(int x) final { return x; @@ -169,13 +169,13 @@ struct NonFinalStruct { }; struct FinalStruct final { - //summary=;FinalStruct;false;public_not_final_member_function_2;(int);;Argument[0];ReturnValue;taint;df-generated + //heuristic-summary=;FinalStruct;false;public_not_final_member_function_2;(int);;Argument[0];ReturnValue;taint;df-generated //contentbased-summary=;FinalStruct;false;public_not_final_member_function_2;(int);;Argument[0];ReturnValue;value;dfc-generated virtual int public_not_final_member_function_2(int x) { return x; } - //summary=;FinalStruct;false;public_final_member_function_2;(int);;Argument[0];ReturnValue;taint;df-generated + //heuristic-summary=;FinalStruct;false;public_final_member_function_2;(int);;Argument[0];ReturnValue;taint;df-generated //contentbased-summary=;FinalStruct;false;public_final_member_function_2;(int);;Argument[0];ReturnValue;value;dfc-generated virtual int public_final_member_function_2(int x) final { return x; @@ -186,16 +186,16 @@ union U { int x, y; }; -//summary=;;true;get_x_from_union;(U *);;Argument[0];ReturnValue;taint;df-generated -//summary=;;true;get_x_from_union;(U *);;Argument[*0];ReturnValue;taint;df-generated +//heuristic-summary=;;true;get_x_from_union;(U *);;Argument[0];ReturnValue;taint;df-generated +//heuristic-summary=;;true;get_x_from_union;(U *);;Argument[*0];ReturnValue;taint;df-generated //contentbased-summary=;;true;get_x_from_union;(U *);;Argument[0];ReturnValue;taint;dfc-generated //contentbased-summary=;;true;get_x_from_union;(U *);;Argument[*0].Union[*U];ReturnValue;value;dfc-generated int get_x_from_union(U* u) { return u->x; } -//summary=;;true;set_x_in_union;(U *,int);;Argument[1];Argument[*0];taint;df-generated +//heuristic-summary=;;true;set_x_in_union;(U *,int);;Argument[1];Argument[*0];taint;df-generated //contentbased-summary=;;true;set_x_in_union;(U *,int);;Argument[1];Argument[*0].Union[*U];value;dfc-generated void set_x_in_union(U* u, int x) { u->x = x; -} \ No newline at end of file +} From de122225e84b3e4b08eb7c47e232f69988997016 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 25 Apr 2025 15:52:36 +0200 Subject: [PATCH 230/240] C#/Rust: Update integration test expected output. --- .../posix/query-suite/not_included_in_qls.expected | 2 -- .../integration-tests/query-suite/not_included_in_qls.expected | 2 -- 2 files changed, 4 deletions(-) diff --git a/csharp/ql/integration-tests/posix/query-suite/not_included_in_qls.expected b/csharp/ql/integration-tests/posix/query-suite/not_included_in_qls.expected index 23bdca4394bf..9604a4aed64e 100644 --- a/csharp/ql/integration-tests/posix/query-suite/not_included_in_qls.expected +++ b/csharp/ql/integration-tests/posix/query-suite/not_included_in_qls.expected @@ -117,8 +117,6 @@ ql/csharp/ql/src/utils/modelconverter/ExtractSummaries.ql ql/csharp/ql/src/utils/modeleditor/ApplicationModeEndpoints.ql ql/csharp/ql/src/utils/modeleditor/FrameworkModeEndpoints.ql ql/csharp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql -ql/csharp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql -ql/csharp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql ql/csharp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql ql/csharp/ql/src/utils/modelgenerator/CaptureSinkModels.ql ql/csharp/ql/src/utils/modelgenerator/CaptureSourceModels.ql diff --git a/rust/ql/integration-tests/query-suite/not_included_in_qls.expected b/rust/ql/integration-tests/query-suite/not_included_in_qls.expected index a2ce74fe4df8..a719b933bc07 100644 --- a/rust/ql/integration-tests/query-suite/not_included_in_qls.expected +++ b/rust/ql/integration-tests/query-suite/not_included_in_qls.expected @@ -6,8 +6,6 @@ ql/rust/ql/src/queries/summary/TaintSources.ql ql/rust/ql/src/queries/unusedentities/UnreachableCode.ql ql/rust/ql/src/queries/unusedentities/UnusedValue.ql ql/rust/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql -ql/rust/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql -ql/rust/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql ql/rust/ql/src/utils/modelgenerator/CaptureNeutralModels.ql ql/rust/ql/src/utils/modelgenerator/CaptureSinkModels.ql ql/rust/ql/src/utils/modelgenerator/CaptureSourceModels.ql From 9cfa4514772c252d39b17a28f23dc928672383f7 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 25 Apr 2025 15:41:35 +0100 Subject: [PATCH 231/240] Go: Fix/improve comment about environment variable preservation --- go/extractor/util/registryproxy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go/extractor/util/registryproxy.go b/go/extractor/util/registryproxy.go index a0d86bdb0863..85bc03a62a8c 100644 --- a/go/extractor/util/registryproxy.go +++ b/go/extractor/util/registryproxy.go @@ -133,7 +133,8 @@ func ApplyProxyEnvVars(cmd *exec.Cmd) { } // If the proxy is configured, `proxy_vars` will be not `nil`. We append those - // variables Preserve environment variables + // variables to the existing environment to preserve those environment variables. + // If `cmd.Env` is not changed, then the existing environment is also preserved. if proxy_vars != nil { cmd.Env = append(os.Environ(), proxy_vars...) } From 5172a4d6ec381ae3e6e4453da3b0b2907e83ac2a Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 25 Apr 2025 15:41:57 +0100 Subject: [PATCH 232/240] Go: Remove check from `getEnvVars` --- go/extractor/util/registryproxy.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/go/extractor/util/registryproxy.go b/go/extractor/util/registryproxy.go index 85bc03a62a8c..35c592964a37 100644 --- a/go/extractor/util/registryproxy.go +++ b/go/extractor/util/registryproxy.go @@ -48,13 +48,6 @@ func parseRegistryConfigs(str string) ([]RegistryConfig, error) { } func getEnvVars() []string { - // If `proxy_vars` has been initialised, then we have already performed - // these checks and don't need to do so again. We assume that the environment - // variables are constant throughout the run of the autobuilder. - if proxy_vars != nil { - return proxy_vars - } - var result []string if proxy_host, proxy_host_set := os.LookupEnv(PROXY_HOST); proxy_host_set { From 91a794433ae8d5dafb5bab604fdeef61d64e61f0 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 25 Apr 2025 15:42:29 +0100 Subject: [PATCH 233/240] Go: Change "Unable" to "Failed" for consistency --- go/extractor/util/registryproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/extractor/util/registryproxy.go b/go/extractor/util/registryproxy.go index 35c592964a37..43eaa461032a 100644 --- a/go/extractor/util/registryproxy.go +++ b/go/extractor/util/registryproxy.go @@ -65,7 +65,7 @@ func getEnvVars() []string { f, err := os.CreateTemp("", "codeql-proxy.crt") if err != nil { - slog.Error("Unable to create temporary file for the proxy certificate", slog.String("error", err.Error())) + slog.Error("Failed to create temporary file for the proxy certificate", slog.String("error", err.Error())) } _, err = f.WriteString(proxy_cert) From 7592ce47e3cb2ba4ccfb9cc75a975ee6047fb245 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 25 Apr 2025 15:45:12 +0100 Subject: [PATCH 234/240] Go: Restore `parseRegistryConfigsFail` test for the empty string --- go/extractor/util/registryproxy_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/extractor/util/registryproxy_test.go b/go/extractor/util/registryproxy_test.go index b5fde50347f2..a21b1a215c11 100644 --- a/go/extractor/util/registryproxy_test.go +++ b/go/extractor/util/registryproxy_test.go @@ -23,7 +23,7 @@ func parseRegistryConfigsSuccess(t *testing.T, str string) []RegistryConfig { } func TestParseRegistryConfigs(t *testing.T) { - // parseRegistryConfigsFail(t, "") + parseRegistryConfigsFail(t, "") empty := parseRegistryConfigsSuccess(t, "[]") From 70a3fe3e33da04094a1d397eeba19a27a007640e Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Mon, 28 Apr 2025 10:09:33 +0100 Subject: [PATCH 235/240] Add YAML front matter to change note --- .../src/change-notes/2025-04-24-model-generator-queries.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/actions/ql/src/change-notes/2025-04-24-model-generator-queries.md b/actions/ql/src/change-notes/2025-04-24-model-generator-queries.md index a7f9675af3b9..7f300186744b 100644 --- a/actions/ql/src/change-notes/2025-04-24-model-generator-queries.md +++ b/actions/ql/src/change-notes/2025-04-24-model-generator-queries.md @@ -1,4 +1,6 @@ -### Breaking Changes +--- +category: breaking +--- * The following queries have been removed from the `security-and-quality` suite. They are not intended to produce user-facing @@ -11,4 +13,4 @@ (renamed from `actions/reusable-wokflow-sinks`) * `actions/reusable-workflow-sources` * `actions/reusable-workflow-summaries` - \ No newline at end of file + From b61a87a2a331f404c8a410a8a2674f9987b39320 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Mon, 28 Apr 2025 11:13:30 +0100 Subject: [PATCH 236/240] Update integration test to match update to security-and-quality suite --- .../query-suite/actions-security-and-quality.qls.expected | 6 ------ .../query-suite/not_included_in_qls.expected | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/actions/ql/integration-tests/query-suite/actions-security-and-quality.qls.expected b/actions/ql/integration-tests/query-suite/actions-security-and-quality.qls.expected index cadb6202fde6..d071a33c1861 100644 --- a/actions/ql/integration-tests/query-suite/actions-security-and-quality.qls.expected +++ b/actions/ql/integration-tests/query-suite/actions-security-and-quality.qls.expected @@ -1,10 +1,4 @@ ql/actions/ql/src/Debug/SyntaxError.ql -ql/actions/ql/src/Models/CompositeActionsSinks.ql -ql/actions/ql/src/Models/CompositeActionsSources.ql -ql/actions/ql/src/Models/CompositeActionsSummaries.ql -ql/actions/ql/src/Models/ReusableWorkflowsSinks.ql -ql/actions/ql/src/Models/ReusableWorkflowsSources.ql -ql/actions/ql/src/Models/ReusableWorkflowsSummaries.ql ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql ql/actions/ql/src/Security/CWE-077/EnvPathInjectionMedium.ql ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql diff --git a/actions/ql/integration-tests/query-suite/not_included_in_qls.expected b/actions/ql/integration-tests/query-suite/not_included_in_qls.expected index 8763955a8e40..6ed0a557462b 100644 --- a/actions/ql/integration-tests/query-suite/not_included_in_qls.expected +++ b/actions/ql/integration-tests/query-suite/not_included_in_qls.expected @@ -1,4 +1,10 @@ ql/actions/ql/src/Debug/partial.ql +ql/actions/ql/src/Models/CompositeActionsSinks.ql +ql/actions/ql/src/Models/CompositeActionsSources.ql +ql/actions/ql/src/Models/CompositeActionsSummaries.ql +ql/actions/ql/src/Models/ReusableWorkflowsSinks.ql +ql/actions/ql/src/Models/ReusableWorkflowsSources.ql +ql/actions/ql/src/Models/ReusableWorkflowsSummaries.ql ql/actions/ql/src/experimental/Security/CWE-074/OutputClobberingHigh.ql ql/actions/ql/src/experimental/Security/CWE-078/CommandInjectionCritical.ql ql/actions/ql/src/experimental/Security/CWE-078/CommandInjectionMedium.ql From 625354c46e0284b79c269cfdfc376bbdf80e70d5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 28 Apr 2025 10:55:22 +0000 Subject: [PATCH 237/240] Release preparation for version 2.21.2 --- actions/ql/lib/CHANGELOG.md | 4 ++++ actions/ql/lib/change-notes/released/0.4.8.md | 3 +++ actions/ql/lib/codeql-pack.release.yml | 2 +- actions/ql/lib/qlpack.yml | 2 +- actions/ql/src/CHANGELOG.md | 20 +++++++++++++++++++ ...sive-secrets-exposure-security-severity.md | 4 ---- .../0.6.0.md} | 11 ++++++---- actions/ql/src/codeql-pack.release.yml | 2 +- actions/ql/src/qlpack.yml | 2 +- cpp/ql/lib/CHANGELOG.md | 9 +++++++++ .../2025-04-14-variable-length-arrays.md | 4 ---- .../2025-04-15-field-array-designator.md | 4 ---- .../4.3.0.md} | 9 ++++++--- cpp/ql/lib/codeql-pack.release.yml | 2 +- cpp/ql/lib/qlpack.yml | 2 +- cpp/ql/src/CHANGELOG.md | 4 ++++ cpp/ql/src/change-notes/released/1.3.9.md | 3 +++ cpp/ql/src/codeql-pack.release.yml | 2 +- cpp/ql/src/qlpack.yml | 2 +- .../ql/campaigns/Solorigate/lib/CHANGELOG.md | 4 ++++ .../lib/change-notes/released/1.7.39.md | 3 +++ .../Solorigate/lib/codeql-pack.release.yml | 2 +- csharp/ql/campaigns/Solorigate/lib/qlpack.yml | 2 +- .../ql/campaigns/Solorigate/src/CHANGELOG.md | 4 ++++ .../src/change-notes/released/1.7.39.md | 3 +++ .../Solorigate/src/codeql-pack.release.yml | 2 +- csharp/ql/campaigns/Solorigate/src/qlpack.yml | 2 +- csharp/ql/lib/CHANGELOG.md | 6 ++++++ .../5.1.5.md} | 7 ++++--- csharp/ql/lib/codeql-pack.release.yml | 2 +- csharp/ql/lib/qlpack.yml | 2 +- csharp/ql/src/CHANGELOG.md | 8 ++++++++ .../2025-04-10-invalid-string-format.md | 4 ---- ...5-missing-function-level-access-control.md | 4 ---- .../1.1.2.md} | 9 ++++++--- csharp/ql/src/codeql-pack.release.yml | 2 +- csharp/ql/src/qlpack.yml | 2 +- go/ql/consistency-queries/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.22.md | 3 +++ .../codeql-pack.release.yml | 2 +- go/ql/consistency-queries/qlpack.yml | 2 +- go/ql/lib/CHANGELOG.md | 4 ++++ go/ql/lib/change-notes/released/4.2.4.md | 3 +++ go/ql/lib/codeql-pack.release.yml | 2 +- go/ql/lib/qlpack.yml | 2 +- go/ql/src/CHANGELOG.md | 4 ++++ go/ql/src/change-notes/released/1.1.13.md | 3 +++ go/ql/src/codeql-pack.release.yml | 2 +- go/ql/src/qlpack.yml | 2 +- java/ql/lib/CHANGELOG.md | 4 ++++ java/ql/lib/change-notes/released/7.1.4.md | 3 +++ java/ql/lib/codeql-pack.release.yml | 2 +- java/ql/lib/qlpack.yml | 2 +- java/ql/src/CHANGELOG.md | 6 ++++++ .../1.4.2.md} | 9 +++++---- java/ql/src/codeql-pack.release.yml | 2 +- java/ql/src/qlpack.yml | 2 +- javascript/ql/lib/CHANGELOG.md | 4 ++++ .../ql/lib/change-notes/released/2.6.2.md | 3 +++ javascript/ql/lib/codeql-pack.release.yml | 2 +- javascript/ql/lib/qlpack.yml | 2 +- javascript/ql/src/CHANGELOG.md | 4 ++++ .../ql/src/change-notes/released/1.5.4.md | 3 +++ javascript/ql/src/codeql-pack.release.yml | 2 +- javascript/ql/src/qlpack.yml | 2 +- misc/suite-helpers/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.22.md | 3 +++ misc/suite-helpers/codeql-pack.release.yml | 2 +- misc/suite-helpers/qlpack.yml | 2 +- python/ql/lib/CHANGELOG.md | 4 ++++ python/ql/lib/change-notes/released/4.0.6.md | 3 +++ python/ql/lib/codeql-pack.release.yml | 2 +- python/ql/lib/qlpack.yml | 2 +- python/ql/src/CHANGELOG.md | 4 ++++ python/ql/src/change-notes/released/1.4.8.md | 3 +++ python/ql/src/codeql-pack.release.yml | 2 +- python/ql/src/qlpack.yml | 2 +- ruby/ql/lib/CHANGELOG.md | 4 ++++ ruby/ql/lib/change-notes/released/4.1.5.md | 3 +++ ruby/ql/lib/codeql-pack.release.yml | 2 +- ruby/ql/lib/qlpack.yml | 2 +- ruby/ql/src/CHANGELOG.md | 4 ++++ ruby/ql/src/change-notes/released/1.2.1.md | 3 +++ ruby/ql/src/codeql-pack.release.yml | 2 +- ruby/ql/src/qlpack.yml | 2 +- rust/ql/lib/CHANGELOG.md | 4 ++++ rust/ql/lib/change-notes/released/0.1.7.md | 3 +++ rust/ql/lib/codeql-pack.release.yml | 2 +- rust/ql/lib/qlpack.yml | 2 +- rust/ql/src/CHANGELOG.md | 6 ++++++ .../0.1.7.md} | 9 +++++---- rust/ql/src/codeql-pack.release.yml | 2 +- rust/ql/src/qlpack.yml | 2 +- shared/controlflow/CHANGELOG.md | 4 ++++ .../change-notes/released/2.0.6.md | 3 +++ shared/controlflow/codeql-pack.release.yml | 2 +- shared/controlflow/qlpack.yml | 2 +- shared/dataflow/CHANGELOG.md | 4 ++++ .../dataflow/change-notes/released/2.0.6.md | 3 +++ shared/dataflow/codeql-pack.release.yml | 2 +- shared/dataflow/qlpack.yml | 2 +- shared/mad/CHANGELOG.md | 4 ++++ shared/mad/change-notes/released/1.0.22.md | 3 +++ shared/mad/codeql-pack.release.yml | 2 +- shared/mad/qlpack.yml | 2 +- shared/rangeanalysis/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.22.md | 3 +++ shared/rangeanalysis/codeql-pack.release.yml | 2 +- shared/rangeanalysis/qlpack.yml | 2 +- shared/regex/CHANGELOG.md | 4 ++++ shared/regex/change-notes/released/1.0.22.md | 3 +++ shared/regex/codeql-pack.release.yml | 2 +- shared/regex/qlpack.yml | 2 +- shared/ssa/CHANGELOG.md | 4 ++++ shared/ssa/change-notes/released/1.1.1.md | 3 +++ shared/ssa/codeql-pack.release.yml | 2 +- shared/ssa/qlpack.yml | 2 +- shared/threat-models/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.22.md | 3 +++ shared/threat-models/codeql-pack.release.yml | 2 +- shared/threat-models/qlpack.yml | 2 +- shared/tutorial/CHANGELOG.md | 4 ++++ .../tutorial/change-notes/released/1.0.22.md | 3 +++ shared/tutorial/codeql-pack.release.yml | 2 +- shared/tutorial/qlpack.yml | 2 +- shared/typeflow/CHANGELOG.md | 4 ++++ .../typeflow/change-notes/released/1.0.22.md | 3 +++ shared/typeflow/codeql-pack.release.yml | 2 +- shared/typeflow/qlpack.yml | 2 +- shared/typeinference/CHANGELOG.md | 4 ++++ .../change-notes/released/0.0.3.md | 3 +++ shared/typeinference/codeql-pack.release.yml | 2 +- shared/typeinference/qlpack.yml | 2 +- shared/typetracking/CHANGELOG.md | 4 ++++ .../change-notes/released/2.0.6.md | 3 +++ shared/typetracking/codeql-pack.release.yml | 2 +- shared/typetracking/qlpack.yml | 2 +- shared/typos/CHANGELOG.md | 4 ++++ shared/typos/change-notes/released/1.0.22.md | 3 +++ shared/typos/codeql-pack.release.yml | 2 +- shared/typos/qlpack.yml | 2 +- shared/util/CHANGELOG.md | 4 ++++ shared/util/change-notes/released/2.0.9.md | 3 +++ shared/util/codeql-pack.release.yml | 2 +- shared/util/qlpack.yml | 2 +- shared/xml/CHANGELOG.md | 4 ++++ shared/xml/change-notes/released/1.0.22.md | 3 +++ shared/xml/codeql-pack.release.yml | 2 +- shared/xml/qlpack.yml | 2 +- shared/yaml/CHANGELOG.md | 4 ++++ shared/yaml/change-notes/released/1.0.22.md | 3 +++ shared/yaml/codeql-pack.release.yml | 2 +- shared/yaml/qlpack.yml | 2 +- swift/ql/lib/CHANGELOG.md | 12 +++++++++++ .../lib/change-notes/2025-04-23-swift-6.1.md | 4 ---- .../4.2.0.md} | 11 +++++++--- swift/ql/lib/codeql-pack.release.yml | 2 +- swift/ql/lib/qlpack.yml | 2 +- swift/ql/src/CHANGELOG.md | 4 ++++ swift/ql/src/change-notes/released/1.1.2.md | 3 +++ swift/ql/src/codeql-pack.release.yml | 2 +- swift/ql/src/qlpack.yml | 2 +- 162 files changed, 410 insertions(+), 126 deletions(-) create mode 100644 actions/ql/lib/change-notes/released/0.4.8.md delete mode 100644 actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md rename actions/ql/src/change-notes/{2025-04-24-model-generator-queries.md => released/0.6.0.md} (80%) delete mode 100644 cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md delete mode 100644 cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md rename cpp/ql/lib/change-notes/{2025-04-23-typeof.md => released/4.3.0.md} (60%) create mode 100644 cpp/ql/src/change-notes/released/1.3.9.md create mode 100644 csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.39.md create mode 100644 csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.39.md rename csharp/ql/lib/change-notes/{2025-04-11-auto-builder-sdk.md => released/5.1.5.md} (72%) delete mode 100644 csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md delete mode 100644 csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md rename csharp/ql/src/change-notes/{2025-04-16-model-generation.md => released/1.1.2.md} (55%) create mode 100644 go/ql/consistency-queries/change-notes/released/1.0.22.md create mode 100644 go/ql/lib/change-notes/released/4.2.4.md create mode 100644 go/ql/src/change-notes/released/1.1.13.md create mode 100644 java/ql/lib/change-notes/released/7.1.4.md rename java/ql/src/change-notes/{2025-04-16-model-generation.md => released/1.4.2.md} (89%) create mode 100644 javascript/ql/lib/change-notes/released/2.6.2.md create mode 100644 javascript/ql/src/change-notes/released/1.5.4.md create mode 100644 misc/suite-helpers/change-notes/released/1.0.22.md create mode 100644 python/ql/lib/change-notes/released/4.0.6.md create mode 100644 python/ql/src/change-notes/released/1.4.8.md create mode 100644 ruby/ql/lib/change-notes/released/4.1.5.md create mode 100644 ruby/ql/src/change-notes/released/1.2.1.md create mode 100644 rust/ql/lib/change-notes/released/0.1.7.md rename rust/ql/src/change-notes/{2025-04-16-model-generation.md => released/0.1.7.md} (89%) create mode 100644 shared/controlflow/change-notes/released/2.0.6.md create mode 100644 shared/dataflow/change-notes/released/2.0.6.md create mode 100644 shared/mad/change-notes/released/1.0.22.md create mode 100644 shared/rangeanalysis/change-notes/released/1.0.22.md create mode 100644 shared/regex/change-notes/released/1.0.22.md create mode 100644 shared/ssa/change-notes/released/1.1.1.md create mode 100644 shared/threat-models/change-notes/released/1.0.22.md create mode 100644 shared/tutorial/change-notes/released/1.0.22.md create mode 100644 shared/typeflow/change-notes/released/1.0.22.md create mode 100644 shared/typeinference/change-notes/released/0.0.3.md create mode 100644 shared/typetracking/change-notes/released/2.0.6.md create mode 100644 shared/typos/change-notes/released/1.0.22.md create mode 100644 shared/util/change-notes/released/2.0.9.md create mode 100644 shared/xml/change-notes/released/1.0.22.md create mode 100644 shared/yaml/change-notes/released/1.0.22.md delete mode 100644 swift/ql/lib/change-notes/2025-04-23-swift-6.1.md rename swift/ql/lib/change-notes/{2025-04-14-new-entities.md => released/4.2.0.md} (60%) create mode 100644 swift/ql/src/change-notes/released/1.1.2.md diff --git a/actions/ql/lib/CHANGELOG.md b/actions/ql/lib/CHANGELOG.md index dff1b84f1ada..0adf75f4cc0d 100644 --- a/actions/ql/lib/CHANGELOG.md +++ b/actions/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.8 + +No user-facing changes. + ## 0.4.7 No user-facing changes. diff --git a/actions/ql/lib/change-notes/released/0.4.8.md b/actions/ql/lib/change-notes/released/0.4.8.md new file mode 100644 index 000000000000..f73372210b68 --- /dev/null +++ b/actions/ql/lib/change-notes/released/0.4.8.md @@ -0,0 +1,3 @@ +## 0.4.8 + +No user-facing changes. diff --git a/actions/ql/lib/codeql-pack.release.yml b/actions/ql/lib/codeql-pack.release.yml index c5db8c0b276c..3c75bfd1a471 100644 --- a/actions/ql/lib/codeql-pack.release.yml +++ b/actions/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.4.7 +lastReleaseVersion: 0.4.8 diff --git a/actions/ql/lib/qlpack.yml b/actions/ql/lib/qlpack.yml index 31e85dd618ae..d4598e6cdfb3 100644 --- a/actions/ql/lib/qlpack.yml +++ b/actions/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-all -version: 0.4.8-dev +version: 0.4.8 library: true warnOnImplicitThis: true dependencies: diff --git a/actions/ql/src/CHANGELOG.md b/actions/ql/src/CHANGELOG.md index 4d8755d009ea..4faccf28ebd9 100644 --- a/actions/ql/src/CHANGELOG.md +++ b/actions/ql/src/CHANGELOG.md @@ -1,3 +1,23 @@ +## 0.6.0 + +### Breaking Changes + +* The following queries have been removed from the `security-and-quality` suite. + They are not intended to produce user-facing + alerts describing vulnerabilities. + Any existing alerts for these queries will be closed automatically. + * `actions/composite-action-sinks` + * `actions/composite-action-sources` + * `actions/composite-action-summaries` + * `actions/reusable-workflow-sinks` + (renamed from `actions/reusable-wokflow-sinks`) + * `actions/reusable-workflow-sources` + * `actions/reusable-workflow-summaries` + +### Bug Fixes + +* Assigned a `security-severity` to the query `actions/excessive-secrets-exposure`. + ## 0.5.4 ### Bug Fixes diff --git a/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md b/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md deleted file mode 100644 index c59e1eb9db33..000000000000 --- a/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: fix ---- -* Assigned a `security-severity` to the query `actions/excessive-secrets-exposure`. \ No newline at end of file diff --git a/actions/ql/src/change-notes/2025-04-24-model-generator-queries.md b/actions/ql/src/change-notes/released/0.6.0.md similarity index 80% rename from actions/ql/src/change-notes/2025-04-24-model-generator-queries.md rename to actions/ql/src/change-notes/released/0.6.0.md index 7f300186744b..a840885a3182 100644 --- a/actions/ql/src/change-notes/2025-04-24-model-generator-queries.md +++ b/actions/ql/src/change-notes/released/0.6.0.md @@ -1,6 +1,6 @@ ---- -category: breaking ---- +## 0.6.0 + +### Breaking Changes * The following queries have been removed from the `security-and-quality` suite. They are not intended to produce user-facing @@ -13,4 +13,7 @@ category: breaking (renamed from `actions/reusable-wokflow-sinks`) * `actions/reusable-workflow-sources` * `actions/reusable-workflow-summaries` - + +### Bug Fixes + +* Assigned a `security-severity` to the query `actions/excessive-secrets-exposure`. diff --git a/actions/ql/src/codeql-pack.release.yml b/actions/ql/src/codeql-pack.release.yml index cd3f72e25138..a3f820f884d3 100644 --- a/actions/ql/src/codeql-pack.release.yml +++ b/actions/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.5.4 +lastReleaseVersion: 0.6.0 diff --git a/actions/ql/src/qlpack.yml b/actions/ql/src/qlpack.yml index e8af2efb3372..242fd24d7289 100644 --- a/actions/ql/src/qlpack.yml +++ b/actions/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-queries -version: 0.5.5-dev +version: 0.6.0 library: false warnOnImplicitThis: true groups: [actions, queries] diff --git a/cpp/ql/lib/CHANGELOG.md b/cpp/ql/lib/CHANGELOG.md index 12e0280ec55e..c66e7d7cd550 100644 --- a/cpp/ql/lib/CHANGELOG.md +++ b/cpp/ql/lib/CHANGELOG.md @@ -1,3 +1,12 @@ +## 4.3.0 + +### New Features + +* New classes `TypeofType`, `TypeofExprType`, and `TypeofTypeType` were introduced, which represent the C23 `typeof` and `typeof_unqual` operators. The `TypeofExprType` class represents the variant taking an expression as its argument. The `TypeofTypeType` class represents the variant taking a type as its argument. +* A new class `IntrinsicTransformedType` was introduced, which represents the type transforming intrinsics supported by clang, gcc, and MSVC. +* Introduced `hasDesignator()` predicates to distinguish between designated and positional initializations for both struct/union fields and array elements. +* Added the `isVla()` predicate to the `ArrayType` class. This allows queries to identify variable-length arrays (VLAs). + ## 4.2.0 ### New Features diff --git a/cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md b/cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md deleted file mode 100644 index e7e6cfb849e8..000000000000 --- a/cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: feature ---- -* Added the `isVla()` predicate to the `ArrayType` class. This allows queries to identify variable-length arrays (VLAs). \ No newline at end of file diff --git a/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md deleted file mode 100644 index c621bb499e33..000000000000 --- a/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: feature ---- -* Introduced `hasDesignator()` predicates to distinguish between designated and positional initializations for both struct/union fields and array elements. \ No newline at end of file diff --git a/cpp/ql/lib/change-notes/2025-04-23-typeof.md b/cpp/ql/lib/change-notes/released/4.3.0.md similarity index 60% rename from cpp/ql/lib/change-notes/2025-04-23-typeof.md rename to cpp/ql/lib/change-notes/released/4.3.0.md index eb41e3b52bdf..9dd7685b5df2 100644 --- a/cpp/ql/lib/change-notes/2025-04-23-typeof.md +++ b/cpp/ql/lib/change-notes/released/4.3.0.md @@ -1,5 +1,8 @@ ---- -category: feature ---- +## 4.3.0 + +### New Features + * New classes `TypeofType`, `TypeofExprType`, and `TypeofTypeType` were introduced, which represent the C23 `typeof` and `typeof_unqual` operators. The `TypeofExprType` class represents the variant taking an expression as its argument. The `TypeofTypeType` class represents the variant taking a type as its argument. * A new class `IntrinsicTransformedType` was introduced, which represents the type transforming intrinsics supported by clang, gcc, and MSVC. +* Introduced `hasDesignator()` predicates to distinguish between designated and positional initializations for both struct/union fields and array elements. +* Added the `isVla()` predicate to the `ArrayType` class. This allows queries to identify variable-length arrays (VLAs). diff --git a/cpp/ql/lib/codeql-pack.release.yml b/cpp/ql/lib/codeql-pack.release.yml index 9fc6933b429f..c46c103a0bd7 100644 --- a/cpp/ql/lib/codeql-pack.release.yml +++ b/cpp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.2.0 +lastReleaseVersion: 4.3.0 diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index cc728434ef24..81d4e6e33395 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 4.2.1-dev +version: 4.3.0 groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/src/CHANGELOG.md b/cpp/ql/src/CHANGELOG.md index 300c4ce90644..daad17e01685 100644 --- a/cpp/ql/src/CHANGELOG.md +++ b/cpp/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.9 + +No user-facing changes. + ## 1.3.8 No user-facing changes. diff --git a/cpp/ql/src/change-notes/released/1.3.9.md b/cpp/ql/src/change-notes/released/1.3.9.md new file mode 100644 index 000000000000..7c49d60db954 --- /dev/null +++ b/cpp/ql/src/change-notes/released/1.3.9.md @@ -0,0 +1,3 @@ +## 1.3.9 + +No user-facing changes. diff --git a/cpp/ql/src/codeql-pack.release.yml b/cpp/ql/src/codeql-pack.release.yml index 898725a6deb4..5ce113f4464d 100644 --- a/cpp/ql/src/codeql-pack.release.yml +++ b/cpp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.3.8 +lastReleaseVersion: 1.3.9 diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index c62bc64277e8..6466daf58cc2 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 1.3.9-dev +version: 1.3.9 groups: - cpp - queries diff --git a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md index 1edcbdb24a9c..d4414a3f145f 100644 --- a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.39 + +No user-facing changes. + ## 1.7.38 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.39.md b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.39.md new file mode 100644 index 000000000000..d42d76e11678 --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.39.md @@ -0,0 +1,3 @@ +## 1.7.39 + +No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml index a51e8a3b31ec..aba298841840 100644 --- a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.7.38 +lastReleaseVersion: 1.7.39 diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index 403da4292813..00e256471506 100644 --- a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-all -version: 1.7.39-dev +version: 1.7.39 groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md index 1edcbdb24a9c..d4414a3f145f 100644 --- a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.39 + +No user-facing changes. + ## 1.7.38 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.39.md b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.39.md new file mode 100644 index 000000000000..d42d76e11678 --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.39.md @@ -0,0 +1,3 @@ +## 1.7.39 + +No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml index a51e8a3b31ec..aba298841840 100644 --- a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.7.38 +lastReleaseVersion: 1.7.39 diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index 888f784b86d8..38faa5645955 100644 --- a/csharp/ql/campaigns/Solorigate/src/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-queries -version: 1.7.39-dev +version: 1.7.39 groups: - csharp - solorigate diff --git a/csharp/ql/lib/CHANGELOG.md b/csharp/ql/lib/CHANGELOG.md index a048eceacd56..11a9350f81ae 100644 --- a/csharp/ql/lib/CHANGELOG.md +++ b/csharp/ql/lib/CHANGELOG.md @@ -1,3 +1,9 @@ +## 5.1.5 + +### Minor Analysis Improvements + +* Improved autobuilder logic for detecting whether a project references a SDK (and should be built using `dotnet`). + ## 5.1.4 ### Minor Analysis Improvements diff --git a/csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md b/csharp/ql/lib/change-notes/released/5.1.5.md similarity index 72% rename from csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md rename to csharp/ql/lib/change-notes/released/5.1.5.md index 1ab0153786fd..1af065c3c714 100644 --- a/csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md +++ b/csharp/ql/lib/change-notes/released/5.1.5.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- +## 5.1.5 + +### Minor Analysis Improvements + * Improved autobuilder logic for detecting whether a project references a SDK (and should be built using `dotnet`). diff --git a/csharp/ql/lib/codeql-pack.release.yml b/csharp/ql/lib/codeql-pack.release.yml index bdf3511eb7af..fee027332511 100644 --- a/csharp/ql/lib/codeql-pack.release.yml +++ b/csharp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 5.1.4 +lastReleaseVersion: 5.1.5 diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index db0a477a5cdc..2c840d1a3f6a 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 5.1.5-dev +version: 5.1.5 groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/src/CHANGELOG.md b/csharp/ql/src/CHANGELOG.md index 7b5bee182988..4c76f4bd170f 100644 --- a/csharp/ql/src/CHANGELOG.md +++ b/csharp/ql/src/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.1.2 + +### Minor Analysis Improvements + +* Changes to the MaD model generation infrastructure: Changed the query `cs/utils/modelgenerator/summary-models` to use the implementation from `cs/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `cs/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `cs/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). +* Improved detection of authorization checks in the `cs/web/missing-function-level-access-control` query. The query now recognizes authorization attributes inherited from base classes and interfaces. +* The precision of the query `cs/invalid-string-formatting` has been improved. More methods and more overloads of existing format like methods are taken into account by the query. + ## 1.1.1 ### Minor Analysis Improvements diff --git a/csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md b/csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md deleted file mode 100644 index 1d1d424d985f..000000000000 --- a/csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* The precision of the query `cs/invalid-string-formatting` has been improved. More methods and more overloads of existing format like methods are taken into account by the query. diff --git a/csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md b/csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md deleted file mode 100644 index dbea56dbeb84..000000000000 --- a/csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Improved detection of authorization checks in the `cs/web/missing-function-level-access-control` query. The query now recognizes authorization attributes inherited from base classes and interfaces. diff --git a/csharp/ql/src/change-notes/2025-04-16-model-generation.md b/csharp/ql/src/change-notes/released/1.1.2.md similarity index 55% rename from csharp/ql/src/change-notes/2025-04-16-model-generation.md rename to csharp/ql/src/change-notes/released/1.1.2.md index 4c8c89c88455..082e88ead7ac 100644 --- a/csharp/ql/src/change-notes/2025-04-16-model-generation.md +++ b/csharp/ql/src/change-notes/released/1.1.2.md @@ -1,4 +1,7 @@ ---- -category: minorAnalysis ---- +## 1.1.2 + +### Minor Analysis Improvements + * Changes to the MaD model generation infrastructure: Changed the query `cs/utils/modelgenerator/summary-models` to use the implementation from `cs/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `cs/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `cs/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). +* Improved detection of authorization checks in the `cs/web/missing-function-level-access-control` query. The query now recognizes authorization attributes inherited from base classes and interfaces. +* The precision of the query `cs/invalid-string-formatting` has been improved. More methods and more overloads of existing format like methods are taken into account by the query. diff --git a/csharp/ql/src/codeql-pack.release.yml b/csharp/ql/src/codeql-pack.release.yml index 1a19084be3f7..53ab127707fc 100644 --- a/csharp/ql/src/codeql-pack.release.yml +++ b/csharp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.1 +lastReleaseVersion: 1.1.2 diff --git a/csharp/ql/src/qlpack.yml b/csharp/ql/src/qlpack.yml index ac3522ef68ce..a58388ec20d9 100644 --- a/csharp/ql/src/qlpack.yml +++ b/csharp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-queries -version: 1.1.2-dev +version: 1.1.2 groups: - csharp - queries diff --git a/go/ql/consistency-queries/CHANGELOG.md b/go/ql/consistency-queries/CHANGELOG.md index 4ede7cf63b21..b09bc81cffe9 100644 --- a/go/ql/consistency-queries/CHANGELOG.md +++ b/go/ql/consistency-queries/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/go/ql/consistency-queries/change-notes/released/1.0.22.md b/go/ql/consistency-queries/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/go/ql/consistency-queries/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/go/ql/consistency-queries/codeql-pack.release.yml b/go/ql/consistency-queries/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/go/ql/consistency-queries/codeql-pack.release.yml +++ b/go/ql/consistency-queries/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/go/ql/consistency-queries/qlpack.yml b/go/ql/consistency-queries/qlpack.yml index 6555842cf3b2..a414966bc9de 100644 --- a/go/ql/consistency-queries/qlpack.yml +++ b/go/ql/consistency-queries/qlpack.yml @@ -1,5 +1,5 @@ name: codeql-go-consistency-queries -version: 1.0.22-dev +version: 1.0.22 groups: - go - queries diff --git a/go/ql/lib/CHANGELOG.md b/go/ql/lib/CHANGELOG.md index 9193892f389c..0bf8614edd60 100644 --- a/go/ql/lib/CHANGELOG.md +++ b/go/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.2.4 + +No user-facing changes. + ## 4.2.3 ### Minor Analysis Improvements diff --git a/go/ql/lib/change-notes/released/4.2.4.md b/go/ql/lib/change-notes/released/4.2.4.md new file mode 100644 index 000000000000..bbe4dd494a5a --- /dev/null +++ b/go/ql/lib/change-notes/released/4.2.4.md @@ -0,0 +1,3 @@ +## 4.2.4 + +No user-facing changes. diff --git a/go/ql/lib/codeql-pack.release.yml b/go/ql/lib/codeql-pack.release.yml index 5bf06624029f..e0c6f96cfe84 100644 --- a/go/ql/lib/codeql-pack.release.yml +++ b/go/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.2.3 +lastReleaseVersion: 4.2.4 diff --git a/go/ql/lib/qlpack.yml b/go/ql/lib/qlpack.yml index 3aabb5860bc5..ac6ccfb48820 100644 --- a/go/ql/lib/qlpack.yml +++ b/go/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-all -version: 4.2.4-dev +version: 4.2.4 groups: go dbscheme: go.dbscheme extractor: go diff --git a/go/ql/src/CHANGELOG.md b/go/ql/src/CHANGELOG.md index 46bb7c9055ff..b871d911dd12 100644 --- a/go/ql/src/CHANGELOG.md +++ b/go/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.13 + +No user-facing changes. + ## 1.1.12 No user-facing changes. diff --git a/go/ql/src/change-notes/released/1.1.13.md b/go/ql/src/change-notes/released/1.1.13.md new file mode 100644 index 000000000000..ef6635cd9bca --- /dev/null +++ b/go/ql/src/change-notes/released/1.1.13.md @@ -0,0 +1,3 @@ +## 1.1.13 + +No user-facing changes. diff --git a/go/ql/src/codeql-pack.release.yml b/go/ql/src/codeql-pack.release.yml index f5b135d01938..09a80be68d17 100644 --- a/go/ql/src/codeql-pack.release.yml +++ b/go/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.12 +lastReleaseVersion: 1.1.13 diff --git a/go/ql/src/qlpack.yml b/go/ql/src/qlpack.yml index 34af2e380187..3618a9b59bad 100644 --- a/go/ql/src/qlpack.yml +++ b/go/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-queries -version: 1.1.13-dev +version: 1.1.13 groups: - go - queries diff --git a/java/ql/lib/CHANGELOG.md b/java/ql/lib/CHANGELOG.md index 8061e31bc38b..b9c10d311fde 100644 --- a/java/ql/lib/CHANGELOG.md +++ b/java/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 7.1.4 + +No user-facing changes. + ## 7.1.3 ### Minor Analysis Improvements diff --git a/java/ql/lib/change-notes/released/7.1.4.md b/java/ql/lib/change-notes/released/7.1.4.md new file mode 100644 index 000000000000..1023006d1bf9 --- /dev/null +++ b/java/ql/lib/change-notes/released/7.1.4.md @@ -0,0 +1,3 @@ +## 7.1.4 + +No user-facing changes. diff --git a/java/ql/lib/codeql-pack.release.yml b/java/ql/lib/codeql-pack.release.yml index 8c4f0b314335..de842046cc34 100644 --- a/java/ql/lib/codeql-pack.release.yml +++ b/java/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 7.1.3 +lastReleaseVersion: 7.1.4 diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml index 342dcb646267..c6c8a86440fe 100644 --- a/java/ql/lib/qlpack.yml +++ b/java/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-all -version: 7.1.4-dev +version: 7.1.4 groups: java dbscheme: config/semmlecode.dbscheme extractor: java diff --git a/java/ql/src/CHANGELOG.md b/java/ql/src/CHANGELOG.md index b81d3ca7bf9e..9978ca0e8256 100644 --- a/java/ql/src/CHANGELOG.md +++ b/java/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.4.2 + +### Minor Analysis Improvements + +* Changes to the MaD model generation infrastructure: Changed the query `java/utils/modelgenerator/summary-models` to use the implementation from `java/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `java/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `java/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). + ## 1.4.1 No user-facing changes. diff --git a/java/ql/src/change-notes/2025-04-16-model-generation.md b/java/ql/src/change-notes/released/1.4.2.md similarity index 89% rename from java/ql/src/change-notes/2025-04-16-model-generation.md rename to java/ql/src/change-notes/released/1.4.2.md index 980b2292ed6a..406d1933c656 100644 --- a/java/ql/src/change-notes/2025-04-16-model-generation.md +++ b/java/ql/src/change-notes/released/1.4.2.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- -* Changes to the MaD model generation infrastructure: Changed the query `java/utils/modelgenerator/summary-models` to use the implementation from `java/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `java/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `java/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). \ No newline at end of file +## 1.4.2 + +### Minor Analysis Improvements + +* Changes to the MaD model generation infrastructure: Changed the query `java/utils/modelgenerator/summary-models` to use the implementation from `java/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `java/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `java/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). diff --git a/java/ql/src/codeql-pack.release.yml b/java/ql/src/codeql-pack.release.yml index 43ccf4467bed..a76cacdf7997 100644 --- a/java/ql/src/codeql-pack.release.yml +++ b/java/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.4.1 +lastReleaseVersion: 1.4.2 diff --git a/java/ql/src/qlpack.yml b/java/ql/src/qlpack.yml index 38c7ecf94c5c..d6908853bc1b 100644 --- a/java/ql/src/qlpack.yml +++ b/java/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-queries -version: 1.4.2-dev +version: 1.4.2 groups: - java - queries diff --git a/javascript/ql/lib/CHANGELOG.md b/javascript/ql/lib/CHANGELOG.md index b4d80c515da2..48488450afab 100644 --- a/javascript/ql/lib/CHANGELOG.md +++ b/javascript/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.6.2 + +No user-facing changes. + ## 2.6.1 ### Minor Analysis Improvements diff --git a/javascript/ql/lib/change-notes/released/2.6.2.md b/javascript/ql/lib/change-notes/released/2.6.2.md new file mode 100644 index 000000000000..ef5a63bec37b --- /dev/null +++ b/javascript/ql/lib/change-notes/released/2.6.2.md @@ -0,0 +1,3 @@ +## 2.6.2 + +No user-facing changes. diff --git a/javascript/ql/lib/codeql-pack.release.yml b/javascript/ql/lib/codeql-pack.release.yml index d9d6a8bbe18a..cca069203ce7 100644 --- a/javascript/ql/lib/codeql-pack.release.yml +++ b/javascript/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.6.1 +lastReleaseVersion: 2.6.2 diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index 3955e8909e53..b9716f1bc572 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-all -version: 2.6.2-dev +version: 2.6.2 groups: javascript dbscheme: semmlecode.javascript.dbscheme extractor: javascript diff --git a/javascript/ql/src/CHANGELOG.md b/javascript/ql/src/CHANGELOG.md index 32be26faf9c6..dc7c6ebc2f89 100644 --- a/javascript/ql/src/CHANGELOG.md +++ b/javascript/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.4 + +No user-facing changes. + ## 1.5.3 ### Minor Analysis Improvements diff --git a/javascript/ql/src/change-notes/released/1.5.4.md b/javascript/ql/src/change-notes/released/1.5.4.md new file mode 100644 index 000000000000..5ff5ac8ebb7c --- /dev/null +++ b/javascript/ql/src/change-notes/released/1.5.4.md @@ -0,0 +1,3 @@ +## 1.5.4 + +No user-facing changes. diff --git a/javascript/ql/src/codeql-pack.release.yml b/javascript/ql/src/codeql-pack.release.yml index 232224b0e267..c216828ee1c3 100644 --- a/javascript/ql/src/codeql-pack.release.yml +++ b/javascript/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.5.3 +lastReleaseVersion: 1.5.4 diff --git a/javascript/ql/src/qlpack.yml b/javascript/ql/src/qlpack.yml index 471704d59550..3a539acdf6fd 100644 --- a/javascript/ql/src/qlpack.yml +++ b/javascript/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-queries -version: 1.5.4-dev +version: 1.5.4 groups: - javascript - queries diff --git a/misc/suite-helpers/CHANGELOG.md b/misc/suite-helpers/CHANGELOG.md index 74c5e6933ed1..b7891e5bb95b 100644 --- a/misc/suite-helpers/CHANGELOG.md +++ b/misc/suite-helpers/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/misc/suite-helpers/change-notes/released/1.0.22.md b/misc/suite-helpers/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/misc/suite-helpers/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/misc/suite-helpers/codeql-pack.release.yml b/misc/suite-helpers/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/misc/suite-helpers/codeql-pack.release.yml +++ b/misc/suite-helpers/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/misc/suite-helpers/qlpack.yml b/misc/suite-helpers/qlpack.yml index 9dd4a6e2d6e6..12c9234e4590 100644 --- a/misc/suite-helpers/qlpack.yml +++ b/misc/suite-helpers/qlpack.yml @@ -1,4 +1,4 @@ name: codeql/suite-helpers -version: 1.0.22-dev +version: 1.0.22 groups: shared warnOnImplicitThis: true diff --git a/python/ql/lib/CHANGELOG.md b/python/ql/lib/CHANGELOG.md index 1d7bcb46b1eb..3d8ab0011caf 100644 --- a/python/ql/lib/CHANGELOG.md +++ b/python/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.6 + +No user-facing changes. + ## 4.0.5 No user-facing changes. diff --git a/python/ql/lib/change-notes/released/4.0.6.md b/python/ql/lib/change-notes/released/4.0.6.md new file mode 100644 index 000000000000..2906af318362 --- /dev/null +++ b/python/ql/lib/change-notes/released/4.0.6.md @@ -0,0 +1,3 @@ +## 4.0.6 + +No user-facing changes. diff --git a/python/ql/lib/codeql-pack.release.yml b/python/ql/lib/codeql-pack.release.yml index b08843b96ce4..3b3376d94e43 100644 --- a/python/ql/lib/codeql-pack.release.yml +++ b/python/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.0.5 +lastReleaseVersion: 4.0.6 diff --git a/python/ql/lib/qlpack.yml b/python/ql/lib/qlpack.yml index 3517e1daa3d2..03b7a3e54be4 100644 --- a/python/ql/lib/qlpack.yml +++ b/python/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-all -version: 4.0.6-dev +version: 4.0.6 groups: python dbscheme: semmlecode.python.dbscheme extractor: python diff --git a/python/ql/src/CHANGELOG.md b/python/ql/src/CHANGELOG.md index 4b1ca7a734be..aa0908119da3 100644 --- a/python/ql/src/CHANGELOG.md +++ b/python/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.4.8 + +No user-facing changes. + ## 1.4.7 ### Minor Analysis Improvements diff --git a/python/ql/src/change-notes/released/1.4.8.md b/python/ql/src/change-notes/released/1.4.8.md new file mode 100644 index 000000000000..06976d05e752 --- /dev/null +++ b/python/ql/src/change-notes/released/1.4.8.md @@ -0,0 +1,3 @@ +## 1.4.8 + +No user-facing changes. diff --git a/python/ql/src/codeql-pack.release.yml b/python/ql/src/codeql-pack.release.yml index 163362bd6321..16e6425ae7e4 100644 --- a/python/ql/src/codeql-pack.release.yml +++ b/python/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.4.7 +lastReleaseVersion: 1.4.8 diff --git a/python/ql/src/qlpack.yml b/python/ql/src/qlpack.yml index c9bbffd46b3a..5dd9400dab3e 100644 --- a/python/ql/src/qlpack.yml +++ b/python/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-queries -version: 1.4.8-dev +version: 1.4.8 groups: - python - queries diff --git a/ruby/ql/lib/CHANGELOG.md b/ruby/ql/lib/CHANGELOG.md index 527d5c3fd17c..43ab8e8fdac4 100644 --- a/ruby/ql/lib/CHANGELOG.md +++ b/ruby/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.1.5 + +No user-facing changes. + ## 4.1.4 ### Minor Analysis Improvements diff --git a/ruby/ql/lib/change-notes/released/4.1.5.md b/ruby/ql/lib/change-notes/released/4.1.5.md new file mode 100644 index 000000000000..c2802beb81d8 --- /dev/null +++ b/ruby/ql/lib/change-notes/released/4.1.5.md @@ -0,0 +1,3 @@ +## 4.1.5 + +No user-facing changes. diff --git a/ruby/ql/lib/codeql-pack.release.yml b/ruby/ql/lib/codeql-pack.release.yml index de92bc2ecc34..3b4af49b03c4 100644 --- a/ruby/ql/lib/codeql-pack.release.yml +++ b/ruby/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.1.4 +lastReleaseVersion: 4.1.5 diff --git a/ruby/ql/lib/qlpack.yml b/ruby/ql/lib/qlpack.yml index fcc413c263f2..6ecaf5163c63 100644 --- a/ruby/ql/lib/qlpack.yml +++ b/ruby/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-all -version: 4.1.5-dev +version: 4.1.5 groups: ruby extractor: ruby dbscheme: ruby.dbscheme diff --git a/ruby/ql/src/CHANGELOG.md b/ruby/ql/src/CHANGELOG.md index b06acc1c9df3..a44233266fb9 100644 --- a/ruby/ql/src/CHANGELOG.md +++ b/ruby/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.2.1 + +No user-facing changes. + ## 1.2.0 ### Major Analysis Improvements diff --git a/ruby/ql/src/change-notes/released/1.2.1.md b/ruby/ql/src/change-notes/released/1.2.1.md new file mode 100644 index 000000000000..67aaa1465fd7 --- /dev/null +++ b/ruby/ql/src/change-notes/released/1.2.1.md @@ -0,0 +1,3 @@ +## 1.2.1 + +No user-facing changes. diff --git a/ruby/ql/src/codeql-pack.release.yml b/ruby/ql/src/codeql-pack.release.yml index 75430e73d1c4..73dd403938c9 100644 --- a/ruby/ql/src/codeql-pack.release.yml +++ b/ruby/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.2.0 +lastReleaseVersion: 1.2.1 diff --git a/ruby/ql/src/qlpack.yml b/ruby/ql/src/qlpack.yml index d12d9343d8a4..0419cb30b2fa 100644 --- a/ruby/ql/src/qlpack.yml +++ b/ruby/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-queries -version: 1.2.1-dev +version: 1.2.1 groups: - ruby - queries diff --git a/rust/ql/lib/CHANGELOG.md b/rust/ql/lib/CHANGELOG.md index 2755640d9ead..6c0dda8457ac 100644 --- a/rust/ql/lib/CHANGELOG.md +++ b/rust/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.7 + +No user-facing changes. + ## 0.1.6 No user-facing changes. diff --git a/rust/ql/lib/change-notes/released/0.1.7.md b/rust/ql/lib/change-notes/released/0.1.7.md new file mode 100644 index 000000000000..49dc15228e3d --- /dev/null +++ b/rust/ql/lib/change-notes/released/0.1.7.md @@ -0,0 +1,3 @@ +## 0.1.7 + +No user-facing changes. diff --git a/rust/ql/lib/codeql-pack.release.yml b/rust/ql/lib/codeql-pack.release.yml index d271632b3dde..949d4c64c66f 100644 --- a/rust/ql/lib/codeql-pack.release.yml +++ b/rust/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.1.6 +lastReleaseVersion: 0.1.7 diff --git a/rust/ql/lib/qlpack.yml b/rust/ql/lib/qlpack.yml index cfe69f9279ab..0955915fefda 100644 --- a/rust/ql/lib/qlpack.yml +++ b/rust/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rust-all -version: 0.1.7-dev +version: 0.1.7 groups: rust extractor: rust dbscheme: rust.dbscheme diff --git a/rust/ql/src/CHANGELOG.md b/rust/ql/src/CHANGELOG.md index 2755640d9ead..593b7755bbdc 100644 --- a/rust/ql/src/CHANGELOG.md +++ b/rust/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.1.7 + +### Minor Analysis Improvements + +* Changes to the MaD model generation infrastructure: Changed the query `rust/utils/modelgenerator/summary-models` to use the implementation from `rust/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `rust/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `rust/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). + ## 0.1.6 No user-facing changes. diff --git a/rust/ql/src/change-notes/2025-04-16-model-generation.md b/rust/ql/src/change-notes/released/0.1.7.md similarity index 89% rename from rust/ql/src/change-notes/2025-04-16-model-generation.md rename to rust/ql/src/change-notes/released/0.1.7.md index e90a44dbd093..7ba124d7e03c 100644 --- a/rust/ql/src/change-notes/2025-04-16-model-generation.md +++ b/rust/ql/src/change-notes/released/0.1.7.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- -* Changes to the MaD model generation infrastructure: Changed the query `rust/utils/modelgenerator/summary-models` to use the implementation from `rust/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `rust/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `rust/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). \ No newline at end of file +## 0.1.7 + +### Minor Analysis Improvements + +* Changes to the MaD model generation infrastructure: Changed the query `rust/utils/modelgenerator/summary-models` to use the implementation from `rust/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `rust/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `rust/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). diff --git a/rust/ql/src/codeql-pack.release.yml b/rust/ql/src/codeql-pack.release.yml index d271632b3dde..949d4c64c66f 100644 --- a/rust/ql/src/codeql-pack.release.yml +++ b/rust/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.1.6 +lastReleaseVersion: 0.1.7 diff --git a/rust/ql/src/qlpack.yml b/rust/ql/src/qlpack.yml index d5fd49b0c385..a1e5f32bd206 100644 --- a/rust/ql/src/qlpack.yml +++ b/rust/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rust-queries -version: 0.1.7-dev +version: 0.1.7 groups: - rust - queries diff --git a/shared/controlflow/CHANGELOG.md b/shared/controlflow/CHANGELOG.md index ce221ede189e..d69921efe23b 100644 --- a/shared/controlflow/CHANGELOG.md +++ b/shared/controlflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.6 + +No user-facing changes. + ## 2.0.5 No user-facing changes. diff --git a/shared/controlflow/change-notes/released/2.0.6.md b/shared/controlflow/change-notes/released/2.0.6.md new file mode 100644 index 000000000000..d8ae25aacd0f --- /dev/null +++ b/shared/controlflow/change-notes/released/2.0.6.md @@ -0,0 +1,3 @@ +## 2.0.6 + +No user-facing changes. diff --git a/shared/controlflow/codeql-pack.release.yml b/shared/controlflow/codeql-pack.release.yml index 6c269316f278..fbbc03c76427 100644 --- a/shared/controlflow/codeql-pack.release.yml +++ b/shared/controlflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.5 +lastReleaseVersion: 2.0.6 diff --git a/shared/controlflow/qlpack.yml b/shared/controlflow/qlpack.yml index 34183f2048b8..e1a757c8fa08 100644 --- a/shared/controlflow/qlpack.yml +++ b/shared/controlflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/controlflow -version: 2.0.6-dev +version: 2.0.6 groups: shared library: true dependencies: diff --git a/shared/dataflow/CHANGELOG.md b/shared/dataflow/CHANGELOG.md index ac1750c1e2f5..e07fdc75a97d 100644 --- a/shared/dataflow/CHANGELOG.md +++ b/shared/dataflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.6 + +No user-facing changes. + ## 2.0.5 No user-facing changes. diff --git a/shared/dataflow/change-notes/released/2.0.6.md b/shared/dataflow/change-notes/released/2.0.6.md new file mode 100644 index 000000000000..d8ae25aacd0f --- /dev/null +++ b/shared/dataflow/change-notes/released/2.0.6.md @@ -0,0 +1,3 @@ +## 2.0.6 + +No user-facing changes. diff --git a/shared/dataflow/codeql-pack.release.yml b/shared/dataflow/codeql-pack.release.yml index 6c269316f278..fbbc03c76427 100644 --- a/shared/dataflow/codeql-pack.release.yml +++ b/shared/dataflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.5 +lastReleaseVersion: 2.0.6 diff --git a/shared/dataflow/qlpack.yml b/shared/dataflow/qlpack.yml index 06d87a5c3cc0..1582f9999b62 100644 --- a/shared/dataflow/qlpack.yml +++ b/shared/dataflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/dataflow -version: 2.0.6-dev +version: 2.0.6 groups: shared library: true dependencies: diff --git a/shared/mad/CHANGELOG.md b/shared/mad/CHANGELOG.md index 609a9cdaff69..cb5108afd2c7 100644 --- a/shared/mad/CHANGELOG.md +++ b/shared/mad/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/shared/mad/change-notes/released/1.0.22.md b/shared/mad/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/shared/mad/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/shared/mad/codeql-pack.release.yml b/shared/mad/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/shared/mad/codeql-pack.release.yml +++ b/shared/mad/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/shared/mad/qlpack.yml b/shared/mad/qlpack.yml index 77eeff61cb8c..7e0e982ac709 100644 --- a/shared/mad/qlpack.yml +++ b/shared/mad/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/mad -version: 1.0.22-dev +version: 1.0.22 groups: shared library: true dependencies: diff --git a/shared/rangeanalysis/CHANGELOG.md b/shared/rangeanalysis/CHANGELOG.md index 2757232c21a5..ed8f8e1eab3d 100644 --- a/shared/rangeanalysis/CHANGELOG.md +++ b/shared/rangeanalysis/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/shared/rangeanalysis/change-notes/released/1.0.22.md b/shared/rangeanalysis/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/shared/rangeanalysis/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/shared/rangeanalysis/codeql-pack.release.yml b/shared/rangeanalysis/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/shared/rangeanalysis/codeql-pack.release.yml +++ b/shared/rangeanalysis/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/shared/rangeanalysis/qlpack.yml b/shared/rangeanalysis/qlpack.yml index 4e2065f70d2b..d071cdb31a2f 100644 --- a/shared/rangeanalysis/qlpack.yml +++ b/shared/rangeanalysis/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rangeanalysis -version: 1.0.22-dev +version: 1.0.22 groups: shared library: true dependencies: diff --git a/shared/regex/CHANGELOG.md b/shared/regex/CHANGELOG.md index 3ab9e968cc01..49ac9b18d4b1 100644 --- a/shared/regex/CHANGELOG.md +++ b/shared/regex/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/shared/regex/change-notes/released/1.0.22.md b/shared/regex/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/shared/regex/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/shared/regex/codeql-pack.release.yml b/shared/regex/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/shared/regex/codeql-pack.release.yml +++ b/shared/regex/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/shared/regex/qlpack.yml b/shared/regex/qlpack.yml index 1121f153bf55..9d6f8e822a17 100644 --- a/shared/regex/qlpack.yml +++ b/shared/regex/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/regex -version: 1.0.22-dev +version: 1.0.22 groups: shared library: true dependencies: diff --git a/shared/ssa/CHANGELOG.md b/shared/ssa/CHANGELOG.md index cb86b03f5bff..58ac1a04d04b 100644 --- a/shared/ssa/CHANGELOG.md +++ b/shared/ssa/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.1 + +No user-facing changes. + ## 1.1.0 ### Deprecated APIs diff --git a/shared/ssa/change-notes/released/1.1.1.md b/shared/ssa/change-notes/released/1.1.1.md new file mode 100644 index 000000000000..7fb56d366105 --- /dev/null +++ b/shared/ssa/change-notes/released/1.1.1.md @@ -0,0 +1,3 @@ +## 1.1.1 + +No user-facing changes. diff --git a/shared/ssa/codeql-pack.release.yml b/shared/ssa/codeql-pack.release.yml index 2ac15439f561..1a19084be3f7 100644 --- a/shared/ssa/codeql-pack.release.yml +++ b/shared/ssa/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.0 +lastReleaseVersion: 1.1.1 diff --git a/shared/ssa/qlpack.yml b/shared/ssa/qlpack.yml index 7ed319dae575..3a5ec8c5496d 100644 --- a/shared/ssa/qlpack.yml +++ b/shared/ssa/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ssa -version: 1.1.1-dev +version: 1.1.1 groups: shared library: true dependencies: diff --git a/shared/threat-models/CHANGELOG.md b/shared/threat-models/CHANGELOG.md index 4ede7cf63b21..b09bc81cffe9 100644 --- a/shared/threat-models/CHANGELOG.md +++ b/shared/threat-models/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/shared/threat-models/change-notes/released/1.0.22.md b/shared/threat-models/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/shared/threat-models/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/shared/threat-models/codeql-pack.release.yml b/shared/threat-models/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/shared/threat-models/codeql-pack.release.yml +++ b/shared/threat-models/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/shared/threat-models/qlpack.yml b/shared/threat-models/qlpack.yml index 2b35e47d089c..464d5a7e2624 100644 --- a/shared/threat-models/qlpack.yml +++ b/shared/threat-models/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/threat-models -version: 1.0.22-dev +version: 1.0.22 library: true groups: shared dataExtensions: diff --git a/shared/tutorial/CHANGELOG.md b/shared/tutorial/CHANGELOG.md index 247021104749..1da44a270de6 100644 --- a/shared/tutorial/CHANGELOG.md +++ b/shared/tutorial/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/shared/tutorial/change-notes/released/1.0.22.md b/shared/tutorial/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/shared/tutorial/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/shared/tutorial/codeql-pack.release.yml b/shared/tutorial/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/shared/tutorial/codeql-pack.release.yml +++ b/shared/tutorial/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/shared/tutorial/qlpack.yml b/shared/tutorial/qlpack.yml index 3dcf3d9653a1..f25d695e7735 100644 --- a/shared/tutorial/qlpack.yml +++ b/shared/tutorial/qlpack.yml @@ -1,7 +1,7 @@ name: codeql/tutorial description: Library for the CodeQL detective tutorials, helping new users learn to write CodeQL queries. -version: 1.0.22-dev +version: 1.0.22 groups: shared library: true warnOnImplicitThis: true diff --git a/shared/typeflow/CHANGELOG.md b/shared/typeflow/CHANGELOG.md index 3d66ee2aafa6..3b08c24e221e 100644 --- a/shared/typeflow/CHANGELOG.md +++ b/shared/typeflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/shared/typeflow/change-notes/released/1.0.22.md b/shared/typeflow/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/shared/typeflow/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/shared/typeflow/codeql-pack.release.yml b/shared/typeflow/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/shared/typeflow/codeql-pack.release.yml +++ b/shared/typeflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/shared/typeflow/qlpack.yml b/shared/typeflow/qlpack.yml index 2a80a2fd93df..9a1264adac4d 100644 --- a/shared/typeflow/qlpack.yml +++ b/shared/typeflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeflow -version: 1.0.22-dev +version: 1.0.22 groups: shared library: true dependencies: diff --git a/shared/typeinference/CHANGELOG.md b/shared/typeinference/CHANGELOG.md index 7668a5ba39d5..d7831747b120 100644 --- a/shared/typeinference/CHANGELOG.md +++ b/shared/typeinference/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.3 + +No user-facing changes. + ## 0.0.2 No user-facing changes. diff --git a/shared/typeinference/change-notes/released/0.0.3.md b/shared/typeinference/change-notes/released/0.0.3.md new file mode 100644 index 000000000000..af7864fc7d54 --- /dev/null +++ b/shared/typeinference/change-notes/released/0.0.3.md @@ -0,0 +1,3 @@ +## 0.0.3 + +No user-facing changes. diff --git a/shared/typeinference/codeql-pack.release.yml b/shared/typeinference/codeql-pack.release.yml index 55dc06fbd76a..a24b693d1e7a 100644 --- a/shared/typeinference/codeql-pack.release.yml +++ b/shared/typeinference/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.0.2 +lastReleaseVersion: 0.0.3 diff --git a/shared/typeinference/qlpack.yml b/shared/typeinference/qlpack.yml index 2ae46b4a8f37..0ac8eba3de12 100644 --- a/shared/typeinference/qlpack.yml +++ b/shared/typeinference/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeinference -version: 0.0.3-dev +version: 0.0.3 groups: shared library: true dependencies: diff --git a/shared/typetracking/CHANGELOG.md b/shared/typetracking/CHANGELOG.md index cb26fd517328..507a195aff80 100644 --- a/shared/typetracking/CHANGELOG.md +++ b/shared/typetracking/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.6 + +No user-facing changes. + ## 2.0.5 No user-facing changes. diff --git a/shared/typetracking/change-notes/released/2.0.6.md b/shared/typetracking/change-notes/released/2.0.6.md new file mode 100644 index 000000000000..d8ae25aacd0f --- /dev/null +++ b/shared/typetracking/change-notes/released/2.0.6.md @@ -0,0 +1,3 @@ +## 2.0.6 + +No user-facing changes. diff --git a/shared/typetracking/codeql-pack.release.yml b/shared/typetracking/codeql-pack.release.yml index 6c269316f278..fbbc03c76427 100644 --- a/shared/typetracking/codeql-pack.release.yml +++ b/shared/typetracking/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.5 +lastReleaseVersion: 2.0.6 diff --git a/shared/typetracking/qlpack.yml b/shared/typetracking/qlpack.yml index 5a18f7e7bb7e..d5ceed7f6aed 100644 --- a/shared/typetracking/qlpack.yml +++ b/shared/typetracking/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typetracking -version: 2.0.6-dev +version: 2.0.6 groups: shared library: true dependencies: diff --git a/shared/typos/CHANGELOG.md b/shared/typos/CHANGELOG.md index 236eb0d974a3..9500437aa07e 100644 --- a/shared/typos/CHANGELOG.md +++ b/shared/typos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/shared/typos/change-notes/released/1.0.22.md b/shared/typos/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/shared/typos/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/shared/typos/codeql-pack.release.yml b/shared/typos/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/shared/typos/codeql-pack.release.yml +++ b/shared/typos/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/shared/typos/qlpack.yml b/shared/typos/qlpack.yml index 640123cfba69..ad67983a2a2f 100644 --- a/shared/typos/qlpack.yml +++ b/shared/typos/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typos -version: 1.0.22-dev +version: 1.0.22 groups: shared library: true warnOnImplicitThis: true diff --git a/shared/util/CHANGELOG.md b/shared/util/CHANGELOG.md index 17de08023071..8a71bf4f263b 100644 --- a/shared/util/CHANGELOG.md +++ b/shared/util/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.9 + +No user-facing changes. + ## 2.0.8 No user-facing changes. diff --git a/shared/util/change-notes/released/2.0.9.md b/shared/util/change-notes/released/2.0.9.md new file mode 100644 index 000000000000..b89eb98bbd9d --- /dev/null +++ b/shared/util/change-notes/released/2.0.9.md @@ -0,0 +1,3 @@ +## 2.0.9 + +No user-facing changes. diff --git a/shared/util/codeql-pack.release.yml b/shared/util/codeql-pack.release.yml index 7ffb2d9f65be..ce305265e337 100644 --- a/shared/util/codeql-pack.release.yml +++ b/shared/util/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.8 +lastReleaseVersion: 2.0.9 diff --git a/shared/util/qlpack.yml b/shared/util/qlpack.yml index 923d31ad8952..0b56fe498f80 100644 --- a/shared/util/qlpack.yml +++ b/shared/util/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/util -version: 2.0.9-dev +version: 2.0.9 groups: shared library: true dependencies: null diff --git a/shared/xml/CHANGELOG.md b/shared/xml/CHANGELOG.md index a9a8e312ea2a..95a60e498bff 100644 --- a/shared/xml/CHANGELOG.md +++ b/shared/xml/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/shared/xml/change-notes/released/1.0.22.md b/shared/xml/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/shared/xml/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/shared/xml/codeql-pack.release.yml b/shared/xml/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/shared/xml/codeql-pack.release.yml +++ b/shared/xml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/shared/xml/qlpack.yml b/shared/xml/qlpack.yml index 1cbd3609e729..da24a6ce78aa 100644 --- a/shared/xml/qlpack.yml +++ b/shared/xml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/xml -version: 1.0.22-dev +version: 1.0.22 groups: shared library: true dependencies: diff --git a/shared/yaml/CHANGELOG.md b/shared/yaml/CHANGELOG.md index 430e21d3e508..edddaed1fdd7 100644 --- a/shared/yaml/CHANGELOG.md +++ b/shared/yaml/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.22 + +No user-facing changes. + ## 1.0.21 No user-facing changes. diff --git a/shared/yaml/change-notes/released/1.0.22.md b/shared/yaml/change-notes/released/1.0.22.md new file mode 100644 index 000000000000..94b152f16707 --- /dev/null +++ b/shared/yaml/change-notes/released/1.0.22.md @@ -0,0 +1,3 @@ +## 1.0.22 + +No user-facing changes. diff --git a/shared/yaml/codeql-pack.release.yml b/shared/yaml/codeql-pack.release.yml index 81b5ecacf446..27d922b5ea6d 100644 --- a/shared/yaml/codeql-pack.release.yml +++ b/shared/yaml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.21 +lastReleaseVersion: 1.0.22 diff --git a/shared/yaml/qlpack.yml b/shared/yaml/qlpack.yml index 38c92ec2777c..318094b9d40b 100644 --- a/shared/yaml/qlpack.yml +++ b/shared/yaml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/yaml -version: 1.0.22-dev +version: 1.0.22 groups: shared library: true warnOnImplicitThis: true diff --git a/swift/ql/lib/CHANGELOG.md b/swift/ql/lib/CHANGELOG.md index 32abbe5cc8e7..7409680a2e19 100644 --- a/swift/ql/lib/CHANGELOG.md +++ b/swift/ql/lib/CHANGELOG.md @@ -1,3 +1,15 @@ +## 4.2.0 + +### Major Analysis Improvements + +* Upgraded to allow analysis of Swift 6.1. + +### Minor Analysis Improvements + +* Added AST nodes `ActorIsolationErasureExpr`, `CurrentContextIsolationExpr`, + `ExtracFunctionIsolationExpr` and `UnreachableExpr` that correspond to new nodes + added by Swift 6.0. + ## 4.1.4 No user-facing changes. diff --git a/swift/ql/lib/change-notes/2025-04-23-swift-6.1.md b/swift/ql/lib/change-notes/2025-04-23-swift-6.1.md deleted file mode 100644 index 272c8ce6ca35..000000000000 --- a/swift/ql/lib/change-notes/2025-04-23-swift-6.1.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: majorAnalysis ---- -* Upgraded to allow analysis of Swift 6.1. diff --git a/swift/ql/lib/change-notes/2025-04-14-new-entities.md b/swift/ql/lib/change-notes/released/4.2.0.md similarity index 60% rename from swift/ql/lib/change-notes/2025-04-14-new-entities.md rename to swift/ql/lib/change-notes/released/4.2.0.md index a0555d9cbda7..734840c93183 100644 --- a/swift/ql/lib/change-notes/2025-04-14-new-entities.md +++ b/swift/ql/lib/change-notes/released/4.2.0.md @@ -1,6 +1,11 @@ ---- -category: minorAnalysis ---- +## 4.2.0 + +### Major Analysis Improvements + +* Upgraded to allow analysis of Swift 6.1. + +### Minor Analysis Improvements + * Added AST nodes `ActorIsolationErasureExpr`, `CurrentContextIsolationExpr`, `ExtracFunctionIsolationExpr` and `UnreachableExpr` that correspond to new nodes added by Swift 6.0. diff --git a/swift/ql/lib/codeql-pack.release.yml b/swift/ql/lib/codeql-pack.release.yml index de92bc2ecc34..9fc6933b429f 100644 --- a/swift/ql/lib/codeql-pack.release.yml +++ b/swift/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.1.4 +lastReleaseVersion: 4.2.0 diff --git a/swift/ql/lib/qlpack.yml b/swift/ql/lib/qlpack.yml index 758992289527..ac76e2e270b4 100644 --- a/swift/ql/lib/qlpack.yml +++ b/swift/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-all -version: 4.1.5-dev +version: 4.2.0 groups: swift extractor: swift dbscheme: swift.dbscheme diff --git a/swift/ql/src/CHANGELOG.md b/swift/ql/src/CHANGELOG.md index 6b5f800619e5..993a2252ae4d 100644 --- a/swift/ql/src/CHANGELOG.md +++ b/swift/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.2 + +No user-facing changes. + ## 1.1.1 No user-facing changes. diff --git a/swift/ql/src/change-notes/released/1.1.2.md b/swift/ql/src/change-notes/released/1.1.2.md new file mode 100644 index 000000000000..ce8d2c1a4f37 --- /dev/null +++ b/swift/ql/src/change-notes/released/1.1.2.md @@ -0,0 +1,3 @@ +## 1.1.2 + +No user-facing changes. diff --git a/swift/ql/src/codeql-pack.release.yml b/swift/ql/src/codeql-pack.release.yml index 1a19084be3f7..53ab127707fc 100644 --- a/swift/ql/src/codeql-pack.release.yml +++ b/swift/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.1 +lastReleaseVersion: 1.1.2 diff --git a/swift/ql/src/qlpack.yml b/swift/ql/src/qlpack.yml index efe9d3232c8f..39e1f65a2c10 100644 --- a/swift/ql/src/qlpack.yml +++ b/swift/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-queries -version: 1.1.2-dev +version: 1.1.2 groups: - swift - queries From ca7f8f21cd77e1047f58781f21cb9d715e0672aa Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Mon, 28 Apr 2025 12:50:58 +0100 Subject: [PATCH 238/240] Tweak change-note for MaD model generation --- csharp/ql/src/CHANGELOG.md | 5 ++++- csharp/ql/src/change-notes/released/1.1.2.md | 5 ++++- java/ql/src/CHANGELOG.md | 5 ++++- java/ql/src/change-notes/released/1.4.2.md | 5 ++++- java/ql/src/dx.ql | 17 +++++++++++++++++ rust/ql/src/CHANGELOG.md | 5 ++++- rust/ql/src/change-notes/released/0.1.7.md | 5 ++++- 7 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 java/ql/src/dx.ql diff --git a/csharp/ql/src/CHANGELOG.md b/csharp/ql/src/CHANGELOG.md index 4c76f4bd170f..cc2b6173a25d 100644 --- a/csharp/ql/src/CHANGELOG.md +++ b/csharp/ql/src/CHANGELOG.md @@ -2,7 +2,10 @@ ### Minor Analysis Improvements -* Changes to the MaD model generation infrastructure: Changed the query `cs/utils/modelgenerator/summary-models` to use the implementation from `cs/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `cs/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `cs/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). +* Changes to the MaD model generation infrastructure: + * Changed the query `cs/utils/modelgenerator/summary-models` to use the implementation from `cs/utils/modelgenerator/mixed-summary-models`. + * Removed the now-redundant `cs/utils/modelgenerator/mixed-summary-models` query. + * A similar replacement was made for `cs/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries`, combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). * Improved detection of authorization checks in the `cs/web/missing-function-level-access-control` query. The query now recognizes authorization attributes inherited from base classes and interfaces. * The precision of the query `cs/invalid-string-formatting` has been improved. More methods and more overloads of existing format like methods are taken into account by the query. diff --git a/csharp/ql/src/change-notes/released/1.1.2.md b/csharp/ql/src/change-notes/released/1.1.2.md index 082e88ead7ac..8a2e1d444d62 100644 --- a/csharp/ql/src/change-notes/released/1.1.2.md +++ b/csharp/ql/src/change-notes/released/1.1.2.md @@ -2,6 +2,9 @@ ### Minor Analysis Improvements -* Changes to the MaD model generation infrastructure: Changed the query `cs/utils/modelgenerator/summary-models` to use the implementation from `cs/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `cs/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `cs/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). +* Changes to the MaD model generation infrastructure: + * Changed the query `cs/utils/modelgenerator/summary-models` to use the implementation from `cs/utils/modelgenerator/mixed-summary-models`. + * Removed the now-redundant `cs/utils/modelgenerator/mixed-summary-models` query. + * A similar replacement was made for `cs/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries`, combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). * Improved detection of authorization checks in the `cs/web/missing-function-level-access-control` query. The query now recognizes authorization attributes inherited from base classes and interfaces. * The precision of the query `cs/invalid-string-formatting` has been improved. More methods and more overloads of existing format like methods are taken into account by the query. diff --git a/java/ql/src/CHANGELOG.md b/java/ql/src/CHANGELOG.md index 9978ca0e8256..8b8ac750e689 100644 --- a/java/ql/src/CHANGELOG.md +++ b/java/ql/src/CHANGELOG.md @@ -2,7 +2,10 @@ ### Minor Analysis Improvements -* Changes to the MaD model generation infrastructure: Changed the query `java/utils/modelgenerator/summary-models` to use the implementation from `java/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `java/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `java/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). +* Changes to the MaD model generation infrastructure: + * Changed the query `java/utils/modelgenerator/summary-models` to use the implementation from `java/utils/modelgenerator/mixed-summary-models`. + * Removed the now-redundant `java/utils/modelgenerator/mixed-summary-models` query. + * A similar replacement was made for `java/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries`, combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). ## 1.4.1 diff --git a/java/ql/src/change-notes/released/1.4.2.md b/java/ql/src/change-notes/released/1.4.2.md index 406d1933c656..97515d2e0afd 100644 --- a/java/ql/src/change-notes/released/1.4.2.md +++ b/java/ql/src/change-notes/released/1.4.2.md @@ -2,4 +2,7 @@ ### Minor Analysis Improvements -* Changes to the MaD model generation infrastructure: Changed the query `java/utils/modelgenerator/summary-models` to use the implementation from `java/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `java/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `java/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). +* Changes to the MaD model generation infrastructure: + * Changed the query `java/utils/modelgenerator/summary-models` to use the implementation from `java/utils/modelgenerator/mixed-summary-models`. + * Removed the now-redundant `java/utils/modelgenerator/mixed-summary-models` query. + * A similar replacement was made for `java/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries`, combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). diff --git a/java/ql/src/dx.ql b/java/ql/src/dx.ql new file mode 100644 index 000000000000..2032957996f9 --- /dev/null +++ b/java/ql/src/dx.ql @@ -0,0 +1,17 @@ +/** + * @name sm + * @kind problem + * @id java/sm + * @severity warning + */ + +import semmle.code.java.dataflow.internal.ExternalFlowExtensions + +from + string s, string package, string type, boolean subtypes, string name, string signature, + string ext, string input, string output, string kind, string provenance, + QlBuiltins::ExtensionId madId +where + summaryModel(package, type, subtypes, name, signature, ext, input, output, kind, provenance, madId) and + s = package + "." + type + "." + name + signature +select s, "summary model" diff --git a/rust/ql/src/CHANGELOG.md b/rust/ql/src/CHANGELOG.md index 593b7755bbdc..cc9fb2bcf682 100644 --- a/rust/ql/src/CHANGELOG.md +++ b/rust/ql/src/CHANGELOG.md @@ -2,7 +2,10 @@ ### Minor Analysis Improvements -* Changes to the MaD model generation infrastructure: Changed the query `rust/utils/modelgenerator/summary-models` to use the implementation from `rust/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `rust/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `rust/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). +* Changes to the MaD model generation infrastructure: + * Changed the query `rust/utils/modelgenerator/summary-models` to use the implementation from `rust/utils/modelgenerator/mixed-summary-models`. + * Removed the now-redundant `rust/utils/modelgenerator/mixed-summary-models` query. + * A similar replacement was made for `rust/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries`, combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). ## 0.1.6 diff --git a/rust/ql/src/change-notes/released/0.1.7.md b/rust/ql/src/change-notes/released/0.1.7.md index 7ba124d7e03c..8ae4d795e079 100644 --- a/rust/ql/src/change-notes/released/0.1.7.md +++ b/rust/ql/src/change-notes/released/0.1.7.md @@ -2,4 +2,7 @@ ### Minor Analysis Improvements -* Changes to the MaD model generation infrastructure: Changed the query `rust/utils/modelgenerator/summary-models` to use the implementation from `rust/utils/modelgenerator/mixed-summary-models`. Removed the now-redundant `rust/utils/modelgenerator/mixed-summary-models` query. Similar replacement was made for `rust/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries` combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). +* Changes to the MaD model generation infrastructure: + * Changed the query `rust/utils/modelgenerator/summary-models` to use the implementation from `rust/utils/modelgenerator/mixed-summary-models`. + * Removed the now-redundant `rust/utils/modelgenerator/mixed-summary-models` query. + * A similar replacement was made for `rust/utils/modelgenerator/neutral-models`. That is, if `GenerateFlowModel.py` is provided with `--with-summaries`, combined/mixed models are now generated instead of heuristic models (and similar for `--with-neutrals`). From e3f33f192f6c997c3041039415a8b6c47b498154 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Mon, 28 Apr 2025 13:55:34 +0100 Subject: [PATCH 239/240] Remove erroneously-committed query --- java/ql/src/dx.ql | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 java/ql/src/dx.ql diff --git a/java/ql/src/dx.ql b/java/ql/src/dx.ql deleted file mode 100644 index 2032957996f9..000000000000 --- a/java/ql/src/dx.ql +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @name sm - * @kind problem - * @id java/sm - * @severity warning - */ - -import semmle.code.java.dataflow.internal.ExternalFlowExtensions - -from - string s, string package, string type, boolean subtypes, string name, string signature, - string ext, string input, string output, string kind, string provenance, - QlBuiltins::ExtensionId madId -where - summaryModel(package, type, subtypes, name, signature, ext, input, output, kind, provenance, madId) and - s = package + "." + type + "." + name + signature -select s, "summary model" From 6285c2e502aa2930d2ffb4ad2bfd3488d099aa55 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Wed, 30 Apr 2025 16:24:22 -0700 Subject: [PATCH 240/240] Actions: Retroactively add GA changenote This was manually added in the docs site at the time of 2.21.1 release and GA. Include the change note in the relevant places so it remains in future docs updates: - codeql/actions-queries@0.5.4 - codeql/actions-all@0.4.7 - 2.21.1 changelog --- actions/ql/lib/CHANGELOG.md | 4 +++- actions/ql/lib/change-notes/released/0.4.7.md | 4 +++- actions/ql/src/CHANGELOG.md | 4 ++++ actions/ql/src/change-notes/released/0.5.4.md | 4 ++++ .../codeql-changelog/codeql-cli-2.21.1.rst | 13 +++++++++++++ 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/actions/ql/lib/CHANGELOG.md b/actions/ql/lib/CHANGELOG.md index 0adf75f4cc0d..e16567daffd3 100644 --- a/actions/ql/lib/CHANGELOG.md +++ b/actions/ql/lib/CHANGELOG.md @@ -4,7 +4,9 @@ No user-facing changes. ## 0.4.7 -No user-facing changes. +### New Features + +* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available. ## 0.4.6 diff --git a/actions/ql/lib/change-notes/released/0.4.7.md b/actions/ql/lib/change-notes/released/0.4.7.md index e9bb7a76bcb1..90e0acec41cf 100644 --- a/actions/ql/lib/change-notes/released/0.4.7.md +++ b/actions/ql/lib/change-notes/released/0.4.7.md @@ -1,3 +1,5 @@ ## 0.4.7 -No user-facing changes. +### New Features + +* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available. diff --git a/actions/ql/src/CHANGELOG.md b/actions/ql/src/CHANGELOG.md index 4faccf28ebd9..73cc65ebe217 100644 --- a/actions/ql/src/CHANGELOG.md +++ b/actions/ql/src/CHANGELOG.md @@ -20,6 +20,10 @@ ## 0.5.4 +### New Features + +* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available. + ### Bug Fixes * Alerts produced by the query `actions/missing-workflow-permissions` now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file. diff --git a/actions/ql/src/change-notes/released/0.5.4.md b/actions/ql/src/change-notes/released/0.5.4.md index d34090f9955c..a6174ef6d1d6 100644 --- a/actions/ql/src/change-notes/released/0.5.4.md +++ b/actions/ql/src/change-notes/released/0.5.4.md @@ -1,5 +1,9 @@ ## 0.5.4 +### New Features + +* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available. + ### Bug Fixes * Alerts produced by the query `actions/missing-workflow-permissions` now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file. diff --git a/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst index 1c28523b18f6..2a8e20d84d1f 100644 --- a/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst +++ b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst @@ -37,6 +37,14 @@ Bug Fixes Query Packs ----------- +New Features +~~~~~~~~~~~~ + +GitHub Actions +"""""""""""""" + +* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available. + Bug Fixes ~~~~~~~~~ @@ -123,6 +131,11 @@ Ruby New Features ~~~~~~~~~~~~ +GitHub Actions +"""""""""""""" + +* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available. + C/C++ """""