diff --git a/cpp/ql/lib/CHANGELOG.md b/cpp/ql/lib/CHANGELOG.md index d84fe585fca..4091ef97e4d 100644 --- a/cpp/ql/lib/CHANGELOG.md +++ b/cpp/ql/lib/CHANGELOG.md @@ -1,3 +1,13 @@ +## 3.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Deprecated APIs + +* The `NonThrowing` class (`semmle.code.cpp.models.interfaces.NonThrowing`) has been deprecated. Please use the `NonCppThrowingFunction` class instead. + ## 2.1.1 No user-facing changes. diff --git a/cpp/ql/lib/change-notes/2024-11-18-throwing-functions.md b/cpp/ql/lib/change-notes/2024-11-18-throwing-functions.md deleted file mode 100644 index 73b358a0e1f..00000000000 --- a/cpp/ql/lib/change-notes/2024-11-18-throwing-functions.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: deprecated ---- -* The `NonThrowing` class (`semmle.code.cpp.models.interfaces.NonThrowing`) has been deprecated. Please use the `NonCppThrowingFunction` class instead. \ No newline at end of file diff --git a/go/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md b/cpp/ql/lib/change-notes/released/3.0.0.md similarity index 55% rename from go/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md rename to cpp/ql/lib/change-notes/released/3.0.0.md index d09ec528c99..5945c94c566 100644 --- a/go/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md +++ b/cpp/ql/lib/change-notes/released/3.0.0.md @@ -1,4 +1,9 @@ ---- -category: breaking ---- +## 3.0.0 + +### Breaking Changes + * Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Deprecated APIs + +* The `NonThrowing` class (`semmle.code.cpp.models.interfaces.NonThrowing`) has been deprecated. Please use the `NonCppThrowingFunction` class instead. diff --git a/cpp/ql/lib/codeql-pack.release.yml b/cpp/ql/lib/codeql-pack.release.yml index 576c2ea18d6..33d3a2cd113 100644 --- a/cpp/ql/lib/codeql-pack.release.yml +++ b/cpp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.1.1 +lastReleaseVersion: 3.0.0 diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index 001028daae1..4bb4b04e02f 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 2.1.2-dev +version: 3.0.1-dev groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/src/CHANGELOG.md b/cpp/ql/src/CHANGELOG.md index 5bb266bdd64..74781fe0f87 100644 --- a/cpp/ql/src/CHANGELOG.md +++ b/cpp/ql/src/CHANGELOG.md @@ -1,3 +1,13 @@ +## 1.3.0 + +### New Queries + +* Added a new high-precision quality query, `cpp/guarded-free`, which detects useless NULL pointer checks before calls to `free`. A variation of this query was originally contributed as an [experimental query by @mario-campos](https://github.com/github/codeql/pull/16331). + +### Minor Analysis Improvements + +* The "Call to function with fewer arguments than declared parameters" query (`cpp/too-few-arguments`) query no longer produces results if the function has been implicitly declared. + ## 1.2.7 No user-facing changes. diff --git a/cpp/ql/src/change-notes/2024-11-22-too-few-arguments.md b/cpp/ql/src/change-notes/2024-11-22-too-few-arguments.md deleted file mode 100644 index 116df08838a..00000000000 --- a/cpp/ql/src/change-notes/2024-11-22-too-few-arguments.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* The "Call to function with fewer arguments than declared parameters" query (`cpp/too-few-arguments`) query no longer produces results if the function has been implicitly declared. diff --git a/cpp/ql/src/change-notes/2014-11-26-guarded-free.md b/cpp/ql/src/change-notes/released/1.3.0.md similarity index 52% rename from cpp/ql/src/change-notes/2014-11-26-guarded-free.md rename to cpp/ql/src/change-notes/released/1.3.0.md index 4280025a04f..1443206add8 100644 --- a/cpp/ql/src/change-notes/2014-11-26-guarded-free.md +++ b/cpp/ql/src/change-notes/released/1.3.0.md @@ -1,4 +1,9 @@ ---- -category: newQuery ---- +## 1.3.0 + +### New Queries + * Added a new high-precision quality query, `cpp/guarded-free`, which detects useless NULL pointer checks before calls to `free`. A variation of this query was originally contributed as an [experimental query by @mario-campos](https://github.com/github/codeql/pull/16331). + +### Minor Analysis Improvements + +* The "Call to function with fewer arguments than declared parameters" query (`cpp/too-few-arguments`) query no longer produces results if the function has been implicitly declared. diff --git a/cpp/ql/src/codeql-pack.release.yml b/cpp/ql/src/codeql-pack.release.yml index 950e0645d4a..ec16350ed6f 100644 --- a/cpp/ql/src/codeql-pack.release.yml +++ b/cpp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.2.7 +lastReleaseVersion: 1.3.0 diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index 2fcf45807da..940c3e2a4cb 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 1.2.8-dev +version: 1.3.1-dev groups: - cpp - queries diff --git a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md index 93e737ae669..a71f93aacd4 100644 --- a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.30 + +No user-facing changes. + ## 1.7.29 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.30.md b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.30.md new file mode 100644 index 00000000000..8fb79827401 --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.30.md @@ -0,0 +1,3 @@ +## 1.7.30 + +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 34100d3ad64..c0346e526b9 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.29 +lastReleaseVersion: 1.7.30 diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index 0c8db9920eb..781915bf1a1 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.30-dev +version: 1.7.31-dev groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md index 93e737ae669..a71f93aacd4 100644 --- a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.30 + +No user-facing changes. + ## 1.7.29 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.30.md b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.30.md new file mode 100644 index 00000000000..8fb79827401 --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.30.md @@ -0,0 +1,3 @@ +## 1.7.30 + +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 34100d3ad64..c0346e526b9 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.29 +lastReleaseVersion: 1.7.30 diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index 3a4343780e4..979d8e6c661 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.30-dev +version: 1.7.31-dev groups: - csharp - solorigate diff --git a/csharp/ql/lib/CHANGELOG.md b/csharp/ql/lib/CHANGELOG.md index c76569e4ab3..86f279365f0 100644 --- a/csharp/ql/lib/CHANGELOG.md +++ b/csharp/ql/lib/CHANGELOG.md @@ -1,3 +1,20 @@ +## 4.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Minor Analysis Improvements + +* Added support for data-flow through member accesses of objects with `dynamic` types. +* Only extract *public* and *protected* members from reference assemblies. This yields an approximate average speed-up of around 10% for extraction and query execution. Custom MaD rows using `Field`-based summaries may need to be changed to `SyntheticField`-based flows if they reference private fields. +* Added `Microsoft.AspNetCore.Components.NagivationManager::Uri` as a remote flow source, since this value may contain user-specified values. +* Added the following URI-parsing methods as summaries, as they may be tainted with user-specified values: + - `System.Web.HttpUtility::ParseQueryString` + - `Microsoft.AspNetCore.WebUtilities.QueryHelpers::ParseQuery` + - `Microsoft.AspNetCore.WebUtilities.QueryHelpers::ParseNullableQuery` +* Added `js-interop` sinks for the `InvokeAsync` and `InvokeVoidAsync` methods of `Microsoft.JSInterop.IJSRuntime`, which can run arbitrary JavaScript. + ## 3.1.1 ### Minor Analysis Improvements diff --git a/csharp/ql/lib/change-notes/2024-11-26-model-microsoft.jsinterop.ijsruntime.md b/csharp/ql/lib/change-notes/2024-11-26-model-microsoft.jsinterop.ijsruntime.md deleted file mode 100644 index a99f9c8e0fd..00000000000 --- a/csharp/ql/lib/change-notes/2024-11-26-model-microsoft.jsinterop.ijsruntime.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -category: minorAnalysis ---- -* Added `js-interop` sinks for the `InvokeAsync` and `InvokeVoidAsync` methods of `Microsoft.JSInterop.IJSRuntime`, which can run arbitrary JavaScript. - diff --git a/csharp/ql/lib/change-notes/2024-11-27-navigationmanager.uri-and-uri-parsing-utilities.md b/csharp/ql/lib/change-notes/2024-11-27-navigationmanager.uri-and-uri-parsing-utilities.md deleted file mode 100644 index 2d9866c2e15..00000000000 --- a/csharp/ql/lib/change-notes/2024-11-27-navigationmanager.uri-and-uri-parsing-utilities.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -category: minorAnalysis ---- -* Added `Microsoft.AspNetCore.Components.NagivationManager::Uri` as a remote flow source, since this value may contain user-specified values. -* Added the following URI-parsing methods as summaries, as they may be tainted with user-specified values: - - `System.Web.HttpUtility::ParseQueryString` - - `Microsoft.AspNetCore.WebUtilities.QueryHelpers::ParseQuery` - - `Microsoft.AspNetCore.WebUtilities.QueryHelpers::ParseNullableQuery` diff --git a/csharp/ql/lib/change-notes/2024-12-03-dynamic-field-flow.md b/csharp/ql/lib/change-notes/2024-12-03-dynamic-field-flow.md deleted file mode 100644 index 4d5f8f9258e..00000000000 --- a/csharp/ql/lib/change-notes/2024-12-03-dynamic-field-flow.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added support for data-flow through member accesses of objects with `dynamic` types. diff --git a/csharp/ql/lib/change-notes/2024-12-03-public-protected-reference.md b/csharp/ql/lib/change-notes/2024-12-03-public-protected-reference.md deleted file mode 100644 index 7b284df3652..00000000000 --- a/csharp/ql/lib/change-notes/2024-12-03-public-protected-reference.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Only extract *public* and *protected* members from reference assemblies. This yields an approximate average speed-up of around 10% for extraction and query execution. Custom MaD rows using `Field`-based summaries may need to be changed to `SyntheticField`-based flows if they reference private fields. diff --git a/csharp/ql/lib/change-notes/released/4.0.0.md b/csharp/ql/lib/change-notes/released/4.0.0.md new file mode 100644 index 00000000000..2a64ac00232 --- /dev/null +++ b/csharp/ql/lib/change-notes/released/4.0.0.md @@ -0,0 +1,16 @@ +## 4.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Minor Analysis Improvements + +* Added support for data-flow through member accesses of objects with `dynamic` types. +* Only extract *public* and *protected* members from reference assemblies. This yields an approximate average speed-up of around 10% for extraction and query execution. Custom MaD rows using `Field`-based summaries may need to be changed to `SyntheticField`-based flows if they reference private fields. +* Added `Microsoft.AspNetCore.Components.NagivationManager::Uri` as a remote flow source, since this value may contain user-specified values. +* Added the following URI-parsing methods as summaries, as they may be tainted with user-specified values: + - `System.Web.HttpUtility::ParseQueryString` + - `Microsoft.AspNetCore.WebUtilities.QueryHelpers::ParseQuery` + - `Microsoft.AspNetCore.WebUtilities.QueryHelpers::ParseNullableQuery` +* Added `js-interop` sinks for the `InvokeAsync` and `InvokeVoidAsync` methods of `Microsoft.JSInterop.IJSRuntime`, which can run arbitrary JavaScript. diff --git a/csharp/ql/lib/codeql-pack.release.yml b/csharp/ql/lib/codeql-pack.release.yml index c06beda86a3..49fe3eef697 100644 --- a/csharp/ql/lib/codeql-pack.release.yml +++ b/csharp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 3.1.1 +lastReleaseVersion: 4.0.0 diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index efc82eedc90..81a55470a4d 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 3.1.2-dev +version: 4.0.1-dev groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/src/CHANGELOG.md b/csharp/ql/src/CHANGELOG.md index 99528b54e9e..370a9cf4a6a 100644 --- a/csharp/ql/src/CHANGELOG.md +++ b/csharp/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.0.13 + +### Minor Analysis Improvements + +* `csharp/diagnostic/database-quality` has been changed to exclude various property access expressions from database quality evaluation. The excluded property access expressions are expected to have no target callables even in manual or autobuilt databases. + ## 1.0.12 No user-facing changes. diff --git a/csharp/ql/src/change-notes/2024-11-28-db-quality-property-access.md b/csharp/ql/src/change-notes/released/1.0.13.md similarity index 85% rename from csharp/ql/src/change-notes/2024-11-28-db-quality-property-access.md rename to csharp/ql/src/change-notes/released/1.0.13.md index 212c01f24bb..cfce05a8733 100644 --- a/csharp/ql/src/change-notes/2024-11-28-db-quality-property-access.md +++ b/csharp/ql/src/change-notes/released/1.0.13.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- +## 1.0.13 + +### Minor Analysis Improvements + * `csharp/diagnostic/database-quality` has been changed to exclude various property access expressions from database quality evaluation. The excluded property access expressions are expected to have no target callables even in manual or autobuilt databases. diff --git a/csharp/ql/src/codeql-pack.release.yml b/csharp/ql/src/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/csharp/ql/src/codeql-pack.release.yml +++ b/csharp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/csharp/ql/src/qlpack.yml b/csharp/ql/src/qlpack.yml index 569b69021d1..e4d9400d96d 100644 --- a/csharp/ql/src/qlpack.yml +++ b/csharp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-queries -version: 1.0.13-dev +version: 1.0.14-dev groups: - csharp - queries diff --git a/go/actions/test/action.yml b/go/actions/test/action.yml index 5228f440971..0a4f13fa0ef 100644 --- a/go/actions/test/action.yml +++ b/go/actions/test/action.yml @@ -59,7 +59,7 @@ runs: - name: Upload qhelp markdown if: inputs.run-code-checks == 'true' && !cancelled() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: qhelp-markdown path: go/qhelp-out/**/*.md diff --git a/go/ql/consistency-queries/CHANGELOG.md b/go/ql/consistency-queries/CHANGELOG.md index eeb6b0a262a..3c6fa155a32 100644 --- a/go/ql/consistency-queries/CHANGELOG.md +++ b/go/ql/consistency-queries/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/go/ql/consistency-queries/change-notes/released/1.0.13.md b/go/ql/consistency-queries/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/go/ql/consistency-queries/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +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 2036690b201..c3be7eb7716 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.12 +lastReleaseVersion: 1.0.13 diff --git a/go/ql/consistency-queries/qlpack.yml b/go/ql/consistency-queries/qlpack.yml index 60d11115c14..1812705438c 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.13-dev +version: 1.0.14-dev groups: - go - queries diff --git a/go/ql/lib/CHANGELOG.md b/go/ql/lib/CHANGELOG.md index b2eb3cbb239..83052b3a1d9 100644 --- a/go/ql/lib/CHANGELOG.md +++ b/go/ql/lib/CHANGELOG.md @@ -1,3 +1,17 @@ +## 3.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Minor Analysis Improvements + +* A call to a method whose name starts with "Debug", "Error", "Fatal", "Info", "Log", "Output", "Panic", "Print", "Trace", "Warn" or "With" defined on an interface whose name ends in "logger" or "Logger" is now considered a LoggerCall. In particular, it is a sink for `go/clear-text-logging` and `go/log-injection`. This may lead to some more alerts in those queries. + +### Bug Fixes + +* Fixed a bug which meant that promoted fields and methods were missing when the embedded parent was not promoted due to a name clash. + ## 2.1.3 ### Minor Analysis Improvements diff --git a/go/ql/lib/change-notes/2024-11-17-fix-missing-promoted-fields-and-methods-name-clash.md b/go/ql/lib/change-notes/2024-11-17-fix-missing-promoted-fields-and-methods-name-clash.md deleted file mode 100644 index 8b1ee9b60b2..00000000000 --- a/go/ql/lib/change-notes/2024-11-17-fix-missing-promoted-fields-and-methods-name-clash.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: fix ---- -* Fixed a bug which meant that promoted fields and methods were missing when the embedded parent was not promoted due to a name clash. diff --git a/go/ql/lib/change-notes/2024-11-20-heuristic-logging-sinks.md b/go/ql/lib/change-notes/2024-11-20-heuristic-logging-sinks.md deleted file mode 100644 index 46f5988b379..00000000000 --- a/go/ql/lib/change-notes/2024-11-20-heuristic-logging-sinks.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* A call to a method whose name starts with "Debug", "Error", "Fatal", "Info", "Log", "Output", "Panic", "Print", "Trace", "Warn" or "With" defined on an interface whose name ends in "logger" or "Logger" is now considered a LoggerCall. In particular, it is a sink for `go/clear-text-logging` and `go/log-injection`. This may lead to some more alerts in those queries. diff --git a/go/ql/lib/change-notes/released/3.0.0.md b/go/ql/lib/change-notes/released/3.0.0.md new file mode 100644 index 00000000000..5aafa0c29d1 --- /dev/null +++ b/go/ql/lib/change-notes/released/3.0.0.md @@ -0,0 +1,13 @@ +## 3.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Minor Analysis Improvements + +* A call to a method whose name starts with "Debug", "Error", "Fatal", "Info", "Log", "Output", "Panic", "Print", "Trace", "Warn" or "With" defined on an interface whose name ends in "logger" or "Logger" is now considered a LoggerCall. In particular, it is a sink for `go/clear-text-logging` and `go/log-injection`. This may lead to some more alerts in those queries. + +### Bug Fixes + +* Fixed a bug which meant that promoted fields and methods were missing when the embedded parent was not promoted due to a name clash. diff --git a/go/ql/lib/codeql-pack.release.yml b/go/ql/lib/codeql-pack.release.yml index 345fb0c73a4..33d3a2cd113 100644 --- a/go/ql/lib/codeql-pack.release.yml +++ b/go/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.1.3 +lastReleaseVersion: 3.0.0 diff --git a/go/ql/lib/qlpack.yml b/go/ql/lib/qlpack.yml index 98e81430897..4e72aa3857b 100644 --- a/go/ql/lib/qlpack.yml +++ b/go/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-all -version: 2.1.4-dev +version: 3.0.1-dev groups: go dbscheme: go.dbscheme extractor: go diff --git a/go/ql/src/CHANGELOG.md b/go/ql/src/CHANGELOG.md index c529cbffb32..c9044e55cdc 100644 --- a/go/ql/src/CHANGELOG.md +++ b/go/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.1.4 + +### Minor Analysis Improvements + +* Added value flow models for functions in the `slices` package which do not involve the `iter` package. + ## 1.1.3 No user-facing changes. diff --git a/go/ql/src/change-notes/2024-11-26-model-slices-package.md b/go/ql/src/change-notes/released/1.1.4.md similarity index 70% rename from go/ql/src/change-notes/2024-11-26-model-slices-package.md rename to go/ql/src/change-notes/released/1.1.4.md index 5a3141c8075..0437ebd2bd6 100644 --- a/go/ql/src/change-notes/2024-11-26-model-slices-package.md +++ b/go/ql/src/change-notes/released/1.1.4.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- +## 1.1.4 + +### Minor Analysis Improvements + * Added value flow models for functions in the `slices` package which do not involve the `iter` package. diff --git a/go/ql/src/codeql-pack.release.yml b/go/ql/src/codeql-pack.release.yml index 35e710ab1bf..26cbcd3f123 100644 --- a/go/ql/src/codeql-pack.release.yml +++ b/go/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.3 +lastReleaseVersion: 1.1.4 diff --git a/go/ql/src/qlpack.yml b/go/ql/src/qlpack.yml index 866a0935713..36775d0d862 100644 --- a/go/ql/src/qlpack.yml +++ b/go/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-queries -version: 1.1.4-dev +version: 1.1.5-dev groups: - go - queries diff --git a/java/ql/lib/CHANGELOG.md b/java/ql/lib/CHANGELOG.md index 990fea9ddd7..09ee80087e8 100644 --- a/java/ql/lib/CHANGELOG.md +++ b/java/ql/lib/CHANGELOG.md @@ -1,3 +1,13 @@ +## 5.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Minor Analysis Improvements + +* Calling `coll.contains(x)` is now a taint sanitizer (for any query) for the value `x`, where `coll` is a collection of constants. + ## 4.2.1 ### Minor Analysis Improvements diff --git a/java/ql/lib/change-notes/2024-11-04-list-of-constants-sanitizer.md b/java/ql/lib/change-notes/2024-11-04-list-of-constants-sanitizer.md deleted file mode 100644 index dea1e7ff81e..00000000000 --- a/java/ql/lib/change-notes/2024-11-04-list-of-constants-sanitizer.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Calling `coll.contains(x)` is now a taint sanitizer (for any query) for the value `x`, where `coll` is a collection of constants. diff --git a/csharp/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md b/java/ql/lib/change-notes/released/5.0.0.md similarity index 56% rename from csharp/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md rename to java/ql/lib/change-notes/released/5.0.0.md index d09ec528c99..9d9e2bc61b5 100644 --- a/csharp/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md +++ b/java/ql/lib/change-notes/released/5.0.0.md @@ -1,4 +1,9 @@ ---- -category: breaking ---- +## 5.0.0 + +### Breaking Changes + * Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Minor Analysis Improvements + +* Calling `coll.contains(x)` is now a taint sanitizer (for any query) for the value `x`, where `coll` is a collection of constants. diff --git a/java/ql/lib/codeql-pack.release.yml b/java/ql/lib/codeql-pack.release.yml index 38ea9976fcc..c9e54136ca5 100644 --- a/java/ql/lib/codeql-pack.release.yml +++ b/java/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.2.1 +lastReleaseVersion: 5.0.0 diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml index a8c1ee2de2b..f892ca1c450 100644 --- a/java/ql/lib/qlpack.yml +++ b/java/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-all -version: 4.2.2-dev +version: 5.0.1-dev groups: java dbscheme: config/semmlecode.dbscheme extractor: java diff --git a/java/ql/src/CHANGELOG.md b/java/ql/src/CHANGELOG.md index f212b4a8d3d..0bb38874b82 100644 --- a/java/ql/src/CHANGELOG.md +++ b/java/ql/src/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.1.10 + +### Minor Analysis Improvements + +* Added SHA-384 to the list of secure hashing algorithms. As a result the `java/potentially-weak-cryptographic-algorithm` query should no longer flag up uses of SHA-384. +* Added SHA3 to the list of secure hashing algorithms. As a result the `java/potentially-weak-cryptographic-algorithm` query should no longer flag up uses of SHA3. +* The `java/weak-cryptographic-algorithm` query has been updated to no longer report uses of hash functions such as `MD5` and `SHA1` even if they are known to be weak. These hash algorithms are used very often in non-sensitive contexts, making the query too imprecise in practice. The `java/potentially-weak-cryptographic-algorithm` query has been updated to report these uses instead. + ## 1.1.9 No user-facing changes. diff --git a/java/ql/src/change-notes/2024-11-22-sha3.md b/java/ql/src/change-notes/2024-11-22-sha3.md deleted file mode 100644 index 61dbc35162e..00000000000 --- a/java/ql/src/change-notes/2024-11-22-sha3.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added SHA3 to the list of secure hashing algorithms. As a result the `java/potentially-weak-cryptographic-algorithm` query should no longer flag up uses of SHA3. diff --git a/java/ql/src/change-notes/2024-11-24-sha2.md b/java/ql/src/change-notes/2024-11-24-sha2.md deleted file mode 100644 index 395ea04b782..00000000000 --- a/java/ql/src/change-notes/2024-11-24-sha2.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added SHA-384 to the list of secure hashing algorithms. As a result the `java/potentially-weak-cryptographic-algorithm` query should no longer flag up uses of SHA-384. diff --git a/java/ql/src/change-notes/2024-10-29-weak-crypto-hash.md b/java/ql/src/change-notes/released/1.1.10.md similarity index 50% rename from java/ql/src/change-notes/2024-10-29-weak-crypto-hash.md rename to java/ql/src/change-notes/released/1.1.10.md index b4ac88bcdc6..fef22bdedf5 100644 --- a/java/ql/src/change-notes/2024-10-29-weak-crypto-hash.md +++ b/java/ql/src/change-notes/released/1.1.10.md @@ -1,4 +1,7 @@ ---- -category: minorAnalysis ---- +## 1.1.10 + +### Minor Analysis Improvements + +* Added SHA-384 to the list of secure hashing algorithms. As a result the `java/potentially-weak-cryptographic-algorithm` query should no longer flag up uses of SHA-384. +* Added SHA3 to the list of secure hashing algorithms. As a result the `java/potentially-weak-cryptographic-algorithm` query should no longer flag up uses of SHA3. * The `java/weak-cryptographic-algorithm` query has been updated to no longer report uses of hash functions such as `MD5` and `SHA1` even if they are known to be weak. These hash algorithms are used very often in non-sensitive contexts, making the query too imprecise in practice. The `java/potentially-weak-cryptographic-algorithm` query has been updated to report these uses instead. diff --git a/java/ql/src/codeql-pack.release.yml b/java/ql/src/codeql-pack.release.yml index 6f4795f3ea0..4c01918d414 100644 --- a/java/ql/src/codeql-pack.release.yml +++ b/java/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.9 +lastReleaseVersion: 1.1.10 diff --git a/java/ql/src/qlpack.yml b/java/ql/src/qlpack.yml index 44740683f14..8ee211fb536 100644 --- a/java/ql/src/qlpack.yml +++ b/java/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-queries -version: 1.1.10-dev +version: 1.1.11-dev groups: - java - queries diff --git a/javascript/ql/lib/CHANGELOG.md b/javascript/ql/lib/CHANGELOG.md index 7d8f8dcfc8b..ebe424935eb 100644 --- a/javascript/ql/lib/CHANGELOG.md +++ b/javascript/ql/lib/CHANGELOG.md @@ -1,12 +1,27 @@ +## 2.2.0 + +### Major Analysis Improvements + +* The `js/incomplete-sanitization` query now also checks regular expressions constructed using `new RegExp(..)`. Previously it only checked regular expression literals. +* Regular expression-based sanitisers implemented with `new RegExp(..)` are now detected in more cases. +* Regular expression related queries now account for unknown flags. + +### Minor Analysis Improvements + +* Added taint-steps for `String.prototype.toWellFormed`. +* Added taint-steps for `Map.groupBy` and `Object.groupBy`. +* Added taint-steps for `Array.prototype.findLast`. +* Added taint-steps for `Array.prototype.findLastIndex`. + ## 2.1.1 ### Minor Analysis Improvements -Added taint-steps for `Array.prototype.with`. -Added taint-steps for `Array.prototype.toSpliced` +* Added taint-steps for `Array.prototype.with`. +* Added taint-steps for `Array.prototype.toSpliced` * Added taint-steps for `Array.prototype.toReversed`. * Added taint-steps for `Array.prototype.toSorted`. -Added support for `String.prototype.matchAll`. +* Added support for `String.prototype.matchAll`. * Added taint-steps for `Array.prototype.reverse` ## 2.1.0 diff --git a/javascript/ql/lib/change-notes/2024-11-18-ES2022-find-functions.md b/javascript/ql/lib/change-notes/2024-11-18-ES2022-find-functions.md deleted file mode 100644 index e3fe3b6aef2..00000000000 --- a/javascript/ql/lib/change-notes/2024-11-18-ES2022-find-functions.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -category: minorAnalysis ---- -* Added taint-steps for `Array.prototype.findLast` -* Added taint-steps for `Array.prototype.findLastIndex` diff --git a/javascript/ql/lib/change-notes/2024-11-20-ES2023-string-protytpe-toWellFormed.md b/javascript/ql/lib/change-notes/2024-11-20-ES2023-string-protytpe-toWellFormed.md deleted file mode 100644 index dda4d878760..00000000000 --- a/javascript/ql/lib/change-notes/2024-11-20-ES2023-string-protytpe-toWellFormed.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added taint-steps for `String.prototype.toWellFormed`. diff --git a/javascript/ql/lib/change-notes/2024-11-20-ES2024-group-functions.md b/javascript/ql/lib/change-notes/2024-11-20-ES2024-group-functions.md deleted file mode 100644 index 8511727f8e7..00000000000 --- a/javascript/ql/lib/change-notes/2024-11-20-ES2024-group-functions.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added taint-steps for `Map.groupBy` and `Object.groupBy`. diff --git a/javascript/ql/lib/change-notes/2024-11-28-regexp-unknown-flags.md b/javascript/ql/lib/change-notes/released/2.2.0.md similarity index 52% rename from javascript/ql/lib/change-notes/2024-11-28-regexp-unknown-flags.md rename to javascript/ql/lib/change-notes/released/2.2.0.md index e1db79e5c86..f8c194f73f8 100644 --- a/javascript/ql/lib/change-notes/2024-11-28-regexp-unknown-flags.md +++ b/javascript/ql/lib/change-notes/released/2.2.0.md @@ -1,6 +1,14 @@ ---- -category: majorAnalysis ---- +## 2.2.0 + +### Major Analysis Improvements + * The `js/incomplete-sanitization` query now also checks regular expressions constructed using `new RegExp(..)`. Previously it only checked regular expression literals. * Regular expression-based sanitisers implemented with `new RegExp(..)` are now detected in more cases. * Regular expression related queries now account for unknown flags. + +### Minor Analysis Improvements + +* Added taint-steps for `String.prototype.toWellFormed`. +* Added taint-steps for `Map.groupBy` and `Object.groupBy`. +* Added taint-steps for `Array.prototype.findLast`. +* Added taint-steps for `Array.prototype.findLastIndex`. diff --git a/javascript/ql/lib/codeql-pack.release.yml b/javascript/ql/lib/codeql-pack.release.yml index 576c2ea18d6..2f308354195 100644 --- a/javascript/ql/lib/codeql-pack.release.yml +++ b/javascript/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.1.1 +lastReleaseVersion: 2.2.0 diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index 9726d407e1a..4d568ff4813 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-all -version: 2.1.2-dev +version: 2.2.1-dev groups: javascript dbscheme: semmlecode.javascript.dbscheme extractor: javascript diff --git a/javascript/ql/src/CHANGELOG.md b/javascript/ql/src/CHANGELOG.md index 403de6b3323..195298ec89f 100644 --- a/javascript/ql/src/CHANGELOG.md +++ b/javascript/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.2.5 + +No user-facing changes. + ## 1.2.4 No user-facing changes. diff --git a/javascript/ql/src/change-notes/released/1.2.5.md b/javascript/ql/src/change-notes/released/1.2.5.md new file mode 100644 index 00000000000..c805dc2cd4c --- /dev/null +++ b/javascript/ql/src/change-notes/released/1.2.5.md @@ -0,0 +1,3 @@ +## 1.2.5 + +No user-facing changes. diff --git a/javascript/ql/src/codeql-pack.release.yml b/javascript/ql/src/codeql-pack.release.yml index 172090f46b6..40355f0807f 100644 --- a/javascript/ql/src/codeql-pack.release.yml +++ b/javascript/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.2.4 +lastReleaseVersion: 1.2.5 diff --git a/javascript/ql/src/qlpack.yml b/javascript/ql/src/qlpack.yml index a1efe30e69d..78f0585027b 100644 --- a/javascript/ql/src/qlpack.yml +++ b/javascript/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-queries -version: 1.2.5-dev +version: 1.2.6-dev groups: - javascript - queries diff --git a/misc/suite-helpers/CHANGELOG.md b/misc/suite-helpers/CHANGELOG.md index 969419cb7b7..5d46c57bf4e 100644 --- a/misc/suite-helpers/CHANGELOG.md +++ b/misc/suite-helpers/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/misc/suite-helpers/change-notes/released/1.0.13.md b/misc/suite-helpers/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/misc/suite-helpers/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/misc/suite-helpers/codeql-pack.release.yml b/misc/suite-helpers/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/misc/suite-helpers/codeql-pack.release.yml +++ b/misc/suite-helpers/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/misc/suite-helpers/qlpack.yml b/misc/suite-helpers/qlpack.yml index e2cbd7f3f9d..eeb8f762b13 100644 --- a/misc/suite-helpers/qlpack.yml +++ b/misc/suite-helpers/qlpack.yml @@ -1,4 +1,4 @@ name: codeql/suite-helpers -version: 1.0.13-dev +version: 1.0.14-dev groups: shared warnOnImplicitThis: true diff --git a/python/ql/lib/CHANGELOG.md b/python/ql/lib/CHANGELOG.md index 34dc5f1b060..81c7659c4ed 100644 --- a/python/ql/lib/CHANGELOG.md +++ b/python/ql/lib/CHANGELOG.md @@ -1,3 +1,13 @@ +## 3.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Bug Fixes + +- Fixed a problem with the control-flow graph construction, where writing `case True:` or `case False:` would cause parts of the graph to be pruned by mistake. + ## 2.2.0 ### Major Analysis Improvements diff --git a/python/ql/lib/change-notes/2024-11-26-fix-match-cfg-pruning.md b/python/ql/lib/change-notes/2024-11-26-fix-match-cfg-pruning.md deleted file mode 100644 index 3ee1094c13b..00000000000 --- a/python/ql/lib/change-notes/2024-11-26-fix-match-cfg-pruning.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -category: fix ---- - -- Fixed a problem with the control-flow graph construction, where writing `case True:` or `case False:` would cause parts of the graph to be pruned by mistake. diff --git a/python/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md b/python/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md deleted file mode 100644 index d09ec528c99..00000000000 --- a/python/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: breaking ---- -* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. diff --git a/python/ql/lib/change-notes/released/3.0.0.md b/python/ql/lib/change-notes/released/3.0.0.md new file mode 100644 index 00000000000..d57189465d8 --- /dev/null +++ b/python/ql/lib/change-notes/released/3.0.0.md @@ -0,0 +1,9 @@ +## 3.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + +### Bug Fixes + +- Fixed a problem with the control-flow graph construction, where writing `case True:` or `case False:` would cause parts of the graph to be pruned by mistake. diff --git a/python/ql/lib/codeql-pack.release.yml b/python/ql/lib/codeql-pack.release.yml index 2f308354195..33d3a2cd113 100644 --- a/python/ql/lib/codeql-pack.release.yml +++ b/python/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.2.0 +lastReleaseVersion: 3.0.0 diff --git a/python/ql/lib/qlpack.yml b/python/ql/lib/qlpack.yml index 290189efa13..147933b96fe 100644 --- a/python/ql/lib/qlpack.yml +++ b/python/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-all -version: 2.2.1-dev +version: 3.0.1-dev groups: python dbscheme: semmlecode.python.dbscheme extractor: python diff --git a/python/ql/src/CHANGELOG.md b/python/ql/src/CHANGELOG.md index 5fea597a7a3..c247e217acf 100644 --- a/python/ql/src/CHANGELOG.md +++ b/python/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.4 + +No user-facing changes. + ## 1.3.3 No user-facing changes. diff --git a/python/ql/src/change-notes/released/1.3.4.md b/python/ql/src/change-notes/released/1.3.4.md new file mode 100644 index 00000000000..5073aca7222 --- /dev/null +++ b/python/ql/src/change-notes/released/1.3.4.md @@ -0,0 +1,3 @@ +## 1.3.4 + +No user-facing changes. diff --git a/python/ql/src/codeql-pack.release.yml b/python/ql/src/codeql-pack.release.yml index eb1f7dabc84..8263ddf2c8b 100644 --- a/python/ql/src/codeql-pack.release.yml +++ b/python/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.3.3 +lastReleaseVersion: 1.3.4 diff --git a/python/ql/src/qlpack.yml b/python/ql/src/qlpack.yml index d84402123dc..d83b6433ac6 100644 --- a/python/ql/src/qlpack.yml +++ b/python/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-queries -version: 1.3.4-dev +version: 1.3.5-dev groups: - python - queries diff --git a/ruby/ql/lib/CHANGELOG.md b/ruby/ql/lib/CHANGELOG.md index 37248cf4960..737903a3232 100644 --- a/ruby/ql/lib/CHANGELOG.md +++ b/ruby/ql/lib/CHANGELOG.md @@ -1,3 +1,9 @@ +## 3.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + ## 2.0.4 No user-facing changes. diff --git a/ruby/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md b/ruby/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md deleted file mode 100644 index d09ec528c99..00000000000 --- a/ruby/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: breaking ---- -* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. diff --git a/java/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md b/ruby/ql/lib/change-notes/released/3.0.0.md similarity index 88% rename from java/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md rename to ruby/ql/lib/change-notes/released/3.0.0.md index d09ec528c99..82b5c467407 100644 --- a/java/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md +++ b/ruby/ql/lib/change-notes/released/3.0.0.md @@ -1,4 +1,5 @@ ---- -category: breaking ---- +## 3.0.0 + +### Breaking Changes + * Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. diff --git a/ruby/ql/lib/codeql-pack.release.yml b/ruby/ql/lib/codeql-pack.release.yml index 0f306f8bd3b..33d3a2cd113 100644 --- a/ruby/ql/lib/codeql-pack.release.yml +++ b/ruby/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.4 +lastReleaseVersion: 3.0.0 diff --git a/ruby/ql/lib/qlpack.yml b/ruby/ql/lib/qlpack.yml index 97259f5dd36..ddf106c95bf 100644 --- a/ruby/ql/lib/qlpack.yml +++ b/ruby/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-all -version: 2.0.5-dev +version: 3.0.1-dev groups: ruby extractor: ruby dbscheme: ruby.dbscheme diff --git a/ruby/ql/src/CHANGELOG.md b/ruby/ql/src/CHANGELOG.md index e159e9fda36..5fe04780136 100644 --- a/ruby/ql/src/CHANGELOG.md +++ b/ruby/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.8 + +No user-facing changes. + ## 1.1.7 No user-facing changes. diff --git a/ruby/ql/src/change-notes/released/1.1.8.md b/ruby/ql/src/change-notes/released/1.1.8.md new file mode 100644 index 00000000000..f4fe325b335 --- /dev/null +++ b/ruby/ql/src/change-notes/released/1.1.8.md @@ -0,0 +1,3 @@ +## 1.1.8 + +No user-facing changes. diff --git a/ruby/ql/src/codeql-pack.release.yml b/ruby/ql/src/codeql-pack.release.yml index 75910556516..64972659c42 100644 --- a/ruby/ql/src/codeql-pack.release.yml +++ b/ruby/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.7 +lastReleaseVersion: 1.1.8 diff --git a/ruby/ql/src/qlpack.yml b/ruby/ql/src/qlpack.yml index 26ac8866ae0..43bfe75f566 100644 --- a/ruby/ql/src/qlpack.yml +++ b/ruby/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-queries -version: 1.1.8-dev +version: 1.1.9-dev groups: - ruby - queries diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index d50633c020b..cbc2dd7c657 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 c77ccf1e73a5b139f768e80580a261f7f3ab76823a1c9095b06f704a4912e8f1 c77ccf1e73a5b139f768e80580a261f7f3ab76823a1c9095b06f704a4912e8f1 +top.rs d09cf25daa06fc9bc802e438231e0f038443d2ede3972a0dd829f322b390c4e4 d09cf25daa06fc9bc802e438231e0f038443d2ede3972a0dd829f322b390c4e4 diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index d74cf3c9749..ee61282295d 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -1711,6 +1711,60 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct Path { + pub id: trap::TrapId, + pub qualifier: Option>, + pub part: Option>, +} + +impl trap::TrapEntry for Path { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("paths", vec![id.into()]); + if let Some(v) = self.qualifier { + out.add_tuple("path_qualifiers", vec![id.into(), v.into()]); + } + if let Some(v) = self.part { + out.add_tuple("path_parts", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for Path { + fn class_name() -> &'static str { "Path" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Path is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Path is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Path is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct PathSegment { pub id: trap::TrapId, @@ -6046,62 +6100,44 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct Path { - pub id: trap::TrapId, - pub qualifier: Option>, - pub part: Option>, +pub struct PathAstNode { + _unused: () } -impl trap::TrapEntry for Path { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("paths", vec![id.into()]); - if let Some(v) = self.qualifier { - out.add_tuple("path_qualifiers", vec![id.into(), v.into()]); - } - if let Some(v) = self.part { - out.add_tuple("path_parts", vec![id.into(), v.into()]); - } - } +impl trap::TrapClass for PathAstNode { + fn class_name() -> &'static str { "PathAstNode" } } -impl trap::TrapClass for Path { - fn class_name() -> &'static str { "Path" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Path is a subclass of AstNode +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathAstNode is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Path is a subclass of Element +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathAstNode is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Path is a subclass of Locatable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathAstNode is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Path is a subclass of Resolvable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathAstNode is a subclass of Resolvable unsafe { Self::from_untyped(value.as_untyped()) } @@ -6153,65 +6189,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct PathPat { - pub id: trap::TrapId, - pub path: Option>, -} - -impl trap::TrapEntry for PathPat { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("path_pats", vec![id.into()]); - if let Some(v) = self.path { - out.add_tuple("path_pat_paths", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for PathPat { - fn class_name() -> &'static str { "PathPat" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme PathPat is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme PathPat is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme PathPat is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme PathPat is a subclass of Pat - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct PathTypeRepr { pub id: trap::TrapId, @@ -6543,69 +6520,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct RecordExpr { - pub id: trap::TrapId, - pub path: Option>, - pub record_expr_field_list: Option>, -} - -impl trap::TrapEntry for RecordExpr { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("record_exprs", vec![id.into()]); - if let Some(v) = self.path { - out.add_tuple("record_expr_paths", vec![id.into(), v.into()]); - } - if let Some(v) = self.record_expr_field_list { - out.add_tuple("record_expr_record_expr_field_lists", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for RecordExpr { - fn class_name() -> &'static str { "RecordExpr" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Expr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct RecordFieldList { pub id: trap::TrapId, @@ -6665,69 +6579,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct RecordPat { - pub id: trap::TrapId, - pub path: Option>, - pub record_pat_field_list: Option>, -} - -impl trap::TrapEntry for RecordPat { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("record_pats", vec![id.into()]); - if let Some(v) = self.path { - out.add_tuple("record_pat_paths", vec![id.into(), v.into()]); - } - if let Some(v) = self.record_pat_field_list { - out.add_tuple("record_pat_record_pat_field_lists", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for RecordPat { - fn class_name() -> &'static str { "RecordPat" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Pat - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct RefExpr { pub id: trap::TrapId, @@ -7492,69 +7343,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct TupleStructPat { - pub id: trap::TrapId, - pub fields: Vec>, - pub path: Option>, -} - -impl trap::TrapEntry for TupleStructPat { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("tuple_struct_pats", vec![id.into()]); - for (i, v) in self.fields.into_iter().enumerate() { - out.add_tuple("tuple_struct_pat_fields", vec![id.into(), i.into(), v.into()]); - } - if let Some(v) = self.path { - out.add_tuple("tuple_struct_pat_paths", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for TupleStructPat { - fn class_name() -> &'static str { "TupleStructPat" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Pat - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct TupleTypeRepr { pub id: trap::TrapId, @@ -9419,8 +9207,8 @@ impl From> for trap::Label { #[derive(Debug)] pub struct PathExpr { pub id: trap::TrapId, - pub attrs: Vec>, pub path: Option>, + pub attrs: Vec>, } impl trap::TrapEntry for PathExpr { @@ -9430,12 +9218,12 @@ impl trap::TrapEntry for PathExpr { fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("path_exprs", vec![id.into()]); + if let Some(v) = self.path { + out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]); + } for (i, v) in self.attrs.into_iter().enumerate() { out.add_tuple("path_expr_attrs", vec![id.into(), i.into(), v.into()]); } - if let Some(v) = self.path { - out.add_tuple("path_expr_paths", vec![id.into(), v.into()]); - } } } @@ -9479,6 +9267,15 @@ impl From> for trap::Label { } } +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathExpr is a subclass of PathAstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme PathExpr is a subclass of PathExprBase @@ -9488,6 +9285,254 @@ impl From> for trap::Label { } } +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathExpr is a subclass of Resolvable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +#[derive(Debug)] +pub struct PathPat { + pub id: trap::TrapId, + pub path: Option>, +} + +impl trap::TrapEntry for PathPat { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("path_pats", vec![id.into()]); + if let Some(v) = self.path { + out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for PathPat { + fn class_name() -> &'static str { "PathPat" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathPat is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathPat is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathPat is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathPat is a subclass of Pat + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathPat is a subclass of PathAstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme PathPat is a subclass of Resolvable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +#[derive(Debug)] +pub struct RecordExpr { + pub id: trap::TrapId, + pub path: Option>, + pub record_expr_field_list: Option>, +} + +impl trap::TrapEntry for RecordExpr { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("record_exprs", vec![id.into()]); + if let Some(v) = self.path { + out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]); + } + if let Some(v) = self.record_expr_field_list { + out.add_tuple("record_expr_record_expr_field_lists", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for RecordExpr { + fn class_name() -> &'static str { "RecordExpr" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of PathAstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordExpr is a subclass of Resolvable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +#[derive(Debug)] +pub struct RecordPat { + pub id: trap::TrapId, + pub path: Option>, + pub record_pat_field_list: Option>, +} + +impl trap::TrapEntry for RecordPat { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("record_pats", vec![id.into()]); + if let Some(v) = self.path { + out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]); + } + if let Some(v) = self.record_pat_field_list { + out.add_tuple("record_pat_record_pat_field_lists", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for RecordPat { + fn class_name() -> &'static str { "RecordPat" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Pat + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of PathAstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme RecordPat is a subclass of Resolvable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct Static { pub id: trap::TrapId, @@ -9901,6 +9946,87 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct TupleStructPat { + pub id: trap::TrapId, + pub path: Option>, + pub fields: Vec>, +} + +impl trap::TrapEntry for TupleStructPat { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("tuple_struct_pats", vec![id.into()]); + if let Some(v) = self.path { + out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]); + } + for (i, v) in self.fields.into_iter().enumerate() { + out.add_tuple("tuple_struct_pat_fields", vec![id.into(), i.into(), v.into()]); + } + } +} + +impl trap::TrapClass for TupleStructPat { + fn class_name() -> &'static str { "TupleStructPat" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Pat + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of PathAstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme TupleStructPat is a subclass of Resolvable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct TypeAlias { pub id: trap::TrapId, diff --git a/rust/extractor/src/translate/base.rs b/rust/extractor/src/translate/base.rs index 396816c6a0c..84f8268d504 100644 --- a/rust/extractor/src/translate/base.rs +++ b/rust/extractor/src/translate/base.rs @@ -1,4 +1,4 @@ -use super::mappings::{AddressableAst, AddressableHir}; +use super::mappings::{AddressableAst, AddressableHir, PathAst}; use crate::generated::MacroCall; use crate::generated::{self}; use crate::rust_analyzer::FileSemanticInformation; @@ -52,8 +52,20 @@ macro_rules! emit_detached { $self.extract_canonical_origin_of_enum_variant(&$node, $label); }; // TODO canonical origin of other items - (Path, $self:ident, $node:ident, $label:ident) => { - $self.extract_canonical_destination(&$node, $label); + (PathExpr, $self:ident, $node:ident, $label:ident) => { + $self.extract_path_canonical_destination(&$node, $label.into()); + }; + (RecordExpr, $self:ident, $node:ident, $label:ident) => { + $self.extract_path_canonical_destination(&$node, $label.into()); + }; + (PathPat, $self:ident, $node:ident, $label:ident) => { + $self.extract_path_canonical_destination(&$node, $label.into()); + }; + (RecordPat, $self:ident, $node:ident, $label:ident) => { + $self.extract_path_canonical_destination(&$node, $label.into()); + }; + (TupleStructPat, $self:ident, $node:ident, $label:ident) => { + $self.extract_path_canonical_destination(&$node, $label.into()); }; (MethodCallExpr, $self:ident, $node:ident, $label:ident) => { $self.extract_method_canonical_destination(&$node, $label); @@ -505,25 +517,22 @@ impl<'a> Translator<'a> { })(); } - pub(crate) fn extract_canonical_destination( + pub(crate) fn extract_path_canonical_destination( &mut self, - item: &ast::Path, - label: Label, + item: &impl PathAst, + label: Label, ) { (|| { + let path = item.path()?; let sema = self.semantics.as_ref()?; - let resolution = sema.resolve_path(item)?; + let resolution = sema.resolve_path(&path)?; let PathResolution::Def(def) = resolution else { return None; }; let origin = self.origin_from_module_def(def)?; let path = self.canonical_path_from_module_def(def)?; - generated::Resolvable::emit_resolved_crate_origin( - label.into(), - origin, - &mut self.trap.writer, - ); - generated::Resolvable::emit_resolved_path(label.into(), path, &mut self.trap.writer); + generated::Resolvable::emit_resolved_crate_origin(label, origin, &mut self.trap.writer); + generated::Resolvable::emit_resolved_path(label, path, &mut self.trap.writer); Some(()) })(); } diff --git a/rust/extractor/src/translate/mappings.rs b/rust/extractor/src/translate/mappings.rs index 885055a6017..6ad8a7d1df6 100644 --- a/rust/extractor/src/translate/mappings.rs +++ b/rust/extractor/src/translate/mappings.rs @@ -170,3 +170,37 @@ impl AddressableAst for ast::Union { impl AddressableAst for ast::Module { type Hir = Module; } + +pub trait PathAst: AstNode { + fn path(&self) -> Option; +} + +impl PathAst for ast::PathExpr { + fn path(&self) -> Option { + self.path() + } +} + +impl PathAst for ast::RecordExpr { + fn path(&self) -> Option { + self.path() + } +} + +impl PathAst for ast::PathPat { + fn path(&self) -> Option { + self.path() + } +} + +impl PathAst for ast::RecordPat { + fn path(&self) -> Option { + self.path() + } +} + +impl PathAst for ast::TupleStructPat { + fn path(&self) -> Option { + self.path() + } +} diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index d623c67cc73..b13b4bc6db9 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -1,4 +1,4 @@ -lib/codeql/rust/controlflow/internal/generated/CfgNodes.qll 63fcdcbe20f3c44ab5c53c5aeb109b179026a743dafb369790eb151b1cb7d3d1 9f43a3279a815153cd529638245e0a2022c6df0a7510f08198eb397bea30c049 +lib/codeql/rust/controlflow/internal/generated/CfgNodes.qll 12a240e8392e4b0ad9ddb8067b25a1b5e4c1151886d9d64292a7a9ff29d11d97 fdbe7ca4f085d04371280299fd10a604ee5a059294d2c4c836f334d2b5f8926d lib/codeql/rust/elements/Abi.qll 4c973d28b6d628f5959d1f1cc793704572fd0acaae9a97dfce82ff9d73f73476 250f68350180af080f904cd34cb2af481c5c688dc93edf7365fd0ae99855e893 lib/codeql/rust/elements/Addressable.qll 13011bfd2e1556694c3d440cc34af8527da4df49ad92b62f2939d3699ff2cea5 ddb25935f7553a1a384b1abe2e4b4fa90ab50b952dadec32fd867afcb054f4be lib/codeql/rust/elements/ArgList.qll 661f5100f5d3ef8351452d9058b663a2a5c720eea8cf11bedd628969741486a2 28e424aac01a90fb58cd6f9f83c7e4cf379eea39e636bc0ba07efc818be71c71 @@ -103,29 +103,30 @@ lib/codeql/rust/elements/ParenExpr.qll b635f0e5d300cd9cf3651cfcefd58316c21727295 lib/codeql/rust/elements/ParenPat.qll 40d033de6c85ad042223e0da80479adebab35494396ab652da85d3497e435c5a 8f2febe5d5cefcb076d201ae9607d403b9cfe8169d2f4b71d13868e0af43dc25 lib/codeql/rust/elements/ParenTypeRepr.qll 8f35ca4ad9077ef1636f011df6875df8840a1937db5adee2ddf6ffff4bcb0766 c9b4bcd429026908a125cc1a772a1005da7754c5257b8c63685befb6dd4d7aa8 lib/codeql/rust/elements/Pat.qll 56211c5cb4709e7c12a2bfd2da5e413a451672d99e23a8386c08ad0b999fd45c b1b1893a13a75c4f0390f7e2a14ee98a46f067cfdc991a8d43adc82497d20aff -lib/codeql/rust/elements/Path.qll 94869df09b929c4a60bae42b7e3a66c007f41078c08b7d9c6defb705b953ce8e eb317f75b89978d41fd3b166c7e3d871da4c04b3e17afbbcd0a5d73881e0d1d9 -lib/codeql/rust/elements/PathExpr.qll b52834ff2c725e7e0a224fec91864f0ac13bb7228e27d0e9f82a49c3fba6646f 8723cbbc9ad5b5ee34d80f68dea0cbb2be8e74df0234fc28e1bc7a72687cf25a +lib/codeql/rust/elements/Path.qll 16264a9c978a3027f623530e386a9ad16541305b252fed5e1bedcfbe1d6475d5 8c21063c7f344ce686342e7c12542fec05004e364681f7a31b65f5ee9263a46d +lib/codeql/rust/elements/PathAstNode.qll c5c8627caaf863089d4d6004e206b2e62bc466db2ed5da9f3f443bf3dc29faf9 01107b1ce17cbee08a764962fb13d3f02edbd10675fa5bd89e089f03075ba443 +lib/codeql/rust/elements/PathExpr.qll 0232228845a2005fc63d6b8aea8b49ff50415e0e90fd18f863ee1d6e44f53c07 47b15cc6ae576d13f14b29ffa4620451accc603ff87071dfe48660dbe018bf36 lib/codeql/rust/elements/PathExprBase.qll bb41092ec690ae926e3233c215dcaf1fd8e161b8a6955151949f492e02dba13a b2257072f8062d31c29c63ee1311b07e0d2eb37075f582cfc76bb542ef773198 -lib/codeql/rust/elements/PathPat.qll 6897e69bcb24b56d39ede796cf5767988dcd5741e02333fa8495dd7c814f771a 2a011fb92f17e4b4ff713e6d29f591054dfede22a9aaa006e67fca2c23ab76bf +lib/codeql/rust/elements/PathPat.qll a7069d1dd77ba66814d6c84e135ed2975d7fcf379624079e6a76dc44b5de832e 2294d524b65ab0d038094b2a00f73feb8ab70c8f49fb4d91e9d390073205631d lib/codeql/rust/elements/PathSegment.qll df95d0b621623f2383634031a49c76949f25550b82cca0f73fb89f39487a9a2b 37addce4537f7864e24f6da0d4c6545a105df598a3f1428c33404aa6dff445c4 lib/codeql/rust/elements/PathTypeRepr.qll 29028e35e93e8d1a3ec2eac7d65347e60364c20f9f6474bc74808bfc0efdd2f8 99058b68f79b01e9889f10ddb2f6e1fb40ad85475e459c7e9629d30f7c014bca lib/codeql/rust/elements/PrefixExpr.qll 107e7bd111b637fd6d76026062d54c2780760b965f172ef119c50dd0714a377d 46954a9404e561c51682395729daac3bda5442113f29839d043e9605d63f7f6d lib/codeql/rust/elements/PtrTypeRepr.qll 2eb2b6f6e5858a10fa1b10d85400ed6db781339bf152162a2fd33213c1ce083b bb99c2da04c80d3c14f47cda1feb9719af801d209becb3d9b20746a2a3b8fc02 lib/codeql/rust/elements/RangeExpr.qll 43785bea08a6a537010db1138e68ae92eed7e481744188dfb3bad119425ff740 5e81cfbdf4617372a73d662a248a0b380c1f40988a5daefb7f00057cae10d3d4 lib/codeql/rust/elements/RangePat.qll b5c0cfc84b8a767d58593fa7102dcf4be3ff8b02ba2f5360c384fa8af4aac830 cc28399dd99630bfa50c54e641a3833abe6643137d010a0a25749d1d70e8c911 -lib/codeql/rust/elements/RecordExpr.qll eb402960c5c6a14d0a0ffebd61a352b59b5d1cc1c2531cacd54754310a812d77 415c93384e63cf38003dde987715554ebf45fc32ba03bc5fd78b8d2501812de1 +lib/codeql/rust/elements/RecordExpr.qll b8541a33ef408f2070103c1db8b6ec845bc6b1d8c810f5d8d208e5eeb9f86b30 a6d9602a64c9acf48f033f06fe7e1d86382512fd378ee3044f1126726847f696 lib/codeql/rust/elements/RecordExprField.qll edac04146849e2aeca27e7bbb896c21aa2e2b15736b1e8a06ac51ab01433b3ac 7c062bd6d5dd5b1d972450fb0b3272cd9b45f94ccd668c3bd4347e2dce3279ed lib/codeql/rust/elements/RecordExprFieldList.qll 672c3854cb84090c8a2e9311c43448016dc2614ecbf86dbe404156304674e38f 01ae0ffca0bf640c61120e36fcf2c560555f4aabbd49ddce6f5c1a3561dbfc31 lib/codeql/rust/elements/RecordField.qll 87d68aa912574596ba09ecb3ab437472635cd76eff49cd5bef00eaabbd264f08 01871ee4dd9bd02acd981fbc109abfa4ee1b303deaa148484476317c4c41c924 lib/codeql/rust/elements/RecordFieldList.qll cebab3fba41221e61cda801070a7f414b62b4fbcf2206e35462c0da35ad75c3f db092d47eea871d61541b9711d7139a99394e0ed83901a8ae60f03dfa8ed722f -lib/codeql/rust/elements/RecordPat.qll a210d700e710107100fedad1098fb789056a0c0b8dbc11de2b242877e692ec20 3efa12d7bfa0da7c09a42b2b43c50ff3985c55676db7f3be2c771765d81f9a10 +lib/codeql/rust/elements/RecordPat.qll 3e31af707f72e9af42142e54b7251da8cbc88a9d5f448a4e6b3ca578f92f5680 0b459d751c26a062608ef0b6f3859e9ed1342e129b004ec218694d011955cfbd lib/codeql/rust/elements/RecordPatField.qll 7487461887e82bcf224b02628dfc64457121ab17e731e2dc7aa7e731ab16c02f f2018e55722245eb4273fb067242aaa503c43f91671a55b3a4bb51fe7bc0a03c lib/codeql/rust/elements/RecordPatFieldList.qll c3198c997f389ce95db377ca40ac69a1448f120093f37ab1c92a5a3f1f6aa0d4 9db36d274f1ec77c442ae7e38f940a65c9a92f1541f66140188b226965851535 lib/codeql/rust/elements/RefExpr.qll 91a0d3a86002289dc01ffbe8daca13e34e92e522fbb508241a9d51faf1d4a9d2 b6e63d8e6f8956d2501706d129a6f5f24b410ea6539839757c76ba950c410582 lib/codeql/rust/elements/RefPat.qll fe076bdccb454111b38f360837d180274ba8a003b4cffe910b5197cd74188089 2604c8bb2b0b47091d5fc4aa276de46fe3561e346bd98f291c3783cef402ba06 lib/codeql/rust/elements/RefTypeRepr.qll ac41d8b4132f273d65873ea3c59631bc1718b3266ae08075346e6cb1bfe2f17c b7e34851d37008806d4519105a5e3405dda07b999294c6656a0c447ac1635b2a lib/codeql/rust/elements/Rename.qll 55fa06145f2160304caac0a5ce4cf6a496e41adfd66f44b3c0a1d23229ed8ce0 80262f0abf61749cdf0d5701637db359960f5404ad1dbfdd90f5048d2e7c315d -lib/codeql/rust/elements/Resolvable.qll 213c0c157541002ddd61cc76cdc11386819aa59dff0a81780474cccb6b7fb211 cdcf807587f887493888341a1b6f9bed202b80b37cacc77041a256b05ff4d3d1 +lib/codeql/rust/elements/Resolvable.qll efeec2b4b14d85334ec745b9a0c5aa6f7b9f86fe3caa45b005dccaee4f5265c4 7efe0063340ba61dd31125bc770773ca23a7067893c0d1e06d149da6e9a9ee92 lib/codeql/rust/elements/RestPat.qll a898a2c396f974a52424efbc8168174416ac6ed30f90d57c81646d2c08455794 db635ead3fa236e45bbd9955c714ff0abb1e57e1ce80d99dc5bb13438475adbf lib/codeql/rust/elements/RetTypeRepr.qll a95a053e861a8d6e5e8eda531f29c611b00904d48ea2bb493138d94d39096ace ebde4f865d310351ba6ee71852428819627ea3909e341d6800ab268b1810c6fa lib/codeql/rust/elements/ReturnExpr.qll b87187cff55bc33c8c18558c9b88617179183d1341b322c1cab35ba07167bbdb 892f3a9df2187e745c869e67f33c228ee42754bc9e4f8f4c1718472eb8f8c80f @@ -147,7 +148,7 @@ lib/codeql/rust/elements/TupleExpr.qll 561486554f0c397bc37c87894c56507771174bfb2 lib/codeql/rust/elements/TupleField.qll 2e78c52e3f5b3cfa59231c864f7d44fbe9c1ec43f8310f9250817bd7a88369b6 71466032bb32a0f6d64c5d8902587c2fa36cdece53799d3e03ece06e384e85f4 lib/codeql/rust/elements/TupleFieldList.qll 73397eef1cf8c18286b8f5bb12fbdc9bb75eee3b7bd64d149892952b79e498a3 13ac90f466ab22e5750af9e44aff9605b9e16f8350b4eaecff6a99e83d154e25 lib/codeql/rust/elements/TuplePat.qll 028cdea43868b0fdd2fc4c31ff25b6bbb40813e8aaccf72186051a280db7632e 38c56187971671e6a9dd0c6ccccb2ee4470aa82852110c6b89884496eb4abc64 -lib/codeql/rust/elements/TupleStructPat.qll 16a3f10992db62cc6630dc962a2a0d243c41b8aca064d6cb6c82a2f4e6987a12 c2b4c14567ee2dd65e0b643c9d18dfe5098fb3bd4ed45dcc825065bfa7c7c02d +lib/codeql/rust/elements/TupleStructPat.qll da398a23eb616bf7dd586b2a87f4ab00f28623418f081cd7b1cc3de497ef1819 6573bf3f8501c30af3aeb23d96db9f5bea7ab73e2b7ef3473095c03e96c20a5c lib/codeql/rust/elements/TupleTypeRepr.qll 819b600abfb2d6110e3f9c09a3901c875530acf372c65e3d9071aed8ab302cbb 508e8e527248b42ba3f20d3ff5163c348c9d338b12ff7d244246fc711e9d240c lib/codeql/rust/elements/TypeAlias.qll 2974953465e096fee61c70199a5672174254494786bc762c32c84df97422f08b 55e634e3dfa6ea3980ab37a524ea60c6adc207114a313c0c2a3632f7b5583dab lib/codeql/rust/elements/TypeArg.qll 88b5d150dbb207079bf40019b60eb6f5389247aa3040474729019d2be48e92a6 6a507290152be04b1d2c4e2c04214cfc87c583ed0611bd75655aff59eb8ce952 @@ -307,6 +308,7 @@ lib/codeql/rust/elements/internal/ParenExprConstructor.qll 104b67dc3fd53ab52e2a4 lib/codeql/rust/elements/internal/ParenPatConstructor.qll 9aea3c3b677755177d85c63e20234c234f530a16db20ab699de05ca3f1b59787 29f24aed0d880629a53b30550467ade09a0a778dbf88891769c1e11b0b239f98 lib/codeql/rust/elements/internal/ParenTypeReprConstructor.qll b3825399f90c8546c254df1f3285fe6053b8137e4705978de50017be941c9f42 696fa20ce5bd4731566b88c8ea13df836627354d37cc9d39514d89d8fb730200 lib/codeql/rust/elements/internal/PatImpl.qll 37c9b1da7aa625117644e2cd74ec0b174f69a38cf66926add01786a05d5ad2ad 143685a0b4873fa0b73b204285dca956e59b32d527bfac6cc336326d244994b7 +lib/codeql/rust/elements/internal/PathAstNodeImpl.qll 5a38c42a9127fc2071a9e8f0914996d8c3763e2708805de922e42771de50f649 ebe319cce565497071118cd4c291668bbcdf5fc8942c07efc5a10181b4ce5880 lib/codeql/rust/elements/internal/PathConstructor.qll 5c6354c28faf9f28f3efee8e19bdb82773adcf4b0c1a38788b06af25bcb6bc4a 3e2aeef7b6b9cda7f7f45a6c8119c98803aa644cf6a492cf0fce318eba40fe8f lib/codeql/rust/elements/internal/PathExprBaseImpl.qll e8b09447ee41b4123f7d94c6b366b2602d8022c9644f1088c670c7794307ab2e 96b9b328771aaf19ba18d0591e85fcc915c0f930b2479b433de3bfdd2ea25249 lib/codeql/rust/elements/internal/PathExprConstructor.qll cf6e0a338a8ed2d1042bdee4c2c49be5827e8c572d8c56e828db265d39e59ae3 36a3d1b7c5cc2cf527616be787b32071b9e2a6613a4f6b3f82e2a3b0e02a516f @@ -521,12 +523,13 @@ 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 ed0af2cad8ec4d612e3c03d99548444298ae975516f2c3e909026fe5d31ab467 57801012cbe803516a093bbc0c5dcf839cb43df97a87fd2028ad2be400882c50 +lib/codeql/rust/elements/internal/generated/ParentChild.qll 876e28befd6a93666832de01342c6df403efb5cbea36d3c4b5d5cc2f34c54d6c 3448847608c25b100328bd68f70730a7e43b7d8b5ef8ab1ce40ae3f5a57c6bd2 lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 -lib/codeql/rust/elements/internal/generated/Path.qll 4c1c8e840ed57880e574142b081b11d7a7428a009f10e3aa8f4645e211f6b2e0 989668cf0f1bdee7557e2f97c01e41d2a56848227fed41477833f5fc1e1d35f6 -lib/codeql/rust/elements/internal/generated/PathExpr.qll 4ff4b2ab77bce1dbfddb315e7d1ff13d6fcd6bb7c30c105402f8082d05f1d337 fbc4f4e05da75ab543af33cfb620cfe09239e2574b8312f2c5bedca8a65ea6e8 +lib/codeql/rust/elements/internal/generated/Path.qll bf6a86e7fcb7164624cc070dcce86d2bda50a2516b95115b87d0ebb5596e50a1 fd7a9ad4034cdebe8dfe495619c46f464630d38195313072e0bd904061b0fb00 +lib/codeql/rust/elements/internal/generated/PathAstNode.qll e6d4d5bffd3c623baaaee46bc183eb31ce88795535f164f6a9b9b4d98bbd6101 168db515404933479ba6b150c72e012d28592cbc32366aefcb1bf9599dbcd183 +lib/codeql/rust/elements/internal/generated/PathExpr.qll 34ebad4d062ce8b7e517f2ab09d52745fb8455203f4a936df7284ad296638387 ba66781cdbdeb89c27a4bfb2be0f27f85fb34978d699b4e343446fb0d7ad2aa6 lib/codeql/rust/elements/internal/generated/PathExprBase.qll d8218e201b8557fa6d9ca2c30b764e5ad9a04a2e4fb695cc7219bbd7636a6ac2 4ef178426d7095a156f4f8c459b4d16f63abc64336cb50a6cf883a5f7ee09113 -lib/codeql/rust/elements/internal/generated/PathPat.qll 4ef7e7e81257956f9ac947dad8801fb4e0daf039b495ab5ae54c72d51416732c ca0e6e58153d3aa319d5a01858bc5518a0eda2a20adeba9430bd0b91b2bc9c37 +lib/codeql/rust/elements/internal/generated/PathPat.qll 003d10a4d18681da67c7b20fcb16b15047cf9cc4b1723e7674ef74e40589cc5a 955e66f6d317ca5562ad1b5b13e1cd230c29e2538b8e86f072795b0fdd8a1c66 lib/codeql/rust/elements/internal/generated/PathSegment.qll f6892724c0b516f7e04eee3878c8060c5a4c54fe2a3a3836470c86df5fddb28c bdb6b89cf037e09b395729b25117dabc86ebc8b967e39856b5e2a1f3810bb86c lib/codeql/rust/elements/internal/generated/PathTypeRepr.qll b847fabe7059485c5194cbc144f38dae2433057771ff10fe0b6ae9876b33afd4 ee2fdcd86d78c389a2276ebe7e889f042b7bb39c3c611f56b951591600a60e8a lib/codeql/rust/elements/internal/generated/PrefixExpr.qll c9ede5f2deb7b41bc8240969e8554f645057018fe96e7e9ad9c2924c8b14722b 5ae2e3c3dc8fa73e7026ef6534185afa6b0b5051804435d8b741dd3640c864e1 @@ -534,20 +537,20 @@ 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 e2dc96e3d33779e31424809f1048d2f1010280af20dd6f89e3939512009ba3a7 925887ef2978a0b8351ff0046ae0bc410c5c4b7764a4aa4aa2b75f6ba3098710 -lib/codeql/rust/elements/internal/generated/RecordExpr.qll eb6cb662e463f9260efae1a6ce874fa781172063b916ef1963f861e9942d308d 1a21cbccc8f3799ff13281e822818ebfb21d81591720a427cac3625512cb9d40 +lib/codeql/rust/elements/internal/generated/Raw.qll b295dd46979a2d4df840e1bef4ba12e3b4ff58aa886c8a1320281739d36c5a4f 2369cba6d70f0e853acb0e018dfb47e604ee01dca48af7094b484a7e18a46365 +lib/codeql/rust/elements/internal/generated/RecordExpr.qll 2131b2cb336caa76170082e69776011bf02576bbfdd34ba68ca84af24209250a 39a2e3ec32352b594c43cc1295e0e8b3f9808173322d3d73cb7d48ef969d5565 lib/codeql/rust/elements/internal/generated/RecordExprField.qll 7e9f8663d3b74ebbc9603b10c9912f082febba6bd73d344b100bbd3edf837802 fbe6b578e7fd5d5a6f21bbb8c388957ab7210a6a249ec71510a50fb35b319ea1 lib/codeql/rust/elements/internal/generated/RecordExprFieldList.qll 179a97211fe7aa6265085d4d54115cdbc0e1cd7c9b2135591e8f36d6432f13d3 dd44bbbc1e83a1ed3a587afb729d7debf7aeb7b63245de181726af13090e50c0 lib/codeql/rust/elements/internal/generated/RecordField.qll 6d4b184c85419f9282937ebd1b1d14930a263e8754124f2323953991ca0f0e59 2f8bec227f960ae98fc320a65efdfdc5dc04455cd59697e2621585e5a5f942b8 lib/codeql/rust/elements/internal/generated/RecordFieldList.qll d7bb2677338cf420b0d6371aeec781aacc2272c73413ea96b7418177ad149fb9 5ef52074b9f4ec31e7422b70efdb2e650d673b2625efdfec18a4e48c30e35cf6 -lib/codeql/rust/elements/internal/generated/RecordPat.qll 6a440e2c31ff8ccccc9cc03e3464e3916db637559c43cbbf7915ced5d31ceb5b eb46cf20cfe8d612d2222bea8535922a458ebe1f9e10db1a5afd6954a420a1f6 +lib/codeql/rust/elements/internal/generated/RecordPat.qll f2ce392fb7e481a139ea527ad32d1c7ba65404a05efc56f5c68ce1e8e1e0a928 9710048cd1e6b26b3054ac95778e47f16cff6424bab9ef0c099c1109ef14741f lib/codeql/rust/elements/internal/generated/RecordPatField.qll 5bf624d22903fb874e6d03541cf453493badd382b6910ce950ad0d34dd580e9a b9ec89b69a58b9c418405efa9b0e6ee7b07616f5696a0858583a339d657b5855 lib/codeql/rust/elements/internal/generated/RecordPatFieldList.qll a6db0cdcc3da667c52862ed940597d899383ccf2bda9bb3f62b8ce9f48119307 99fe972c80db8f28e2a6f56cf2a11c98183244229da117320cc86c7ade62bd0b 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 lib/codeql/rust/elements/internal/generated/Rename.qll d23f999dab4863f9412e142756f956d79867a3579bd077c56993bdde0a5ac2f1 9256c487d3614bf3d22faa294314f490cf312ab526b8de0882e3a4a371434931 -lib/codeql/rust/elements/internal/generated/Resolvable.qll c038fa24b121ee3e7f6060bce639e7483ea1a14bb552e459b6c67663732dfd6c 4025f2ef318793913e6cfc5d8984e538f402bc062865dcb5496563bec64a2ea9 +lib/codeql/rust/elements/internal/generated/Resolvable.qll 586eefb01794220679c3b5d69c059d50c2238cf78ab33efe7185bbd07dea8dbd 1b7c7297d541b9de9e881d18fed4ae40dd327396366a3a6f52a24b85685fa9c1 lib/codeql/rust/elements/internal/generated/RestPat.qll 234bbaa8aa37962c9138baf5b1f4406c3d78f4131b4b8dbb30fc1343d15873d5 653ee6bea4d3cf9454b2834bc4233a8f275295f19635c37a0bca69a587e1eb20 lib/codeql/rust/elements/internal/generated/RetTypeRepr.qll 173fd722308161f9405f929a13718134f8eaefe9fce1686048860b7c8f4c29f7 30bbaada842369dac5618ae573999f59979597c6a3315c6cce04e5bed0b38c87 lib/codeql/rust/elements/internal/generated/ReturnExpr.qll c9c05400d326cd8e0da11c3bfa524daa08b2579ecaee80e468076e5dd7911d56 e7694926727220f46a7617b6ca336767450e359c6fa3782e82b1e21d85d37268 @@ -560,7 +563,7 @@ lib/codeql/rust/elements/internal/generated/Static.qll ea22838e0b7d9796dfaf5deda lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b lib/codeql/rust/elements/internal/generated/StmtList.qll a667193e32341e17400867c6e359878c4e645ef9f5f4d97676afc0283a33a026 a320ed678ee359302e2fc1b70a9476705cd616fcfa44a499d32f0c7715627f73 lib/codeql/rust/elements/internal/generated/Struct.qll 4d57f0db12dc7ad3e31e750a24172ef1505406b4dab16386af0674bd18bf8f4b 1a73c83df926b996f629316f74c61ea775be04532ab61b56af904223354f033e -lib/codeql/rust/elements/internal/generated/Synth.qll 839aa6b03b461ed9c79192d905969c63c99e7a12074e3487e74d2163d20ee499 44b8caba3186aaeb6d6b5759610627f8bc791e62001acfd1a66324086c17536f +lib/codeql/rust/elements/internal/generated/Synth.qll b6d4e3f5fa38d7eca94495447b591fa9ed44cb5fcb4982077d54c8227d898401 a145534947c98e6dba0ba6d92d46f3eef34d01ce8b60d4b699db8bacc63c3c5b lib/codeql/rust/elements/internal/generated/SynthConstructors.qll 3ceb5f6ee40b94955ce5f47feb454cc9129941aad3cdbe6e337bbe41e76a8a23 3ceb5f6ee40b94955ce5f47feb454cc9129941aad3cdbe6e337bbe41e76a8a23 lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b lib/codeql/rust/elements/internal/generated/TokenTree.qll 8577c2b097c1be2f0f7daa5acfcf146f78674a424d99563e08a84dd3e6d91b46 d2f30764e84dbfc0a6a5d3d8a5f935cd432413688cb32da9c94e420fbc10665c @@ -571,7 +574,7 @@ lib/codeql/rust/elements/internal/generated/TupleExpr.qll 75186da7c077287b9a86fc lib/codeql/rust/elements/internal/generated/TupleField.qll b092db3eb240c9e15bcc27aa64bee80b48dced34398e7220d41bcd1a6676b1f7 4e152fb623e4cc8da57733c7c85c11dcb082fe395b337f92cc8b55da1af4c682 lib/codeql/rust/elements/internal/generated/TupleFieldList.qll 9d4981d04c2ee005e41035b9699f03bff270c4e0515af5482d02e614a0b1a875 4e60b857fbcb668fa1a001e0eff03f1aa3a7465d32ce68e23544b705fa54fc5d lib/codeql/rust/elements/internal/generated/TuplePat.qll 4e13b509e1c9dd1581a9dc50d38e0a6e36abc1254ea9c732b5b3e6503335afeb 298028df9eb84e106e625ed09d6b20038ad47bfc2faf634a0ffea50b17b5805d -lib/codeql/rust/elements/internal/generated/TupleStructPat.qll 646847d866d6b999b084837f2569035c471c777fc4b1f483ce70d5d3fc5dc5ea 2cd1a4020876485635ae28e3d81eca0e596d77123d8ed40a2b18043adc6c69e7 +lib/codeql/rust/elements/internal/generated/TupleStructPat.qll 6539d0edbdc16e7df849514d51980d4cd1a2c9cbb58ca9e5273851f96df4eb36 45a13bae5220d5737cbd04713a17af5b33d8bb4cfdf17ddd64b298ab0c1eea24 lib/codeql/rust/elements/internal/generated/TupleTypeRepr.qll dc494a783c495c96f2498230d160b59117cfa96d927861cd9d76676fefac8fb2 47da01697f143d4077978594b0c2f4c4bc5e92823dfcaad3ce8ab91725a536a3 lib/codeql/rust/elements/internal/generated/TypeAlias.qll 56162d01356f018a3acf20b79dcc49a939ebf4f422939fae6a20b91cbbda8564 903b61117f4caa362a350a9cbec701aa59eb2052aff848999ebfaaf574e02352 lib/codeql/rust/elements/internal/generated/TypeArg.qll e76ea103f7e9ead3be2c34718270d6893ca1980ee31e32ec19a92381e0040d73 9f2ea2d9434d57d7e3223e5d9d7662047e38bda26112751e122e2c1d03549eb5 @@ -595,7 +598,7 @@ lib/codeql/rust/elements/internal/generated/WhileExpr.qll 7edf1f23fbf953a2baabcd lib/codeql/rust/elements/internal/generated/WildcardPat.qll d74b70b57a0a66bfae017a329352a5b27a6b9e73dd5521d627f680e810c6c59e 4b913b548ba27ff3c82fcd32cf996ff329cb57d176d3bebd0fcef394486ea499 lib/codeql/rust/elements/internal/generated/YeetExpr.qll cac328200872a35337b4bcb15c851afb4743f82c080f9738d295571eb01d7392 94af734eea08129b587fed849b643e7572800e8330c0b57d727d41abda47930b lib/codeql/rust/elements/internal/generated/YieldExpr.qll 37e5f0c1e373a22bbc53d8b7f2c0e1f476e5be5080b8437c5e964f4e83fad79a 4a9a68643401637bf48e5c2b2f74a6bf0ddcb4ff76f6bffb61d436b685621e85 -lib/codeql/rust/elements.qll a055d1f5bf70c9f8f6d5e34087146e813f3452b225b07b64f087d6e61f52a3b3 a055d1f5bf70c9f8f6d5e34087146e813f3452b225b07b64f087d6e61f52a3b3 +lib/codeql/rust/elements.qll 2b46fa94e6775759fb730da818e0bf66e0f434c7e3d49f0e1989a5e5e6e48fd2 2b46fa94e6775759fb730da818e0bf66e0f434c7e3d49f0e1989a5e5e6e48fd2 test/extractor-tests/generated/Abi/Abi.ql 7f6e7dc4af86eca3ebdc79b10373988cd0871bd78b51997d3cffd969105e5fdd 2f936b6ca005c6157c755121584410c03e4a3949c23bee302fbe05ee10ce118f test/extractor-tests/generated/Abi/Abi_getAbiString.ql a496762fcec5a0887b87023bbf93e9b650f02e20113e25c44d6e4281ae8f5335 14109c7ce11ba25e3cd6e7f1b3fcb4cb00622f2a4eac91bfe43145c5f366bc52 test/extractor-tests/generated/ArgList/ArgList.ql e412927756e72165d0e7c5c9bd3fca89d08197bbf760db8fb7683c64bb2229bc 043dba8506946fbb87753e22c387987d7eded6ddb963aa067f9e60ef9024d684 @@ -907,12 +910,16 @@ test/extractor-tests/generated/ParenPat/ParenPat.ql 565182ccd81a9b420911b488c083 test/extractor-tests/generated/ParenPat/ParenPat_getPat.ql 96f3db0ec4e71fd8706192a16729203448ccc7b0a12ba0abeb0c20757b64fba1 0c66ba801869dc6d48dc0b2bca146757b868e8a88ad9429ba340837750f3a902 test/extractor-tests/generated/ParenTypeRepr/ParenTypeRepr.ql a96bb8b51d8c0c466afc1c076834fa16edf7e67fffe2f641799850dee43099a2 0e6c375e621b7a7756d39e8edd78b671e53d1aac757ac54a26747fe5259c5394 test/extractor-tests/generated/ParenTypeRepr/ParenTypeRepr_getTypeRepr.ql 64fe4ea708bc489ba64ed845f63cfbcd57c1179c57d95be309db37eac2f5eb71 0f4cbbfdf39d89830b5249cabf26d834fc2310b8a9579c19383c90cb4333afb7 -test/extractor-tests/generated/Path/Path.ql f17c1c4d23c0d5e9776cee84444f6ee7445de88afbc1f26c34b96e13ab618158 89499cb0f63b3634d6b5e2b8c4a13bd4401ce82e54af0ab46e41a34b0288eeb9 -test/extractor-tests/generated/Path/PathExpr.ql b9696cd7ad9f3874e4bc4b1b9c77f42f06ab6c61b77fb641458da63667087b9b db84a7a8dd05e30ff80733af01f08d43ff031bb4b3e3af06332a73ba7e7bbc43 +test/extractor-tests/generated/Path/Path.ql 2bdcd99b3b5ffc83ac47d8cc27a4561d616bcf06844f0c452c699cd10ee640ca 5a7d7ffb8b0c04d6a8cbb2a953761df8561b796c4372bef1bd55c359b2f19911 +test/extractor-tests/generated/Path/PathExpr.ql 5039fe730998a561f51813a0716e18c7c1d36b6da89936e4cfbdb4ef0e895560 cd3ddf8ab93cd573381807f59cded7fb3206f1dbdff582490be6f23bed2d6f29 test/extractor-tests/generated/Path/PathExpr_getAttr.ql 2ccac48cd91d86670c1d2742de20344135d424e6f0e3dafcc059555046f92d92 9b7b5f5f9e3674fad9b3a5bcd3cabc0dff32a95640da0fce6f4d0eb931f1757d test/extractor-tests/generated/Path/PathExpr_getPath.ql e7894071313a74166bdd31d7cd974037fcd5a7f0e92d5eec42833266196eb858 46a06e8a1207e7a0fa175cd4b61068e5fd6c43b5575b88986409f0ac2be64c51 -test/extractor-tests/generated/Path/PathPat.ql 823732954a5882e33a37bd0bf0cafb2cec51659a5203a4831eec2516da0e49fa 54001149718a9ca15d8c0d4be63f3fe00a9f0d44fa1309e2f605d7932355ea5d +test/extractor-tests/generated/Path/PathExpr_getResolvedCrateOrigin.ql a68a1f0d865d10c955f7ab1fd7614b517e660553b65fabb9daa8f302adbc2602 c47480d6440ae63be27d8158a35536a8d9051817dec1521cdcab297ddb52e1ae +test/extractor-tests/generated/Path/PathExpr_getResolvedPath.ql dfa55fe480da0df37670660fc1c54b6c38d47365353bc9d4f662183b33d4e80f 1b18329a7b60805fc073df3149c48f39aa66924d7eefedecbca36a2b170a7fbe +test/extractor-tests/generated/Path/PathPat.ql 6b9d973009f1b4963c7c83b0f5051eda7a76c8fb4a789217b4a25cbab0cdb274 57f0621dd3657b6f4630d5406816effcc6bc1b03361aa12e118e807e28e9e71b test/extractor-tests/generated/Path/PathPat_getPath.ql 6c0c71c80a6e631ea7775ec8660b470ff6b264bab14a399606cf113b1fb190fc 8e34cbb4d064db929e94652e1901ec4f26affa71e30e556b7acdff71dd622cbb +test/extractor-tests/generated/Path/PathPat_getResolvedCrateOrigin.ql f690fd9a8773e7c73b70f2d64ee919fef8eee243c5a315c4a6d2713d43ea0e43 f37817427c36cec14a2e07f99d3a32f37f3f27a8eafdf170749ec2780054729b +test/extractor-tests/generated/Path/PathPat_getResolvedPath.ql 55df4541a7b0e82198acfcedd7dc99eb564908270e4fb2b032bf05e40fba6fef a5932d884903da901263f88644c8585a45045190d7204f630506c5aece798288 test/extractor-tests/generated/Path/PathSegment.ql be9d62d38b0c7f8b5a8ea86dcb18c62f24930f5931f52e6073414f291d8c0451 31288b7728d45715acf6ab751b833b29473a74d54d9b26f83a73d8c91e3c82da test/extractor-tests/generated/Path/PathSegment_getGenericArgList.ql 8f6e67b3e316309f20e21d7e7944accf66b0256b76fa50ee9a714044c6ec8cea 15f10a701fc4d3f9fd6734da90790cdbc8a1ddd57bf52695740acedcb2e6e485 test/extractor-tests/generated/Path/PathSegment_getNameRef.ql 799d284e2f9267d6bbe67aa7035e525ef347dc74cb3e2180e7b2171b5cb49674 592130bc2358989536abf62e8a261272c851483ede4f19783f7d61ffc1803e4b @@ -925,8 +932,6 @@ test/extractor-tests/generated/Path/PathTypeRepr.ql c2e069acc5111088a7287d98b4bd test/extractor-tests/generated/Path/PathTypeRepr_getPath.ql 49e96ea2aa482e3b80cb0e2d944055f8298f7fc55b36cea7468586c94bacf686 29b3c2140ac1bc6e0e6160140e292e2b84e13145c1553480e2a582cd7f7bd3fd test/extractor-tests/generated/Path/Path_getPart.ql 8aa45a0b58203ef1177166efbe1c2851faf4b4c9a453c83137f0c9298badcdbf b82d490d9b3a8237487cd5da8b3b6fc4aa477977b332a5c6539b3cd4e6d5b45b test/extractor-tests/generated/Path/Path_getQualifier.ql 9af95e22cdf3a65da6a41d93136aef4523db5ce81d38f6ed4bc613f1c68784d0 3102d9241a417a92c97a53ac56a7a8683463f1adc7a593cda1382c0d25b3f261 -test/extractor-tests/generated/Path/Path_getResolvedCrateOrigin.ql 7c0ff524595514630de4178028260d4832bfc4f57bfddec9f8e72a6c6dbf241c 55e617380476c183ef9259199d2cfd551b07466e94bc452c4723754d0c82691b -test/extractor-tests/generated/Path/Path_getResolvedPath.ql 20c8977781dfe687d5db03290612179cf1360eb47b86ea62d25d1eef62a681e7 c35b76e7d63c05dc80867285bb913042cbe90b45d4d4306df9eac2cba5e8db70 test/extractor-tests/generated/PrefixExpr/PrefixExpr.ql 44fb7174365c6deecdc22c720d84617c6e060c05d49c41c90433451588f8aa6f 871fab471c82fede3c36edc003f9decee5bb7844c016951d28be78d0c91487e5 test/extractor-tests/generated/PrefixExpr/PrefixExpr_getAttr.ql fdad6ad5199435ded1e4a9ea6b246e76b904cd73a36aaa4780e84eef91741c5b 75d63940046e62c1efa1151b0cac45b5ec0bab5e39aec2e11d43f6c385e37984 test/extractor-tests/generated/PrefixExpr/PrefixExpr_getExpr.ql 2d1d97f6277794871fbb032ea87ac30b1aa902a74cd874720156162057ea202e b1b9880fce07d66df7ec87f12189c37adf9f233a1d0b38a1b09808d052a95642 @@ -942,9 +947,11 @@ test/extractor-tests/generated/RangePat/RangePat.ql 97314b9a5543a7471d722ae188a6 test/extractor-tests/generated/RangePat/RangePat_getEnd.ql 723eb5030ec52d3aa3650a3e2de6cc0195a0030630239b972235963320e0d808 2df3b1a6197c3abd43dc743fd09cbf55165e3191f2b49336777594541e5da96a test/extractor-tests/generated/RangePat/RangePat_getOperatorName.ql 564216b2342f56dc8c1aed6306f57b6dafb33de9e3ba337a840a8c077ce95933 2a76ec7a59bada29733a1515bc1ea8bedd37429d1694ca63c7a8fbf94098a4c7 test/extractor-tests/generated/RangePat/RangePat_getStart.ql ad2066efa32fced2dd107031f2a9b9635c3c892e874870a4320522bae9309aa4 b4a8c57a838074e186b823938d1a9372153c193da6c839b5f242ca25c679e83f -test/extractor-tests/generated/RecordExpr/RecordExpr.ql 1b8f5c315f8038e531bd92c5402acdafdbc9468e2f4474cbeffddca37cc87fb6 9458b2815fd13848659bdc2ce1e9566fccdb0b2c9f018c79885ba7608df07a5a +test/extractor-tests/generated/RecordExpr/RecordExpr.ql 220f7f766587dc9df1c6f81a1cda3d19d7d5e92a31c63752061297e1adf96bf0 792bbe4503adcb63f7ac0f11259bb60a8ce05538ba1676f141989a73ff4eb5c0 test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.ql 2eb8f7591f08199d124732d7f2d7dd3e81792a52f8e6c90003aa0609923f8cb0 27e245224d6c9aa20023b418ce8dffff1293b50a0e10938932631fca7c559e78 test/extractor-tests/generated/RecordExpr/RecordExpr_getRecordExprFieldList.ql 6d3d872eb64ff8cd7317190f9b2627d3fa6a74976e362cfb49e21c6623d63f82 d98b07f932ecb25a427e655017de47f951d3eabc4eedbc6f873571ce8921e9ff +test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedCrateOrigin.ql 87d463c7950407c86783b9ccbcf6daa4f62f5fcb75bc20f1879bde9240281d4d 5659b4fb8b25cd998211aa3edb11188b3c487cabaf7a09989ce6fe0e4f67ba25 +test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedPath.ql 0de885c7efdd257ee44d2c8a2ad91e419d604517471966059ddae321e80597b6 7977fb7a8c954733dbb5cf8378d6103688d16bc4c9b891c68098d0ec224429b4 test/extractor-tests/generated/RecordExprField/RecordExprField.ql 62ee00e478fcf07421b5989943a487ecc0c99cf50ec87f05aabe89dfb03f2a32 ad7c6ce362032e18fc9950b885c4b7b5c907e6abd2af2d13ecef84eb980027fb test/extractor-tests/generated/RecordExprField/RecordExprField_getAttr.ql 789d20f8c0bb0e9567d3d9a0c0266a04841cda0dbdbe10af8c450d5a82bb289e 9036f5b0e7ddf301012f52f3919804382421061366d2a4f3a016e9783befec6d test/extractor-tests/generated/RecordExprField/RecordExprField_getExpr.ql 7dcb5cf0d04bcd62b655fa0626535526cdaa0f891845f4b22cb50fcf1ae3e511 a177db76e4e9583438fad9bfb1300fed9e812c1046c44dccd307bf3a46603a69 @@ -960,9 +967,11 @@ test/extractor-tests/generated/RecordField/RecordField_getTypeRepr.ql f61cfcd0c6 test/extractor-tests/generated/RecordField/RecordField_getVisibility.ql cc45e9bb9418d15cef07a1827358c3f18a8737324c8e6852591a2da70df89360 45557497fc165a212fffda71dedabc8159a4f72323430df732698a18922b366c test/extractor-tests/generated/RecordFieldList/RecordFieldList.ql 586bccfa550243177d9fdfd6900a473f51a76ed360b537f19cb300330d5dad5b a063373dfdbf06b68c69694ea4ae72a26b906c910f9095894c09e72f8fb52819 test/extractor-tests/generated/RecordFieldList/RecordFieldList_getField.ql 2eb92ef8528204f3f105c19a36cdc06b3b6d20242463ff2ed1fb81c544812a71 d69091899e7157099f117e14fe60cd3705cfda45f28f6a6a2b7234a4a9c1e664 -test/extractor-tests/generated/RecordPat/RecordPat.ql 01510828e1facc6551e06241e41636259883a546ad43b08499468c14d6052768 fcf3873fe1cd1ebe4910150763aa350f882ca8e84603f35520bb0beeea2c21af +test/extractor-tests/generated/RecordPat/RecordPat.ql 24469c2a0902196d49249a37a0b56bf9fe62d1e7af3150813200b25ccb46dfaa 479e58d4fe6db7048e0649fd5a9c1b8ca1ceb8aa52a80dd07a999a07e32b0a3f test/extractor-tests/generated/RecordPat/RecordPat_getPath.ql 187b8d44de158fc809257e28b2e8fdd246c8eb3c60115d54cd53396a320e372d 74813fd13c6f34927420ed44620743f7c80c537984e0db72c1c5f4b754b40b83 test/extractor-tests/generated/RecordPat/RecordPat_getRecordPatFieldList.ql 32e45a6f59cdb8edbf7f9326164e225a7f545fabd2dd168b660699954a999fdf 325c9121dc130459426b473691876a0698b51d5cdf4530698a398510ce8e3051 +test/extractor-tests/generated/RecordPat/RecordPat_getResolvedCrateOrigin.ql 61a47db765e0c45797d3f92318fb6dbf07dfe1a2e63704294c58d49cb0894676 86a636746458053278a8ba0be062a9b1cfcad4866e065a8317fa8f033518ecae +test/extractor-tests/generated/RecordPat/RecordPat_getResolvedPath.ql 0221208e93c4a26e555dd848238b4f5bcabf2ccf3fc38ceb2eef45c39d67b21a 37d80014a21a19e9132ad645a17234e33bb20f2352b450277b8fa919a54b95e9 test/extractor-tests/generated/RecordPatField/RecordPatField.ql 6c51343258e56673d21b7ae73e7de011319ffa2eb65390e697f875bb428d25d1 82c3232db0cb353140618749b1cba5549b0ff43cbbaafb203077e18dbedb2c10 test/extractor-tests/generated/RecordPatField/RecordPatField_getAttr.ql fb0592f7a1be4fd9c6f36c79dee5a0f6711b0a7820b079f8e95413722ae1aeb7 9dfb0de00ec9c4a23efd38515c63a3567204f2a3ac2634858296f58aa564d170 test/extractor-tests/generated/RecordPatField/RecordPatField_getNameRef.ql 3380a41d6cecd80681fc955719fa11377c32a5e0be276871f2d0d75ae62d8f0a 44efe89657d3a59fb94962d0fbf52d06571e203863a3d9e9dd47a5135a8ba4d9 @@ -1058,9 +1067,11 @@ test/extractor-tests/generated/TupleFieldList/TupleFieldList.ql 7dc88440222ff036 test/extractor-tests/generated/TupleFieldList/TupleFieldList_getField.ql ad552a9c0b9964d1770f14cabbb436db60ebedc3c569006542a8eae9ddb30f6d 3a8c49d629376a9b8326138836b05ee2366b1021ffd19f5be74ab023e70aa50d test/extractor-tests/generated/TuplePat/TuplePat.ql 24ee56bc848537da65eb8ecef71e84cc351a2aedcc31d6fb53a5b7865f15f7c2 81db1076e2e4921ceb50933b96cd7b574caab1818de257c1e9038f3f97447d59 test/extractor-tests/generated/TuplePat/TuplePat_getField.ql f000bed41af031bc56d0705ce312abe7ab3dc6745b2936798c9938781e51475e f464a84dbc36aa371d60d6db68d6251f6b275dc4ecebdc56f195637be390b067 -test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql 6e6cfba0d2565782088af55ca977ada3d8093200aa180a49a67c9a176c52c254 c10c93823a9d814d694ca88fdf65a9bf8c1bb178e50c08982a97aa8d445284b3 +test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql 967409c7bddd7fc8d0b9fdfab2f5e6c82e8b4ff57020822aa0cda177244dfbc5 eaf0b7e56c38db60fafb39f8de75b67ee1099ac540fa92b5dfe84b601d31781a test/extractor-tests/generated/TupleStructPat/TupleStructPat_getField.ql f3f2e23cc2a32aa5abc1e0fda1300dab1693230632b9eaa75bb3b1e82ee9ea1a 24b87a39ec639a26ff8c1d04dc3429b72266b2a3b1650a06a7cd4387b6f0e615 test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.ql 13a06696bbf1fa8d5b73107e28cdba40e93da04b27f9c54381b78a52368d2ad1 5558c35ea9bb371ad90a5b374d7530dd1936f83e6ba656ebfbfd5bd63598e088 +test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedCrateOrigin.ql e409667233331a038e482de4b2669d9fac9d7eb0e3bd5580ea19828f0c4ed7ad 588e4628471f1004575900d7365490efcf9168b555ff26becfc3f27b9e657de3 +test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedPath.ql 150898b6e55cc74b9ddb947f136b5a7f538ee5598928c5724d80e3ddf93ae499 66e0bd7b32df8f5bbe229cc02be6a07cb9ec0fe8b444dad3f5b32282a90551ee test/extractor-tests/generated/TupleTypeRepr/TupleTypeRepr.ql 2f99917a95a85a932f423cba5a619a51cada8e704b93c54b0a8cb5d7a1129fa1 759bd02347c898139ac7dabe207988eea125be24d3e4c2282b791ec810c16ea7 test/extractor-tests/generated/TupleTypeRepr/TupleTypeRepr_getField.ql 615acfcbc475b5c2ffa8e46d023fc2e19d29ee879b4949644a7f0b25c33125e6 81b037af5dcb8a0489a7a81a0ad668ca781b71d4406c123c4f1c4f558722f13e test/extractor-tests/generated/TypeAlias/TypeAlias.ql 637d4c982691942fabcc99ef4a1765ec794d1271bdd376addb55c9d7ea31230e ef81773e2f1260f66f23ce537080c3273b1cf74f96fba37403d34dc1ee1e0458 diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index 86e56bcdae8..40a1492be4d 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -106,6 +106,7 @@ /lib/codeql/rust/elements/ParenTypeRepr.qll linguist-generated /lib/codeql/rust/elements/Pat.qll linguist-generated /lib/codeql/rust/elements/Path.qll linguist-generated +/lib/codeql/rust/elements/PathAstNode.qll linguist-generated /lib/codeql/rust/elements/PathExpr.qll linguist-generated /lib/codeql/rust/elements/PathExprBase.qll linguist-generated /lib/codeql/rust/elements/PathPat.qll linguist-generated @@ -309,6 +310,7 @@ /lib/codeql/rust/elements/internal/ParenPatConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/ParenTypeReprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/PatImpl.qll linguist-generated +/lib/codeql/rust/elements/internal/PathAstNodeImpl.qll linguist-generated /lib/codeql/rust/elements/internal/PathConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/PathExprBaseImpl.qll linguist-generated /lib/codeql/rust/elements/internal/PathExprConstructor.qll linguist-generated @@ -526,6 +528,7 @@ /lib/codeql/rust/elements/internal/generated/ParentChild.qll linguist-generated /lib/codeql/rust/elements/internal/generated/Pat.qll linguist-generated /lib/codeql/rust/elements/internal/generated/Path.qll linguist-generated +/lib/codeql/rust/elements/internal/generated/PathAstNode.qll linguist-generated /lib/codeql/rust/elements/internal/generated/PathExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/PathExprBase.qll linguist-generated /lib/codeql/rust/elements/internal/generated/PathPat.qll linguist-generated @@ -913,8 +916,12 @@ /test/extractor-tests/generated/Path/PathExpr.ql linguist-generated /test/extractor-tests/generated/Path/PathExpr_getAttr.ql linguist-generated /test/extractor-tests/generated/Path/PathExpr_getPath.ql linguist-generated +/test/extractor-tests/generated/Path/PathExpr_getResolvedCrateOrigin.ql linguist-generated +/test/extractor-tests/generated/Path/PathExpr_getResolvedPath.ql linguist-generated /test/extractor-tests/generated/Path/PathPat.ql linguist-generated /test/extractor-tests/generated/Path/PathPat_getPath.ql linguist-generated +/test/extractor-tests/generated/Path/PathPat_getResolvedCrateOrigin.ql linguist-generated +/test/extractor-tests/generated/Path/PathPat_getResolvedPath.ql linguist-generated /test/extractor-tests/generated/Path/PathSegment.ql linguist-generated /test/extractor-tests/generated/Path/PathSegment_getGenericArgList.ql linguist-generated /test/extractor-tests/generated/Path/PathSegment_getNameRef.ql linguist-generated @@ -927,8 +934,6 @@ /test/extractor-tests/generated/Path/PathTypeRepr_getPath.ql linguist-generated /test/extractor-tests/generated/Path/Path_getPart.ql linguist-generated /test/extractor-tests/generated/Path/Path_getQualifier.ql linguist-generated -/test/extractor-tests/generated/Path/Path_getResolvedCrateOrigin.ql linguist-generated -/test/extractor-tests/generated/Path/Path_getResolvedPath.ql linguist-generated /test/extractor-tests/generated/PrefixExpr/PrefixExpr.ql linguist-generated /test/extractor-tests/generated/PrefixExpr/PrefixExpr_getAttr.ql linguist-generated /test/extractor-tests/generated/PrefixExpr/PrefixExpr_getExpr.ql linguist-generated @@ -947,6 +952,8 @@ /test/extractor-tests/generated/RecordExpr/RecordExpr.ql linguist-generated /test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.ql linguist-generated /test/extractor-tests/generated/RecordExpr/RecordExpr_getRecordExprFieldList.ql linguist-generated +/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedCrateOrigin.ql linguist-generated +/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedPath.ql linguist-generated /test/extractor-tests/generated/RecordExprField/RecordExprField.ql linguist-generated /test/extractor-tests/generated/RecordExprField/RecordExprField_getAttr.ql linguist-generated /test/extractor-tests/generated/RecordExprField/RecordExprField_getExpr.ql linguist-generated @@ -965,6 +972,8 @@ /test/extractor-tests/generated/RecordPat/RecordPat.ql linguist-generated /test/extractor-tests/generated/RecordPat/RecordPat_getPath.ql linguist-generated /test/extractor-tests/generated/RecordPat/RecordPat_getRecordPatFieldList.ql linguist-generated +/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedCrateOrigin.ql linguist-generated +/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedPath.ql linguist-generated /test/extractor-tests/generated/RecordPatField/RecordPatField.ql linguist-generated /test/extractor-tests/generated/RecordPatField/RecordPatField_getAttr.ql linguist-generated /test/extractor-tests/generated/RecordPatField/RecordPatField_getNameRef.ql linguist-generated @@ -1063,6 +1072,8 @@ /test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql linguist-generated /test/extractor-tests/generated/TupleStructPat/TupleStructPat_getField.ql linguist-generated /test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.ql linguist-generated +/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedCrateOrigin.ql linguist-generated +/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedPath.ql linguist-generated /test/extractor-tests/generated/TupleTypeRepr/TupleTypeRepr.ql linguist-generated /test/extractor-tests/generated/TupleTypeRepr/TupleTypeRepr_getField.ql linguist-generated /test/extractor-tests/generated/TypeAlias/TypeAlias.ql linguist-generated diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/generated/CfgNodes.qll b/rust/ql/lib/codeql/rust/controlflow/internal/generated/CfgNodes.qll index fcdc33679cd..78e78192b7c 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/generated/CfgNodes.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/generated/CfgNodes.qll @@ -2178,16 +2178,6 @@ module MakeCfgNodes Input> { * Gets the number of attrs of this path expression. */ int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } - - /** - * Gets the path of this path expression, if it exists. - */ - Path getPath() { result = node.getPath() } - - /** - * Holds if `getPath()` exists. - */ - predicate hasPath() { exists(this.getPath()) } } final private class ParentPathExprBase extends ParentAstNode, PathExprBase { @@ -2226,16 +2216,6 @@ module MakeCfgNodes Input> { /** Gets the underlying `PathPat`. */ PathPat getPathPat() { result = node } - - /** - * Gets the path of this path pattern, if it exists. - */ - Path getPath() { result = node.getPath() } - - /** - * Holds if `getPath()` exists. - */ - predicate hasPath() { exists(this.getPath()) } } final private class ParentPrefixExpr extends ParentAstNode, PrefixExpr { @@ -2463,16 +2443,6 @@ module MakeCfgNodes Input> { /** Gets the underlying `RecordExpr`. */ RecordExpr getRecordExpr() { result = node } - /** - * Gets the path of this record expression, if it exists. - */ - Path getPath() { result = node.getPath() } - - /** - * Holds if `getPath()` exists. - */ - predicate hasPath() { exists(this.getPath()) } - /** * Gets the record expression field list of this record expression, if it exists. */ @@ -2505,16 +2475,6 @@ module MakeCfgNodes Input> { /** Gets the underlying `RecordPat`. */ RecordPat getRecordPat() { result = node } - /** - * Gets the path of this record pattern, if it exists. - */ - Path getPath() { result = node.getPath() } - - /** - * Holds if `getPath()` exists. - */ - predicate hasPath() { exists(this.getPath()) } - /** * Gets the record pattern field list of this record pattern, if it exists. */ @@ -3007,16 +2967,6 @@ module MakeCfgNodes Input> { * Gets the number of fields of this tuple struct pattern. */ int getNumberOfFields() { result = count(int i | exists(this.getField(i))) } - - /** - * Gets the path of this tuple struct pattern, if it exists. - */ - Path getPath() { result = node.getPath() } - - /** - * Holds if `getPath()` exists. - */ - predicate hasPath() { exists(this.getPath()) } } final private class ParentUnderscoreExpr extends ParentAstNode, UnderscoreExpr { diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll index 04d1e82d2a2..734dfb4f269 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll @@ -811,7 +811,7 @@ module RustDataFlow implements InputSig { } /** Holds if path `p` resolves to struct `s`. */ - private predicate pathResolveToStructCanonicalPath(Path p, StructCanonicalPath s) { + private predicate pathResolveToStructCanonicalPath(PathAstNode p, StructCanonicalPath s) { exists(CrateOriginOption crate, string path | resolveExtendedCanonicalPath(p, crate, path) and s = MkStructCanonicalPath(crate, path) @@ -819,35 +819,29 @@ module RustDataFlow implements InputSig { } /** Holds if path `p` resolves to variant `v`. */ - private predicate pathResolveToVariantCanonicalPath(Path p, VariantCanonicalPath v) { - exists(CrateOriginOption crate, string path | - resolveExtendedCanonicalPath(p.getQualifier(), crate, path) and - v = MkVariantCanonicalPath(crate, path, p.getPart().getNameRef().getText()) - or - exists(string name | - not p.hasQualifier() and - resolveExtendedCanonicalPath(p, crate, path + "::" + name) and - v = MkVariantCanonicalPath(crate, path, name) - ) + private predicate pathResolveToVariantCanonicalPath(PathAstNode p, VariantCanonicalPath v) { + exists(CrateOriginOption crate, string path, string name | + resolveExtendedCanonicalPath(p, crate, path + "::" + name) and + v = MkVariantCanonicalPath(crate, path, name) ) } /** Holds if `p` destructs an enum variant `v`. */ pragma[nomagic] private predicate tupleVariantDestruction(TupleStructPat p, VariantCanonicalPath v) { - pathResolveToVariantCanonicalPath(p.getPath(), v) + pathResolveToVariantCanonicalPath(p, v) } /** Holds if `p` destructs an enum variant `v`. */ pragma[nomagic] private predicate recordVariantDestruction(RecordPat p, VariantCanonicalPath v) { - pathResolveToVariantCanonicalPath(p.getPath(), v) + pathResolveToVariantCanonicalPath(p, v) } /** Holds if `p` destructs a struct `s`. */ pragma[nomagic] private predicate structDestruction(RecordPat p, StructCanonicalPath s) { - pathResolveToStructCanonicalPath(p.getPath(), s) + pathResolveToStructCanonicalPath(p, s) } /** @@ -900,19 +894,19 @@ module RustDataFlow implements InputSig { /** Holds if `ce` constructs an enum value of type `v`. */ pragma[nomagic] private predicate tupleVariantConstruction(CallExpr ce, VariantCanonicalPath v) { - pathResolveToVariantCanonicalPath(ce.getFunction().(PathExpr).getPath(), v) + pathResolveToVariantCanonicalPath(ce.getFunction().(PathExpr), v) } /** Holds if `re` constructs an enum value of type `v`. */ pragma[nomagic] private predicate recordVariantConstruction(RecordExpr re, VariantCanonicalPath v) { - pathResolveToVariantCanonicalPath(re.getPath(), v) + pathResolveToVariantCanonicalPath(re, v) } /** Holds if `re` constructs a struct value of type `s`. */ pragma[nomagic] private predicate structConstruction(RecordExpr re, StructCanonicalPath s) { - pathResolveToStructCanonicalPath(re.getPath(), s) + pathResolveToStructCanonicalPath(re, s) } private predicate tupleAssignment(Node node1, Node node2, TuplePositionContent c) { diff --git a/rust/ql/lib/codeql/rust/elements.qll b/rust/ql/lib/codeql/rust/elements.qll index ca3cccabb5f..725f044ee18 100644 --- a/rust/ql/lib/codeql/rust/elements.qll +++ b/rust/ql/lib/codeql/rust/elements.qll @@ -109,6 +109,7 @@ import codeql.rust.elements.ParenPat import codeql.rust.elements.ParenTypeRepr import codeql.rust.elements.Pat import codeql.rust.elements.Path +import codeql.rust.elements.PathAstNode import codeql.rust.elements.PathExpr import codeql.rust.elements.PathExprBase import codeql.rust.elements.PathPat diff --git a/rust/ql/lib/codeql/rust/elements/Path.qll b/rust/ql/lib/codeql/rust/elements/Path.qll index cb228373cf5..a3549e66a85 100644 --- a/rust/ql/lib/codeql/rust/elements/Path.qll +++ b/rust/ql/lib/codeql/rust/elements/Path.qll @@ -4,8 +4,8 @@ */ private import internal.PathImpl +import codeql.rust.elements.AstNode import codeql.rust.elements.PathSegment -import codeql.rust.elements.Resolvable /** * A path. For example: diff --git a/rust/ql/lib/codeql/rust/elements/PathAstNode.qll b/rust/ql/lib/codeql/rust/elements/PathAstNode.qll new file mode 100644 index 00000000000..c8ff02e634c --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/PathAstNode.qll @@ -0,0 +1,13 @@ +// generated by codegen, do not edit +/** + * This module provides the public class `PathAstNode`. + */ + +private import internal.PathAstNodeImpl +import codeql.rust.elements.Path +import codeql.rust.elements.Resolvable + +/** + * An AST element wrapping a path (`PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat`). + */ +final class PathAstNode = Impl::PathAstNode; diff --git a/rust/ql/lib/codeql/rust/elements/PathExpr.qll b/rust/ql/lib/codeql/rust/elements/PathExpr.qll index 3e7d6e5e40f..8d423d76687 100644 --- a/rust/ql/lib/codeql/rust/elements/PathExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/PathExpr.qll @@ -5,7 +5,7 @@ private import internal.PathExprImpl import codeql.rust.elements.Attr -import codeql.rust.elements.Path +import codeql.rust.elements.PathAstNode import codeql.rust.elements.PathExprBase /** diff --git a/rust/ql/lib/codeql/rust/elements/PathPat.qll b/rust/ql/lib/codeql/rust/elements/PathPat.qll index 17dc5f71381..ae61b5e93e8 100644 --- a/rust/ql/lib/codeql/rust/elements/PathPat.qll +++ b/rust/ql/lib/codeql/rust/elements/PathPat.qll @@ -5,7 +5,7 @@ private import internal.PathPatImpl import codeql.rust.elements.Pat -import codeql.rust.elements.Path +import codeql.rust.elements.PathAstNode /** * A path pattern. For example: diff --git a/rust/ql/lib/codeql/rust/elements/RecordExpr.qll b/rust/ql/lib/codeql/rust/elements/RecordExpr.qll index 90edf3d0c03..3429ff3597e 100644 --- a/rust/ql/lib/codeql/rust/elements/RecordExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/RecordExpr.qll @@ -5,7 +5,7 @@ private import internal.RecordExprImpl import codeql.rust.elements.Expr -import codeql.rust.elements.Path +import codeql.rust.elements.PathAstNode import codeql.rust.elements.RecordExprFieldList /** diff --git a/rust/ql/lib/codeql/rust/elements/RecordPat.qll b/rust/ql/lib/codeql/rust/elements/RecordPat.qll index 671bafda1c3..242b7398696 100644 --- a/rust/ql/lib/codeql/rust/elements/RecordPat.qll +++ b/rust/ql/lib/codeql/rust/elements/RecordPat.qll @@ -5,7 +5,7 @@ private import internal.RecordPatImpl import codeql.rust.elements.Pat -import codeql.rust.elements.Path +import codeql.rust.elements.PathAstNode import codeql.rust.elements.RecordPatFieldList /** diff --git a/rust/ql/lib/codeql/rust/elements/Resolvable.qll b/rust/ql/lib/codeql/rust/elements/Resolvable.qll index e3e7b772501..6a2304a3be7 100644 --- a/rust/ql/lib/codeql/rust/elements/Resolvable.qll +++ b/rust/ql/lib/codeql/rust/elements/Resolvable.qll @@ -7,6 +7,6 @@ private import internal.ResolvableImpl import codeql.rust.elements.AstNode /** - * Either a `Path`, or a `MethodCallExpr`. + * One of `PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat` or `MethodCallExpr`. */ final class Resolvable = Impl::Resolvable; diff --git a/rust/ql/lib/codeql/rust/elements/TupleStructPat.qll b/rust/ql/lib/codeql/rust/elements/TupleStructPat.qll index c43672509f7..82c5aa4c0dd 100644 --- a/rust/ql/lib/codeql/rust/elements/TupleStructPat.qll +++ b/rust/ql/lib/codeql/rust/elements/TupleStructPat.qll @@ -5,7 +5,7 @@ private import internal.TupleStructPatImpl import codeql.rust.elements.Pat -import codeql.rust.elements.Path +import codeql.rust.elements.PathAstNode /** * A tuple struct pattern. For example: diff --git a/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll index 3729bb8eeb7..f67c8f28925 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll @@ -5,6 +5,7 @@ */ private import codeql.rust.elements.internal.generated.CallExprBase +private import codeql.rust.elements.Resolvable /** * INTERNAL: This module contains the customizable definition of `CallExprBase` and should not @@ -20,7 +21,7 @@ module Impl { Resolvable getCallResolvable(CallExprBase call) { result = call.(MethodCallExpr) or - result = call.(CallExpr).getFunction().(PathExpr).getPath() + result = call.(CallExpr).getFunction().(PathExpr) } // the following QLdoc is generated: if you need to edit it, do it in the schema file diff --git a/rust/ql/lib/codeql/rust/elements/internal/PathAstNodeImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/PathAstNodeImpl.qll new file mode 100644 index 00000000000..30ad03a4724 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/PathAstNodeImpl.qll @@ -0,0 +1,19 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `PathAstNode`. + * + * INTERNAL: Do not use. + */ + +private import codeql.rust.elements.internal.generated.PathAstNode + +/** + * INTERNAL: This module contains the customizable definition of `PathAstNode` and should not + * be referenced directly. + */ +module Impl { + /** + * An AST element wrapping a path (`PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat`). + */ + class PathAstNode extends Generated::PathAstNode { } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/ResolvableImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ResolvableImpl.qll index fafb86d46c0..86304cd23de 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ResolvableImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ResolvableImpl.qll @@ -15,7 +15,7 @@ module Impl { // the following QLdoc is generated: if you need to edit it, do it in the schema file /** - * Either a `Path`, or a `MethodCallExpr`. + * One of `PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat` or `MethodCallExpr`. */ class Resolvable extends Generated::Resolvable { /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll index c036d05cd03..23b464bb895 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll @@ -687,6 +687,25 @@ private module Impl { ) } + private Element getImmediateChildOfPath(Path e, int index, string partialPredicateCall) { + exists(int b, int bAstNode, int n, int nQualifier, int nPart | + b = 0 and + bAstNode = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAstNode(e, i, _)) | i) and + n = bAstNode and + nQualifier = n + 1 and + nPart = nQualifier + 1 and + ( + none() + or + result = getImmediateChildOfAstNode(e, index - b, partialPredicateCall) + or + index = n and result = e.getQualifier() and partialPredicateCall = "Qualifier()" + or + index = nQualifier and result = e.getPart() and partialPredicateCall = "Part()" + ) + ) + } + private Element getImmediateChildOfPathSegment( PathSegment e, int index, string partialPredicateCall ) { @@ -2237,22 +2256,21 @@ private module Impl { ) } - private Element getImmediateChildOfPath(Path e, int index, string partialPredicateCall) { - exists(int b, int bResolvable, int n, int nQualifier, int nPart | + private Element getImmediateChildOfPathAstNode( + PathAstNode e, int index, string partialPredicateCall + ) { + exists(int b, int bResolvable, int n, int nPath | b = 0 and bResolvable = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfResolvable(e, i, _)) | i) and n = bResolvable and - nQualifier = n + 1 and - nPart = nQualifier + 1 and + nPath = n + 1 and ( none() or result = getImmediateChildOfResolvable(e, index - b, partialPredicateCall) or - index = n and result = e.getQualifier() and partialPredicateCall = "Qualifier()" - or - index = nQualifier and result = e.getPart() and partialPredicateCall = "Part()" + index = n and result = e.getPath() and partialPredicateCall = "Path()" ) ) } @@ -2272,22 +2290,6 @@ private module Impl { ) } - private Element getImmediateChildOfPathPat(PathPat e, int index, string partialPredicateCall) { - exists(int b, int bPat, int n, int nPath | - b = 0 and - bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and - n = bPat and - nPath = n + 1 and - ( - none() - or - result = getImmediateChildOfPat(e, index - b, partialPredicateCall) - or - index = n and result = e.getPath() and partialPredicateCall = "Path()" - ) - ) - } - private Element getImmediateChildOfPathTypeRepr( PathTypeRepr e, int index, string partialPredicateCall ) { @@ -2386,27 +2388,6 @@ private module Impl { ) } - private Element getImmediateChildOfRecordExpr(RecordExpr e, int index, string partialPredicateCall) { - exists(int b, int bExpr, int n, int nPath, int nRecordExprFieldList | - b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and - nPath = n + 1 and - nRecordExprFieldList = nPath + 1 and - ( - none() - or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) - or - index = n and result = e.getPath() and partialPredicateCall = "Path()" - or - index = nPath and - result = e.getRecordExprFieldList() and - partialPredicateCall = "RecordExprFieldList()" - ) - ) - } - private Element getImmediateChildOfRecordFieldList( RecordFieldList e, int index, string partialPredicateCall ) { @@ -2426,27 +2407,6 @@ private module Impl { ) } - private Element getImmediateChildOfRecordPat(RecordPat e, int index, string partialPredicateCall) { - exists(int b, int bPat, int n, int nPath, int nRecordPatFieldList | - b = 0 and - bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and - n = bPat and - nPath = n + 1 and - nRecordPatFieldList = nPath + 1 and - ( - none() - or - result = getImmediateChildOfPat(e, index - b, partialPredicateCall) - or - index = n and result = e.getPath() and partialPredicateCall = "Path()" - or - index = nPath and - result = e.getRecordPatFieldList() and - partialPredicateCall = "RecordPatFieldList()" - ) - ) - } - private Element getImmediateChildOfRefExpr(RefExpr e, int index, string partialPredicateCall) { exists(int b, int bExpr, int n, int nAttr, int nExpr | b = 0 and @@ -2672,28 +2632,6 @@ private module Impl { ) } - private Element getImmediateChildOfTupleStructPat( - TupleStructPat e, int index, string partialPredicateCall - ) { - exists(int b, int bPat, int n, int nField, int nPath | - b = 0 and - bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and - n = bPat and - nField = n + 1 + max(int i | i = -1 or exists(e.getField(i)) | i) and - nPath = nField + 1 and - ( - none() - or - result = getImmediateChildOfPat(e, index - b, partialPredicateCall) - or - result = e.getField(index - n) and - partialPredicateCall = "Field(" + (index - n).toString() + ")" - or - index = nField and result = e.getPath() and partialPredicateCall = "Path()" - ) - ) - } - private Element getImmediateChildOfTupleTypeRepr( TupleTypeRepr e, int index, string partialPredicateCall ) { @@ -3353,22 +3291,85 @@ private module Impl { } private Element getImmediateChildOfPathExpr(PathExpr e, int index, string partialPredicateCall) { - exists(int b, int bPathExprBase, int n, int nAttr, int nPath | + exists(int b, int bPathExprBase, int bPathAstNode, int n, int nAttr | b = 0 and bPathExprBase = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPathExprBase(e, i, _)) | i) and - n = bPathExprBase and + bPathAstNode = + bPathExprBase + 1 + + max(int i | i = -1 or exists(getImmediateChildOfPathAstNode(e, i, _)) | i) and + n = bPathAstNode and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nPath = nAttr + 1 and ( none() or result = getImmediateChildOfPathExprBase(e, index - b, partialPredicateCall) or + result = getImmediateChildOfPathAstNode(e, index - bPathExprBase, partialPredicateCall) + or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" + ) + ) + } + + private Element getImmediateChildOfPathPat(PathPat e, int index, string partialPredicateCall) { + exists(int b, int bPat, int bPathAstNode, int n | + b = 0 and + bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and + bPathAstNode = + bPat + 1 + max(int i | i = -1 or exists(getImmediateChildOfPathAstNode(e, i, _)) | i) and + n = bPathAstNode and + ( + none() or - index = nAttr and result = e.getPath() and partialPredicateCall = "Path()" + result = getImmediateChildOfPat(e, index - b, partialPredicateCall) + or + result = getImmediateChildOfPathAstNode(e, index - bPat, partialPredicateCall) + ) + ) + } + + private Element getImmediateChildOfRecordExpr(RecordExpr e, int index, string partialPredicateCall) { + exists(int b, int bExpr, int bPathAstNode, int n, int nRecordExprFieldList | + b = 0 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + bPathAstNode = + bExpr + 1 + max(int i | i = -1 or exists(getImmediateChildOfPathAstNode(e, i, _)) | i) and + n = bPathAstNode and + nRecordExprFieldList = n + 1 and + ( + none() + or + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + or + result = getImmediateChildOfPathAstNode(e, index - bExpr, partialPredicateCall) + or + index = n and + result = e.getRecordExprFieldList() and + partialPredicateCall = "RecordExprFieldList()" + ) + ) + } + + private Element getImmediateChildOfRecordPat(RecordPat e, int index, string partialPredicateCall) { + exists(int b, int bPat, int bPathAstNode, int n, int nRecordPatFieldList | + b = 0 and + bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and + bPathAstNode = + bPat + 1 + max(int i | i = -1 or exists(getImmediateChildOfPathAstNode(e, i, _)) | i) and + n = bPathAstNode and + nRecordPatFieldList = n + 1 and + ( + none() + or + result = getImmediateChildOfPat(e, index - b, partialPredicateCall) + or + result = getImmediateChildOfPathAstNode(e, index - bPat, partialPredicateCall) + or + index = n and + result = e.getRecordPatFieldList() and + partialPredicateCall = "RecordPatFieldList()" ) ) } @@ -3533,6 +3534,29 @@ private module Impl { ) } + private Element getImmediateChildOfTupleStructPat( + TupleStructPat e, int index, string partialPredicateCall + ) { + exists(int b, int bPat, int bPathAstNode, int n, int nField | + b = 0 and + bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and + bPathAstNode = + bPat + 1 + max(int i | i = -1 or exists(getImmediateChildOfPathAstNode(e, i, _)) | i) and + n = bPathAstNode and + nField = n + 1 + max(int i | i = -1 or exists(e.getField(i)) | i) and + ( + none() + or + result = getImmediateChildOfPat(e, index - b, partialPredicateCall) + or + result = getImmediateChildOfPathAstNode(e, index - bPat, partialPredicateCall) + or + result = e.getField(index - n) and + partialPredicateCall = "Field(" + (index - n).toString() + ")" + ) + ) + } + private Element getImmediateChildOfTypeAlias(TypeAlias e, int index, string partialPredicateCall) { exists( int b, int bAssocItem, int bExternItem, int bItem, int n, int nAttr, int nGenericParamList, @@ -3775,6 +3799,8 @@ private module Impl { or result = getImmediateChildOfParamList(e, index, partialAccessor) or + result = getImmediateChildOfPath(e, index, partialAccessor) + or result = getImmediateChildOfPathSegment(e, index, partialAccessor) or result = getImmediateChildOfRecordExprField(e, index, partialAccessor) @@ -3905,10 +3931,6 @@ private module Impl { or result = getImmediateChildOfParenTypeRepr(e, index, partialAccessor) or - result = getImmediateChildOfPath(e, index, partialAccessor) - or - result = getImmediateChildOfPathPat(e, index, partialAccessor) - or result = getImmediateChildOfPathTypeRepr(e, index, partialAccessor) or result = getImmediateChildOfPrefixExpr(e, index, partialAccessor) @@ -3919,12 +3941,8 @@ private module Impl { or result = getImmediateChildOfRangePat(e, index, partialAccessor) or - result = getImmediateChildOfRecordExpr(e, index, partialAccessor) - or result = getImmediateChildOfRecordFieldList(e, index, partialAccessor) or - result = getImmediateChildOfRecordPat(e, index, partialAccessor) - or result = getImmediateChildOfRefExpr(e, index, partialAccessor) or result = getImmediateChildOfRefPat(e, index, partialAccessor) @@ -3949,8 +3967,6 @@ private module Impl { or result = getImmediateChildOfTuplePat(e, index, partialAccessor) or - result = getImmediateChildOfTupleStructPat(e, index, partialAccessor) - or result = getImmediateChildOfTupleTypeRepr(e, index, partialAccessor) or result = getImmediateChildOfTypeArg(e, index, partialAccessor) @@ -4001,6 +4017,12 @@ private module Impl { or result = getImmediateChildOfPathExpr(e, index, partialAccessor) or + result = getImmediateChildOfPathPat(e, index, partialAccessor) + or + result = getImmediateChildOfRecordExpr(e, index, partialAccessor) + or + result = getImmediateChildOfRecordPat(e, index, partialAccessor) + or result = getImmediateChildOfStatic(e, index, partialAccessor) or result = getImmediateChildOfStruct(e, index, partialAccessor) @@ -4009,6 +4031,8 @@ private module Impl { or result = getImmediateChildOfTraitAlias(e, index, partialAccessor) or + result = getImmediateChildOfTupleStructPat(e, index, partialAccessor) + or result = getImmediateChildOfTypeAlias(e, index, partialAccessor) or result = getImmediateChildOfUnion(e, index, partialAccessor) diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Path.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Path.qll index 36313ca9fe9..b9a6edce9f4 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Path.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Path.qll @@ -6,9 +6,9 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.internal.AstNodeImpl::Impl as AstNodeImpl import codeql.rust.elements.Path import codeql.rust.elements.PathSegment -import codeql.rust.elements.internal.ResolvableImpl::Impl as ResolvableImpl /** * INTERNAL: This module contains the fully generated definition of `Path` and should not @@ -24,7 +24,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Path` class directly. * Use the subclass `Path`, where the following predicates are available. */ - class Path extends Synth::TPath, ResolvableImpl::Resolvable { + class Path extends Synth::TPath, AstNodeImpl::AstNode { override string getAPrimaryQlClass() { result = "Path" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/PathAstNode.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/PathAstNode.qll new file mode 100644 index 00000000000..a69957e7545 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/PathAstNode.qll @@ -0,0 +1,36 @@ +// generated by codegen, do not edit +/** + * This module provides the generated definition of `PathAstNode`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.elements.internal.generated.Synth +private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.Path +import codeql.rust.elements.internal.ResolvableImpl::Impl as ResolvableImpl + +/** + * INTERNAL: This module contains the fully generated definition of `PathAstNode` and should not + * be referenced directly. + */ +module Generated { + /** + * An AST element wrapping a path (`PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat`). + * INTERNAL: Do not reference the `Generated::PathAstNode` class directly. + * Use the subclass `PathAstNode`, where the following predicates are available. + */ + class PathAstNode extends Synth::TPathAstNode, ResolvableImpl::Resolvable { + /** + * Gets the path of this path ast node, if it exists. + */ + Path getPath() { + result = + Synth::convertPathFromRaw(Synth::convertPathAstNodeToRaw(this).(Raw::PathAstNode).getPath()) + } + + /** + * Holds if `getPath()` exists. + */ + final predicate hasPath() { exists(this.getPath()) } + } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/PathExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/PathExpr.qll index d0c3f7e82aa..7409a285453 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/PathExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/PathExpr.qll @@ -7,7 +7,7 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.Attr -import codeql.rust.elements.Path +import codeql.rust.elements.internal.PathAstNodeImpl::Impl as PathAstNodeImpl import codeql.rust.elements.internal.PathExprBaseImpl::Impl as PathExprBaseImpl /** @@ -26,7 +26,9 @@ module Generated { * INTERNAL: Do not reference the `Generated::PathExpr` class directly. * Use the subclass `PathExpr`, where the following predicates are available. */ - class PathExpr extends Synth::TPathExpr, PathExprBaseImpl::PathExprBase { + class PathExpr extends Synth::TPathExpr, PathExprBaseImpl::PathExprBase, + PathAstNodeImpl::PathAstNode + { override string getAPrimaryQlClass() { result = "PathExpr" } /** @@ -46,18 +48,5 @@ module Generated { * Gets the number of attrs of this path expression. */ final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } - - /** - * Gets the path of this path expression, if it exists. - */ - Path getPath() { - result = - Synth::convertPathFromRaw(Synth::convertPathExprToRaw(this).(Raw::PathExpr).getPath()) - } - - /** - * Holds if `getPath()` exists. - */ - final predicate hasPath() { exists(this.getPath()) } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/PathPat.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/PathPat.qll index f1d3beafeb9..3e69bb2cb32 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/PathPat.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/PathPat.qll @@ -7,7 +7,7 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.internal.PatImpl::Impl as PatImpl -import codeql.rust.elements.Path +import codeql.rust.elements.internal.PathAstNodeImpl::Impl as PathAstNodeImpl /** * INTERNAL: This module contains the fully generated definition of `PathPat` and should not @@ -25,19 +25,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::PathPat` class directly. * Use the subclass `PathPat`, where the following predicates are available. */ - class PathPat extends Synth::TPathPat, PatImpl::Pat { + class PathPat extends Synth::TPathPat, PatImpl::Pat, PathAstNodeImpl::PathAstNode { override string getAPrimaryQlClass() { result = "PathPat" } - - /** - * Gets the path of this path pattern, if it exists. - */ - Path getPath() { - result = Synth::convertPathFromRaw(Synth::convertPathPatToRaw(this).(Raw::PathPat).getPath()) - } - - /** - * Holds if `getPath()` exists. - */ - final predicate hasPath() { exists(this.getPath()) } } } 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 8217b175a74..5a32a8623bc 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -614,6 +614,28 @@ module Raw { */ class Pat extends @pat, AstNode { } + /** + * INTERNAL: Do not use. + * A path. For example: + * ```rust + * use some_crate::some_module::some_item; + * foo::bar; + * ``` + */ + class Path extends @path, AstNode { + override string toString() { result = "Path" } + + /** + * Gets the qualifier of this path, if it exists. + */ + Path getQualifier() { path_qualifiers(this, result) } + + /** + * Gets the part of this path, if it exists. + */ + PathSegment getPart() { path_parts(this, result) } + } + /** * INTERNAL: Do not use. * A path segment, which is one part of a whole path. @@ -805,7 +827,7 @@ module Raw { /** * INTERNAL: Do not use. - * Either a `Path`, or a `MethodCallExpr`. + * One of `PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat` or `MethodCallExpr`. */ class Resolvable extends @resolvable, AstNode { /** @@ -2304,24 +2326,13 @@ module Raw { /** * INTERNAL: Do not use. - * A path. For example: - * ```rust - * use some_crate::some_module::some_item; - * foo::bar; - * ``` + * An AST element wrapping a path (`PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat`). */ - class Path extends @path, Resolvable { - override string toString() { result = "Path" } - + class PathAstNode extends @path_ast_node, Resolvable { /** - * Gets the qualifier of this path, if it exists. + * Gets the path of this path ast node, if it exists. */ - Path getQualifier() { path_qualifiers(this, result) } - - /** - * Gets the part of this path, if it exists. - */ - PathSegment getPart() { path_parts(this, result) } + Path getPath() { path_ast_node_paths(this, result) } } /** @@ -2330,25 +2341,6 @@ module Raw { */ class PathExprBase extends @path_expr_base, Expr { } - /** - * INTERNAL: Do not use. - * A path pattern. For example: - * ```rust - * match x { - * Foo::Bar => "ok", - * _ => "fail", - * } - * ``` - */ - class PathPat extends @path_pat, Pat { - override string toString() { result = "PathPat" } - - /** - * Gets the path of this path pattern, if it exists. - */ - Path getPath() { path_pat_paths(this, result) } - } - /** * INTERNAL: Do not use. * A type referring to a path. For example: @@ -2486,32 +2478,6 @@ module Raw { Pat getStart() { range_pat_starts(this, result) } } - /** - * INTERNAL: Do not use. - * A record expression. For example: - * ```rust - * let first = Foo { a: 1, b: 2 }; - * let second = Foo { a: 2, ..first }; - * Foo { a: 1, b: 2 }[2] = 10; - * Foo { .. } = second; - * ``` - */ - class RecordExpr extends @record_expr, Expr { - override string toString() { result = "RecordExpr" } - - /** - * Gets the path of this record expression, if it exists. - */ - Path getPath() { record_expr_paths(this, result) } - - /** - * Gets the record expression field list of this record expression, if it exists. - */ - RecordExprFieldList getRecordExprFieldList() { - record_expr_record_expr_field_lists(this, result) - } - } - /** * INTERNAL: Do not use. * A RecordFieldList. For example: @@ -2528,30 +2494,6 @@ module Raw { RecordField getField(int index) { record_field_list_fields(this, index, result) } } - /** - * INTERNAL: Do not use. - * A record pattern. For example: - * ```rust - * match x { - * Foo { a: 1, b: 2 } => "ok", - * Foo { .. } => "fail", - * } - * ``` - */ - class RecordPat extends @record_pat, Pat { - override string toString() { result = "RecordPat" } - - /** - * Gets the path of this record pattern, if it exists. - */ - Path getPath() { record_pat_paths(this, result) } - - /** - * Gets the record pattern field list of this record pattern, if it exists. - */ - RecordPatFieldList getRecordPatFieldList() { record_pat_record_pat_field_lists(this, result) } - } - /** * INTERNAL: Do not use. * A reference expression. For example: @@ -2825,31 +2767,6 @@ module Raw { Pat getField(int index) { tuple_pat_fields(this, index, result) } } - /** - * INTERNAL: Do not use. - * A tuple struct pattern. For example: - * ```rust - * match x { - * Tuple("a", 1, 2, 3) => "great", - * Tuple(.., 3) => "fine", - * Tuple(..) => "fail", - * }; - * ``` - */ - class TupleStructPat extends @tuple_struct_pat, Pat { - override string toString() { result = "TupleStructPat" } - - /** - * Gets the `index`th field of this tuple struct pattern (0-based). - */ - Pat getField(int index) { tuple_struct_pat_fields(this, index, result) } - - /** - * Gets the path of this tuple struct pattern, if it exists. - */ - Path getPath() { tuple_struct_pat_paths(this, result) } - } - /** * INTERNAL: Do not use. * A TupleTypeRepr. For example: @@ -3570,18 +3487,67 @@ module Raw { * let z = ::foo; * ``` */ - class PathExpr extends @path_expr, PathExprBase { + class PathExpr extends @path_expr, PathExprBase, PathAstNode { override string toString() { result = "PathExpr" } /** * Gets the `index`th attr of this path expression (0-based). */ Attr getAttr(int index) { path_expr_attrs(this, index, result) } + } + + /** + * INTERNAL: Do not use. + * A path pattern. For example: + * ```rust + * match x { + * Foo::Bar => "ok", + * _ => "fail", + * } + * ``` + */ + class PathPat extends @path_pat, Pat, PathAstNode { + override string toString() { result = "PathPat" } + } + + /** + * INTERNAL: Do not use. + * A record expression. For example: + * ```rust + * let first = Foo { a: 1, b: 2 }; + * let second = Foo { a: 2, ..first }; + * Foo { a: 1, b: 2 }[2] = 10; + * Foo { .. } = second; + * ``` + */ + class RecordExpr extends @record_expr, Expr, PathAstNode { + override string toString() { result = "RecordExpr" } /** - * Gets the path of this path expression, if it exists. + * Gets the record expression field list of this record expression, if it exists. */ - Path getPath() { path_expr_paths(this, result) } + RecordExprFieldList getRecordExprFieldList() { + record_expr_record_expr_field_lists(this, result) + } + } + + /** + * INTERNAL: Do not use. + * A record pattern. For example: + * ```rust + * match x { + * Foo { a: 1, b: 2 } => "ok", + * Foo { .. } => "fail", + * } + * ``` + */ + class RecordPat extends @record_pat, Pat, PathAstNode { + override string toString() { result = "RecordPat" } + + /** + * Gets the record pattern field list of this record pattern, if it exists. + */ + RecordPatFieldList getRecordPatFieldList() { record_pat_record_pat_field_lists(this, result) } } /** @@ -3774,6 +3740,26 @@ module Raw { WhereClause getWhereClause() { trait_alias_where_clauses(this, result) } } + /** + * INTERNAL: Do not use. + * A tuple struct pattern. For example: + * ```rust + * match x { + * Tuple("a", 1, 2, 3) => "great", + * Tuple(.., 3) => "fine", + * Tuple(..) => "fail", + * }; + * ``` + */ + class TupleStructPat extends @tuple_struct_pat, Pat, PathAstNode { + override string toString() { result = "TupleStructPat" } + + /** + * Gets the `index`th field of this tuple struct pattern (0-based). + */ + Pat getField(int index) { tuple_struct_pat_fields(this, index, result) } + } + /** * INTERNAL: Do not use. * A TypeAlias. For example: diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/RecordExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/RecordExpr.qll index 96fc2aa61d0..b6a0a2ecdd2 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/RecordExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/RecordExpr.qll @@ -7,7 +7,7 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl -import codeql.rust.elements.Path +import codeql.rust.elements.internal.PathAstNodeImpl::Impl as PathAstNodeImpl import codeql.rust.elements.RecordExprFieldList /** @@ -26,22 +26,9 @@ module Generated { * INTERNAL: Do not reference the `Generated::RecordExpr` class directly. * Use the subclass `RecordExpr`, where the following predicates are available. */ - class RecordExpr extends Synth::TRecordExpr, ExprImpl::Expr { + class RecordExpr extends Synth::TRecordExpr, ExprImpl::Expr, PathAstNodeImpl::PathAstNode { override string getAPrimaryQlClass() { result = "RecordExpr" } - /** - * Gets the path of this record expression, if it exists. - */ - Path getPath() { - result = - Synth::convertPathFromRaw(Synth::convertRecordExprToRaw(this).(Raw::RecordExpr).getPath()) - } - - /** - * Holds if `getPath()` exists. - */ - final predicate hasPath() { exists(this.getPath()) } - /** * Gets the record expression field list of this record expression, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/RecordPat.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/RecordPat.qll index 2aa2abad28a..fd215a3056d 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/RecordPat.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/RecordPat.qll @@ -7,7 +7,7 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.internal.PatImpl::Impl as PatImpl -import codeql.rust.elements.Path +import codeql.rust.elements.internal.PathAstNodeImpl::Impl as PathAstNodeImpl import codeql.rust.elements.RecordPatFieldList /** @@ -26,22 +26,9 @@ module Generated { * INTERNAL: Do not reference the `Generated::RecordPat` class directly. * Use the subclass `RecordPat`, where the following predicates are available. */ - class RecordPat extends Synth::TRecordPat, PatImpl::Pat { + class RecordPat extends Synth::TRecordPat, PatImpl::Pat, PathAstNodeImpl::PathAstNode { override string getAPrimaryQlClass() { result = "RecordPat" } - /** - * Gets the path of this record pattern, if it exists. - */ - Path getPath() { - result = - Synth::convertPathFromRaw(Synth::convertRecordPatToRaw(this).(Raw::RecordPat).getPath()) - } - - /** - * Holds if `getPath()` exists. - */ - final predicate hasPath() { exists(this.getPath()) } - /** * Gets the record pattern field list of this record pattern, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Resolvable.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Resolvable.qll index 018c451e584..fb0d7975cf9 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Resolvable.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Resolvable.qll @@ -14,7 +14,7 @@ import codeql.rust.elements.internal.AstNodeImpl::Impl as AstNodeImpl */ module Generated { /** - * Either a `Path`, or a `MethodCallExpr`. + * One of `PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat` or `MethodCallExpr`. * INTERNAL: Do not reference the `Generated::Resolvable` class directly. * Use the subclass `Resolvable`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll index 7e13da92fd7..02ce677071e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll @@ -647,7 +647,7 @@ module Synth { TGenericArg or TGenericArgList or TGenericParam or TGenericParamList or TItemList or TLabel or TLetElse or TLifetime or TMacroItems or TMacroStmts or TMatchArm or TMatchArmList or TMatchGuard or TMeta or TName or TNameRef or TParamBase or TParamList or - TPat or TPathSegment or TRecordExprField or TRecordExprFieldList or TRecordField or + TPat or TPath or TPathSegment or TRecordExprField or TRecordExprFieldList or TRecordField or TRecordPatField or TRecordPatFieldList or TRename or TResolvable or TRetTypeRepr or TReturnTypeSyntax or TSourceFile or TStmt or TStmtList or TToken or TTokenTree or TTupleField or TTypeBound or TTypeBoundList or TTypeRepr or TUseTree or TUseTreeList or @@ -730,6 +730,11 @@ module Synth { TPathPat or TRangePat or TRecordPat or TRefPat or TRestPat or TSlicePat or TTuplePat or TTupleStructPat or TWildcardPat; + /** + * INTERNAL: Do not use. + */ + class TPathAstNode = TPathExpr or TPathPat or TRecordExpr or TRecordPat or TTupleStructPat; + /** * INTERNAL: Do not use. */ @@ -738,7 +743,7 @@ module Synth { /** * INTERNAL: Do not use. */ - class TResolvable = TMethodCallExpr or TPath; + class TResolvable = TMethodCallExpr or TPathAstNode; /** * INTERNAL: Do not use. @@ -1776,6 +1781,8 @@ module Synth { or result = convertPatFromRaw(e) or + result = convertPathFromRaw(e) + or result = convertPathSegmentFromRaw(e) or result = convertRecordExprFieldFromRaw(e) @@ -2103,6 +2110,22 @@ module Synth { result = convertWildcardPatFromRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a raw DB element to a synthesized `TPathAstNode`, if possible. + */ + TPathAstNode convertPathAstNodeFromRaw(Raw::Element e) { + result = convertPathExprFromRaw(e) + or + result = convertPathPatFromRaw(e) + or + result = convertRecordExprFromRaw(e) + or + result = convertRecordPatFromRaw(e) + or + result = convertTupleStructPatFromRaw(e) + } + /** * INTERNAL: Do not use. * Converts a raw DB element to a synthesized `TPathExprBase`, if possible. @@ -2120,7 +2143,7 @@ module Synth { TResolvable convertResolvableFromRaw(Raw::Element e) { result = convertMethodCallExprFromRaw(e) or - result = convertPathFromRaw(e) + result = convertPathAstNodeFromRaw(e) } /** @@ -3196,6 +3219,8 @@ module Synth { or result = convertPatToRaw(e) or + result = convertPathToRaw(e) + or result = convertPathSegmentToRaw(e) or result = convertRecordExprFieldToRaw(e) @@ -3523,6 +3548,22 @@ module Synth { result = convertWildcardPatToRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TPathAstNode` to a raw DB element, if possible. + */ + Raw::Element convertPathAstNodeToRaw(TPathAstNode e) { + result = convertPathExprToRaw(e) + or + result = convertPathPatToRaw(e) + or + result = convertRecordExprToRaw(e) + or + result = convertRecordPatToRaw(e) + or + result = convertTupleStructPatToRaw(e) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TPathExprBase` to a raw DB element, if possible. @@ -3540,7 +3581,7 @@ module Synth { Raw::Element convertResolvableToRaw(TResolvable e) { result = convertMethodCallExprToRaw(e) or - result = convertPathToRaw(e) + result = convertPathAstNodeToRaw(e) } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/TupleStructPat.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/TupleStructPat.qll index 73cf9a1d9c3..859e8dfe3bb 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/TupleStructPat.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/TupleStructPat.qll @@ -8,7 +8,7 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.Pat import codeql.rust.elements.internal.PatImpl::Impl as PatImpl -import codeql.rust.elements.Path +import codeql.rust.elements.internal.PathAstNodeImpl::Impl as PathAstNodeImpl /** * INTERNAL: This module contains the fully generated definition of `TupleStructPat` and should not @@ -27,7 +27,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::TupleStructPat` class directly. * Use the subclass `TupleStructPat`, where the following predicates are available. */ - class TupleStructPat extends Synth::TTupleStructPat, PatImpl::Pat { + class TupleStructPat extends Synth::TTupleStructPat, PatImpl::Pat, PathAstNodeImpl::PathAstNode { override string getAPrimaryQlClass() { result = "TupleStructPat" } /** @@ -49,20 +49,5 @@ module Generated { * Gets the number of fields of this tuple struct pattern. */ final int getNumberOfFields() { result = count(int i | exists(this.getField(i))) } - - /** - * Gets the path of this tuple struct pattern, if it exists. - */ - Path getPath() { - result = - Synth::convertPathFromRaw(Synth::convertTupleStructPatToRaw(this) - .(Raw::TupleStructPat) - .getPath()) - } - - /** - * Holds if `getPath()` exists. - */ - final predicate hasPath() { exists(this.getPath()) } } } diff --git a/rust/ql/lib/codeql/rust/frameworks/Reqwest.qll b/rust/ql/lib/codeql/rust/frameworks/Reqwest.qll index f46c12feab9..2d3e04f94b3 100644 --- a/rust/ql/lib/codeql/rust/frameworks/Reqwest.qll +++ b/rust/ql/lib/codeql/rust/frameworks/Reqwest.qll @@ -12,9 +12,8 @@ private class ReqwestGet extends RemoteSource::Range { ReqwestGet() { exists(CallExpr ce | this.asExpr().getExpr() = ce and - ce.getFunction().(PathExpr).getPath().getResolvedCrateOrigin().matches("%reqwest") and - ce.getFunction().(PathExpr).getPath().getResolvedPath() = - ["crate::get", "crate::blocking::get"] + ce.getFunction().(PathExpr).getResolvedCrateOrigin().matches("%reqwest") and + ce.getFunction().(PathExpr).getResolvedPath() = ["crate::get", "crate::blocking::get"] ) } } diff --git a/rust/ql/lib/codeql/rust/frameworks/Sqlx.qll b/rust/ql/lib/codeql/rust/frameworks/Sqlx.qll index f00c7375448..5504993ab74 100644 --- a/rust/ql/lib/codeql/rust/frameworks/Sqlx.qll +++ b/rust/ql/lib/codeql/rust/frameworks/Sqlx.qll @@ -14,7 +14,7 @@ private class SqlxQuery extends SqlConstruction::Range { SqlxQuery() { this.asExpr().getExpr() = call and - call.getFunction().(PathExpr).getPath().getResolvedPath() = + call.getFunction().(PathExpr).getResolvedPath() = [ "crate::query::query", "crate::query_as::query_as", "crate::query_with::query_with", "crate::query_as_with::query_as_with", "crate::query_scalar::query_scalar", diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/Env.qll b/rust/ql/lib/codeql/rust/frameworks/stdlib/Env.qll index 3e769ae84d4..8410da77a06 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/Env.qll +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/Env.qll @@ -10,7 +10,7 @@ private import codeql.rust.Concepts */ private class StdEnvArgs extends CommandLineArgsSource::Range { StdEnvArgs() { - this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getPath().getResolvedPath() = + this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getResolvedPath() = ["crate::env::args", "crate::env::args_os"] } } @@ -20,7 +20,7 @@ private class StdEnvArgs extends CommandLineArgsSource::Range { */ private class StdEnvDir extends CommandLineArgsSource::Range { StdEnvDir() { - this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getPath().getResolvedPath() = + this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getResolvedPath() = ["crate::env::current_dir", "crate::env::current_exe", "crate::env::home_dir"] } } @@ -30,7 +30,7 @@ private class StdEnvDir extends CommandLineArgsSource::Range { */ private class StdEnvVar extends EnvironmentSource::Range { StdEnvVar() { - this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getPath().getResolvedPath() = + this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getResolvedPath() = ["crate::env::var", "crate::env::var_os", "crate::env::vars", "crate::env::vars_os"] } } diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index c0f9cf44822..d706df19af4 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -174,6 +174,7 @@ extractor_steps( | @param_base | @param_list | @pat +| @path | @path_segment | @record_expr_field | @record_expr_field_list @@ -660,6 +661,22 @@ param_list_self_params( | @wildcard_pat ; +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_parts( + int id: @path ref, + int part: @path_segment ref +); + path_segments( unique int id: @path_segment ); @@ -834,7 +851,7 @@ rename_names( @resolvable = @method_call_expr -| @path +| @path_ast_node ; #keyset[id] @@ -1976,36 +1993,24 @@ paren_type_repr_type_reprs( int type_repr: @type_repr ref ); -paths( - unique int id: @path -); +@path_ast_node = + @path_expr +| @path_pat +| @record_expr +| @record_pat +| @tuple_struct_pat +; #keyset[id] -path_qualifiers( - int id: @path ref, - int qualifier: @path ref -); - -#keyset[id] -path_parts( - int id: @path ref, - int part: @path_segment ref +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref ); @path_expr_base = @path_expr ; -path_pats( - unique int id: @path_pat -); - -#keyset[id] -path_pat_paths( - int id: @path_pat ref, - int path: @path ref -); - path_type_reprs( unique int id: @path_type_repr ); @@ -2110,22 +2115,6 @@ range_pat_starts( int start: @pat ref ); -record_exprs( - unique int id: @record_expr -); - -#keyset[id] -record_expr_paths( - int id: @record_expr ref, - int path: @path ref -); - -#keyset[id] -record_expr_record_expr_field_lists( - int id: @record_expr ref, - int record_expr_field_list: @record_expr_field_list ref -); - record_field_lists( unique int id: @record_field_list ); @@ -2137,22 +2126,6 @@ record_field_list_fields( int field: @record_field ref ); -record_pats( - unique int id: @record_pat -); - -#keyset[id] -record_pat_paths( - int id: @record_pat ref, - int path: @path ref -); - -#keyset[id] -record_pat_record_pat_field_lists( - int id: @record_pat ref, - int record_pat_field_list: @record_pat_field_list ref -); - ref_exprs( unique int id: @ref_expr ); @@ -2348,23 +2321,6 @@ tuple_pat_fields( int field: @pat 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 -); - -#keyset[id] -tuple_struct_pat_paths( - int id: @tuple_struct_pat ref, - int path: @path ref -); - tuple_type_reprs( unique int id: @tuple_type_repr ); @@ -2999,10 +2955,28 @@ path_expr_attrs( int attr: @attr ref ); +path_pats( + unique int id: @path_pat +); + +record_exprs( + unique int id: @record_expr +); + #keyset[id] -path_expr_paths( - int id: @path_expr ref, - int path: @path ref +record_expr_record_expr_field_lists( + int id: @record_expr ref, + int record_expr_field_list: @record_expr_field_list ref +); + +record_pats( + unique int id: @record_pat +); + +#keyset[id] +record_pat_record_pat_field_lists( + int id: @record_pat ref, + int record_pat_field_list: @record_pat_field_list ref ); statics( @@ -3189,6 +3163,17 @@ trait_alias_where_clauses( 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 ); diff --git a/rust/ql/src/queries/security/CWE-696/BadCtorInitialization.ql b/rust/ql/src/queries/security/CWE-696/BadCtorInitialization.ql index c7a3e0d1cda..221b8e4eb09 100644 --- a/rust/ql/src/queries/security/CWE-696/BadCtorInitialization.ql +++ b/rust/ql/src/queries/security/CWE-696/BadCtorInitialization.ql @@ -32,7 +32,7 @@ class CtorAttr extends Attr { */ class StdCall extends Expr { StdCall() { - this.(CallExpr).getFunction().(PathExpr).getPath().getResolvedCrateOrigin() = "lang:std" or + this.(CallExpr).getFunction().(PathExpr).getResolvedCrateOrigin() = "lang:std" or this.(MethodCallExpr).getResolvedCrateOrigin() = "lang:std" } } diff --git a/rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected b/rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected index 0b973174828..09583dcf9f6 100644 --- a/rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected +++ b/rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected @@ -34,34 +34,15 @@ canonicalPaths | regular.rs:40:1:46:1 | fn enum_qualified_usage | repo::test | crate::regular::enum_qualified_usage | | regular.rs:48:1:55:1 | fn enum_unqualified_usage | repo::test | crate::regular::enum_unqualified_usage | | regular.rs:51:5:51:18 | Use | None | None | +| regular.rs:57:1:63:1 | fn enum_match | repo::test | crate::regular::enum_match | resolvedPaths -| anonymous.rs:1:5:1:9 | super | None | None | -| anonymous.rs:1:5:1:18 | ...::regular | repo::test | crate::regular | -| anonymous.rs:1:5:1:25 | ...::Trait | repo::test | crate::regular::Trait | -| anonymous.rs:10:10:10:19 | OtherTrait | repo::test | {0}::OtherTrait | -| anonymous.rs:10:25:10:35 | OtherStruct | repo::test | {0}::OtherStruct | -| anonymous.rs:14:10:14:19 | OtherTrait | repo::test | {0}::OtherTrait | -| anonymous.rs:14:25:14:29 | crate | None | None | -| anonymous.rs:14:25:14:38 | ...::regular | repo::test | crate::regular | -| anonymous.rs:14:25:14:46 | ...::Struct | repo::test | crate::regular::Struct | -| anonymous.rs:18:10:18:14 | crate | None | None | -| anonymous.rs:18:10:18:23 | ...::regular | repo::test | crate::regular | -| anonymous.rs:18:10:18:30 | ...::Trait | repo::test | crate::regular::Trait | -| anonymous.rs:18:36:18:46 | OtherStruct | repo::test | {0}::OtherStruct | -| anonymous.rs:27:17:27:27 | OtherStruct | repo::test | {0}::OtherStruct | +| anonymous.rs:27:17:27:30 | OtherStruct {...} | repo::test | {0}::OtherStruct | | anonymous.rs:28:9:28:9 | s | None | None | | anonymous.rs:28:9:28:13 | ... .f(...) | repo::test | <{0}::OtherStruct as crate::regular::Trait>::f | | anonymous.rs:29:9:29:9 | s | None | None | | anonymous.rs:29:9:29:13 | ... .g(...) | repo::test | <{0}::OtherStruct as {0}::OtherTrait>::g | | anonymous.rs:30:9:30:14 | nested | repo::test | {0}::nested | -| regular.rs:1:3:1:8 | derive | None | None | -| regular.rs:8:6:8:10 | Trait | repo::test | crate::regular::Trait | -| regular.rs:8:16:8:21 | Struct | repo::test | crate::regular::Struct | -| regular.rs:12:6:12:11 | Struct | repo::test | crate::regular::Struct | -| regular.rs:20:9:20:10 | Eq | lang:core | crate::cmp::Eq | -| regular.rs:20:13:20:32 | TraitWithBlanketImpl | repo::test | crate::regular::TraitWithBlanketImpl | -| regular.rs:20:38:20:38 | T | None | None | -| regular.rs:27:13:27:18 | Struct | repo::test | crate::regular::Struct | +| regular.rs:27:13:27:21 | Struct {...} | repo::test | crate::regular::Struct | | regular.rs:28:5:28:5 | s | None | None | | regular.rs:28:5:28:9 | ... .f(...) | repo::test | ::f | | regular.rs:29:5:29:5 | s | None | None | @@ -69,21 +50,17 @@ resolvedPaths | regular.rs:30:5:30:5 | s | None | None | | regular.rs:30:5:30:9 | ... .h(...) | repo::test | <_ as crate::regular::TraitWithBlanketImpl>::h | | regular.rs:31:5:31:8 | free | repo::test | crate::regular::free | -| regular.rs:36:14:36:18 | usize | None | None | -| regular.rs:37:19:37:23 | usize | None | None | -| regular.rs:41:9:41:14 | Option | lang:core | crate::option::Option | | regular.rs:41:9:41:26 | ...::None::<...> | lang:core | crate::option::Option::None | -| regular.rs:42:9:42:14 | Option | lang:core | crate::option::Option | | regular.rs:42:9:42:20 | ...::Some | lang:core | crate::option::Option::Some | -| regular.rs:43:9:43:14 | MyEnum | repo::test | crate::regular::MyEnum | | regular.rs:43:9:43:24 | ...::Variant1 | repo::test | crate::regular::MyEnum::Variant1 | -| regular.rs:44:9:44:14 | MyEnum | repo::test | crate::regular::MyEnum | | regular.rs:44:9:44:24 | ...::Variant2 | repo::test | crate::regular::MyEnum::Variant2 | -| regular.rs:45:9:45:14 | MyEnum | repo::test | crate::regular::MyEnum | -| regular.rs:45:9:45:24 | ...::Variant3 | repo::test | crate::regular::MyEnum::Variant3 | +| regular.rs:45:9:45:33 | ...::Variant3 {...} | repo::test | crate::regular::MyEnum::Variant3 | | regular.rs:49:9:49:18 | None::<...> | lang:core | crate::option::Option::None | | regular.rs:50:9:50:12 | Some | lang:core | crate::option::Option::Some | -| regular.rs:51:9:51:14 | MyEnum | repo::test | crate::regular::MyEnum | | regular.rs:52:9:52:16 | Variant1 | repo::test | crate::regular::MyEnum::Variant1 | | regular.rs:53:9:53:16 | Variant2 | repo::test | crate::regular::MyEnum::Variant2 | -| regular.rs:54:9:54:16 | Variant3 | repo::test | crate::regular::MyEnum::Variant3 | +| regular.rs:54:9:54:25 | Variant3 {...} | repo::test | crate::regular::MyEnum::Variant3 | +| regular.rs:58:11:58:11 | e | None | None | +| regular.rs:59:9:59:24 | ...::Variant1 | repo::test | crate::regular::MyEnum::Variant1 | +| regular.rs:60:9:60:27 | ...::Variant2(...) | repo::test | crate::regular::MyEnum::Variant2 | +| regular.rs:61:9:61:31 | ...::Variant3 {...} | repo::test | crate::regular::MyEnum::Variant3 | diff --git a/rust/ql/test/extractor-tests/canonical_path/regular.rs b/rust/ql/test/extractor-tests/canonical_path/regular.rs index ac06a12d24a..82b0525489f 100644 --- a/rust/ql/test/extractor-tests/canonical_path/regular.rs +++ b/rust/ql/test/extractor-tests/canonical_path/regular.rs @@ -53,3 +53,11 @@ fn enum_unqualified_usage() { _ = Variant2(0); _ = Variant3 { x: 1 }; } + +fn enum_match(e: MyEnum) { + match e { + MyEnum::Variant1 => {} + MyEnum::Variant2(_) => {} + MyEnum::Variant3 { .. } => {} + } +} diff --git a/rust/ql/test/extractor-tests/generated/Path/Path.expected b/rust/ql/test/extractor-tests/generated/Path/Path.expected index 7159a6d1f4e..1d7194e4200 100644 --- a/rust/ql/test/extractor-tests/generated/Path/Path.expected +++ b/rust/ql/test/extractor-tests/generated/Path/Path.expected @@ -1,26 +1,26 @@ -| gen_path.rs:5:9:5:18 | some_crate | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path.rs:5:9:5:31 | ...::some_module | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | yes | hasPart: | yes | -| gen_path.rs:5:9:5:42 | ...::some_item | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | yes | hasPart: | yes | -| gen_path.rs:6:5:6:7 | foo | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path.rs:6:5:6:12 | ...::bar | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | yes | hasPart: | yes | -| gen_path_expr.rs:5:13:5:20 | variable | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_expr.rs:6:13:6:15 | foo | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_expr.rs:6:13:6:20 | ...::bar | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | yes | hasPart: | yes | -| gen_path_expr.rs:7:13:7:15 | <...> | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_expr.rs:7:13:7:20 | ...::foo | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | yes | hasPart: | yes | -| gen_path_expr.rs:7:14:7:14 | T | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_expr.rs:7:14:7:14 | T | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_expr.rs:8:13:8:31 | <...> | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_expr.rs:8:13:8:36 | ...::foo | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | yes | hasPart: | yes | -| gen_path_expr.rs:8:14:8:21 | TypeRepr | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_expr.rs:8:14:8:21 | TypeRepr | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_pat.rs:5:11:5:11 | x | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_pat.rs:6:9:6:11 | Foo | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_pat.rs:6:9:6:16 | ...::Bar | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | yes | hasPart: | yes | -| gen_path_type_repr.rs:5:14:5:16 | std | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_type_repr.rs:5:14:5:29 | ...::collections | hasResolvedPath: | yes | hasResolvedCrateOrigin: | yes | hasQualifier: | yes | hasPart: | yes | -| gen_path_type_repr.rs:5:14:5:48 | ...::HashMap::<...> | hasResolvedPath: | yes | hasResolvedCrateOrigin: | yes | hasQualifier: | yes | hasPart: | yes | -| gen_path_type_repr.rs:5:40:5:42 | i32 | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_type_repr.rs:5:45:5:47 | i32 | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_type_repr.rs:6:14:6:14 | X | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | no | hasPart: | yes | -| gen_path_type_repr.rs:6:14:6:20 | ...::Item | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasQualifier: | yes | hasPart: | yes | +| gen_path.rs:5:9:5:18 | some_crate | hasQualifier: | no | hasPart: | yes | +| gen_path.rs:5:9:5:31 | ...::some_module | hasQualifier: | yes | hasPart: | yes | +| gen_path.rs:5:9:5:42 | ...::some_item | hasQualifier: | yes | hasPart: | yes | +| gen_path.rs:6:5:6:7 | foo | hasQualifier: | no | hasPart: | yes | +| gen_path.rs:6:5:6:12 | ...::bar | hasQualifier: | yes | hasPart: | yes | +| gen_path_expr.rs:5:13:5:20 | variable | hasQualifier: | no | hasPart: | yes | +| gen_path_expr.rs:6:13:6:15 | foo | hasQualifier: | no | hasPart: | yes | +| gen_path_expr.rs:6:13:6:20 | ...::bar | hasQualifier: | yes | hasPart: | yes | +| gen_path_expr.rs:7:13:7:15 | <...> | hasQualifier: | no | hasPart: | yes | +| gen_path_expr.rs:7:13:7:20 | ...::foo | hasQualifier: | yes | hasPart: | yes | +| gen_path_expr.rs:7:14:7:14 | T | hasQualifier: | no | hasPart: | yes | +| gen_path_expr.rs:7:14:7:14 | T | hasQualifier: | no | hasPart: | yes | +| gen_path_expr.rs:8:13:8:31 | <...> | hasQualifier: | no | hasPart: | yes | +| gen_path_expr.rs:8:13:8:36 | ...::foo | hasQualifier: | yes | hasPart: | yes | +| gen_path_expr.rs:8:14:8:21 | TypeRepr | hasQualifier: | no | hasPart: | yes | +| gen_path_expr.rs:8:14:8:21 | TypeRepr | hasQualifier: | no | hasPart: | yes | +| gen_path_pat.rs:5:11:5:11 | x | hasQualifier: | no | hasPart: | yes | +| gen_path_pat.rs:6:9:6:11 | Foo | hasQualifier: | no | hasPart: | yes | +| gen_path_pat.rs:6:9:6:16 | ...::Bar | hasQualifier: | yes | hasPart: | yes | +| gen_path_type_repr.rs:5:14:5:16 | std | hasQualifier: | no | hasPart: | yes | +| gen_path_type_repr.rs:5:14:5:29 | ...::collections | hasQualifier: | yes | hasPart: | yes | +| gen_path_type_repr.rs:5:14:5:48 | ...::HashMap::<...> | hasQualifier: | yes | hasPart: | yes | +| gen_path_type_repr.rs:5:40:5:42 | i32 | hasQualifier: | no | hasPart: | yes | +| gen_path_type_repr.rs:5:45:5:47 | i32 | hasQualifier: | no | hasPart: | yes | +| gen_path_type_repr.rs:6:14:6:14 | X | hasQualifier: | no | hasPart: | yes | +| gen_path_type_repr.rs:6:14:6:20 | ...::Item | hasQualifier: | yes | hasPart: | yes | diff --git a/rust/ql/test/extractor-tests/generated/Path/Path.ql b/rust/ql/test/extractor-tests/generated/Path/Path.ql index d84c2d86987..c5e1ba9d78a 100644 --- a/rust/ql/test/extractor-tests/generated/Path/Path.ql +++ b/rust/ql/test/extractor-tests/generated/Path/Path.ql @@ -2,18 +2,10 @@ import codeql.rust.elements import TestUtils -from - Path x, string hasResolvedPath, string hasResolvedCrateOrigin, string hasQualifier, string hasPart +from Path x, string hasQualifier, string hasPart where toBeTested(x) and not x.isUnknown() and - (if x.hasResolvedPath() then hasResolvedPath = "yes" else hasResolvedPath = "no") and - ( - if x.hasResolvedCrateOrigin() - then hasResolvedCrateOrigin = "yes" - else hasResolvedCrateOrigin = "no" - ) and (if x.hasQualifier() then hasQualifier = "yes" else hasQualifier = "no") and if x.hasPart() then hasPart = "yes" else hasPart = "no" -select x, "hasResolvedPath:", hasResolvedPath, "hasResolvedCrateOrigin:", hasResolvedCrateOrigin, - "hasQualifier:", hasQualifier, "hasPart:", hasPart +select x, "hasQualifier:", hasQualifier, "hasPart:", hasPart diff --git a/rust/ql/test/extractor-tests/generated/Path/PathExpr.expected b/rust/ql/test/extractor-tests/generated/Path/PathExpr.expected index 4cfbc41c3c2..25bc95ed055 100644 --- a/rust/ql/test/extractor-tests/generated/Path/PathExpr.expected +++ b/rust/ql/test/extractor-tests/generated/Path/PathExpr.expected @@ -1,6 +1,6 @@ -| gen_path.rs:6:5:6:12 | ...::bar | getNumberOfAttrs: | 0 | hasPath: | yes | -| gen_path_expr.rs:5:13:5:20 | variable | getNumberOfAttrs: | 0 | hasPath: | yes | -| gen_path_expr.rs:6:13:6:20 | ...::bar | getNumberOfAttrs: | 0 | hasPath: | yes | -| gen_path_expr.rs:7:13:7:20 | ...::foo | getNumberOfAttrs: | 0 | hasPath: | yes | -| gen_path_expr.rs:8:13:8:36 | ...::foo | getNumberOfAttrs: | 0 | hasPath: | yes | -| gen_path_pat.rs:5:11:5:11 | x | getNumberOfAttrs: | 0 | hasPath: | yes | +| gen_path.rs:6:5:6:12 | ...::bar | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | getNumberOfAttrs: | 0 | +| gen_path_expr.rs:5:13:5:20 | variable | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | getNumberOfAttrs: | 0 | +| gen_path_expr.rs:6:13:6:20 | ...::bar | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | getNumberOfAttrs: | 0 | +| gen_path_expr.rs:7:13:7:20 | ...::foo | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | getNumberOfAttrs: | 0 | +| gen_path_expr.rs:8:13:8:36 | ...::foo | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | getNumberOfAttrs: | 0 | +| gen_path_pat.rs:5:11:5:11 | x | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | getNumberOfAttrs: | 0 | diff --git a/rust/ql/test/extractor-tests/generated/Path/PathExpr.ql b/rust/ql/test/extractor-tests/generated/Path/PathExpr.ql index 4d472add336..41b7414d24c 100644 --- a/rust/ql/test/extractor-tests/generated/Path/PathExpr.ql +++ b/rust/ql/test/extractor-tests/generated/Path/PathExpr.ql @@ -2,10 +2,19 @@ import codeql.rust.elements import TestUtils -from PathExpr x, int getNumberOfAttrs, string hasPath +from + PathExpr x, string hasResolvedPath, string hasResolvedCrateOrigin, string hasPath, + int getNumberOfAttrs where toBeTested(x) and not x.isUnknown() and - getNumberOfAttrs = x.getNumberOfAttrs() and - if x.hasPath() then hasPath = "yes" else hasPath = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasPath:", hasPath + (if x.hasResolvedPath() then hasResolvedPath = "yes" else hasResolvedPath = "no") and + ( + if x.hasResolvedCrateOrigin() + then hasResolvedCrateOrigin = "yes" + else hasResolvedCrateOrigin = "no" + ) and + (if x.hasPath() then hasPath = "yes" else hasPath = "no") and + getNumberOfAttrs = x.getNumberOfAttrs() +select x, "hasResolvedPath:", hasResolvedPath, "hasResolvedCrateOrigin:", hasResolvedCrateOrigin, + "hasPath:", hasPath, "getNumberOfAttrs:", getNumberOfAttrs diff --git a/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedCrateOrigin.expected b/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedCrateOrigin.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedCrateOrigin.ql b/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedCrateOrigin.ql new file mode 100644 index 00000000000..24e07918484 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedCrateOrigin.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from PathExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getResolvedCrateOrigin() diff --git a/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedPath.expected b/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedPath.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedPath.ql b/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedPath.ql new file mode 100644 index 00000000000..10e6ceb2a0b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Path/PathExpr_getResolvedPath.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from PathExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getResolvedPath() diff --git a/rust/ql/test/extractor-tests/generated/Path/PathPat.expected b/rust/ql/test/extractor-tests/generated/Path/PathPat.expected index 159f006eecb..cf90175a84c 100644 --- a/rust/ql/test/extractor-tests/generated/Path/PathPat.expected +++ b/rust/ql/test/extractor-tests/generated/Path/PathPat.expected @@ -1 +1 @@ -| gen_path_pat.rs:6:9:6:16 | ...::Bar | hasPath: | yes | +| gen_path_pat.rs:6:9:6:16 | ...::Bar | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | diff --git a/rust/ql/test/extractor-tests/generated/Path/PathPat.ql b/rust/ql/test/extractor-tests/generated/Path/PathPat.ql index 3e6cce8f151..a105c20c39e 100644 --- a/rust/ql/test/extractor-tests/generated/Path/PathPat.ql +++ b/rust/ql/test/extractor-tests/generated/Path/PathPat.ql @@ -2,9 +2,16 @@ import codeql.rust.elements import TestUtils -from PathPat x, string hasPath +from PathPat x, string hasResolvedPath, string hasResolvedCrateOrigin, string hasPath where toBeTested(x) and not x.isUnknown() and + (if x.hasResolvedPath() then hasResolvedPath = "yes" else hasResolvedPath = "no") and + ( + if x.hasResolvedCrateOrigin() + then hasResolvedCrateOrigin = "yes" + else hasResolvedCrateOrigin = "no" + ) and if x.hasPath() then hasPath = "yes" else hasPath = "no" -select x, "hasPath:", hasPath +select x, "hasResolvedPath:", hasResolvedPath, "hasResolvedCrateOrigin:", hasResolvedCrateOrigin, + "hasPath:", hasPath diff --git a/rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedCrateOrigin.expected b/rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedCrateOrigin.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedCrateOrigin.ql b/rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedCrateOrigin.ql similarity index 91% rename from rust/ql/test/extractor-tests/generated/Path/Path_getResolvedCrateOrigin.ql rename to rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedCrateOrigin.ql index c998981364f..7ed41155d77 100644 --- a/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedCrateOrigin.ql +++ b/rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedCrateOrigin.ql @@ -2,6 +2,6 @@ import codeql.rust.elements import TestUtils -from Path x +from PathPat x where toBeTested(x) and not x.isUnknown() select x, x.getResolvedCrateOrigin() diff --git a/rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedPath.expected b/rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedPath.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedPath.ql b/rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedPath.ql similarity index 91% rename from rust/ql/test/extractor-tests/generated/Path/Path_getResolvedPath.ql rename to rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedPath.ql index c8969309836..cbe1932925a 100644 --- a/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedPath.ql +++ b/rust/ql/test/extractor-tests/generated/Path/PathPat_getResolvedPath.ql @@ -2,6 +2,6 @@ import codeql.rust.elements import TestUtils -from Path x +from PathPat x where toBeTested(x) and not x.isUnknown() select x, x.getResolvedPath() diff --git a/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedCrateOrigin.expected b/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedCrateOrigin.expected deleted file mode 100644 index 3f821b1e080..00000000000 --- a/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedCrateOrigin.expected +++ /dev/null @@ -1,2 +0,0 @@ -| gen_path_type_repr.rs:5:14:5:29 | ...::collections | lang:std | -| gen_path_type_repr.rs:5:14:5:48 | ...::HashMap::<...> | lang:std | diff --git a/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedPath.expected b/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedPath.expected deleted file mode 100644 index 574e8ffb215..00000000000 --- a/rust/ql/test/extractor-tests/generated/Path/Path_getResolvedPath.expected +++ /dev/null @@ -1,2 +0,0 @@ -| gen_path_type_repr.rs:5:14:5:29 | ...::collections | crate::collections | -| gen_path_type_repr.rs:5:14:5:48 | ...::HashMap::<...> | crate::collections::hash::map::HashMap | diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.expected b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.expected index 445b906bf88..90cc595d61e 100644 --- a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.expected +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.expected @@ -1,4 +1,4 @@ -| gen_record_expr.rs:5:17:5:34 | Foo {...} | hasPath: | yes | hasRecordExprFieldList: | yes | -| gen_record_expr.rs:6:18:6:38 | Foo {...} | hasPath: | yes | hasRecordExprFieldList: | yes | -| gen_record_expr.rs:7:5:7:22 | Foo {...} | hasPath: | yes | hasRecordExprFieldList: | yes | -| gen_record_expr.rs:8:5:8:14 | Foo {...} | hasPath: | yes | hasRecordExprFieldList: | yes | +| gen_record_expr.rs:5:17:5:34 | Foo {...} | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | hasRecordExprFieldList: | yes | +| gen_record_expr.rs:6:18:6:38 | Foo {...} | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | hasRecordExprFieldList: | yes | +| gen_record_expr.rs:7:5:7:22 | Foo {...} | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | hasRecordExprFieldList: | yes | +| gen_record_expr.rs:8:5:8:14 | Foo {...} | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | hasRecordExprFieldList: | yes | diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.ql b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.ql index 41cd6a41c4b..56c14f27dfd 100644 --- a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.ql +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.ql @@ -2,12 +2,21 @@ import codeql.rust.elements import TestUtils -from RecordExpr x, string hasPath, string hasRecordExprFieldList +from + RecordExpr x, string hasResolvedPath, string hasResolvedCrateOrigin, string hasPath, + string hasRecordExprFieldList where toBeTested(x) and not x.isUnknown() and + (if x.hasResolvedPath() then hasResolvedPath = "yes" else hasResolvedPath = "no") and + ( + if x.hasResolvedCrateOrigin() + then hasResolvedCrateOrigin = "yes" + else hasResolvedCrateOrigin = "no" + ) and (if x.hasPath() then hasPath = "yes" else hasPath = "no") and if x.hasRecordExprFieldList() then hasRecordExprFieldList = "yes" else hasRecordExprFieldList = "no" -select x, "hasPath:", hasPath, "hasRecordExprFieldList:", hasRecordExprFieldList +select x, "hasResolvedPath:", hasResolvedPath, "hasResolvedCrateOrigin:", hasResolvedCrateOrigin, + "hasPath:", hasPath, "hasRecordExprFieldList:", hasRecordExprFieldList diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedCrateOrigin.expected b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedCrateOrigin.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedCrateOrigin.ql b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedCrateOrigin.ql new file mode 100644 index 00000000000..25635cb050f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedCrateOrigin.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from RecordExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getResolvedCrateOrigin() diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedPath.expected b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedPath.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedPath.ql b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedPath.ql new file mode 100644 index 00000000000..0f3230f3314 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getResolvedPath.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from RecordExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getResolvedPath() diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.expected b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.expected index 8d7f96229ad..9b996be2368 100644 --- a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.expected +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.expected @@ -1,2 +1,2 @@ -| gen_record_pat.rs:6:9:6:26 | Foo {...} | hasPath: | yes | hasRecordPatFieldList: | yes | -| gen_record_pat.rs:7:9:7:18 | Foo {...} | hasPath: | yes | hasRecordPatFieldList: | yes | +| gen_record_pat.rs:6:9:6:26 | Foo {...} | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | hasRecordPatFieldList: | yes | +| gen_record_pat.rs:7:9:7:18 | Foo {...} | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | hasRecordPatFieldList: | yes | diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.ql b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.ql index 19bc5ea6e3a..3b079777306 100644 --- a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.ql +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.ql @@ -2,10 +2,19 @@ import codeql.rust.elements import TestUtils -from RecordPat x, string hasPath, string hasRecordPatFieldList +from + RecordPat x, string hasResolvedPath, string hasResolvedCrateOrigin, string hasPath, + string hasRecordPatFieldList where toBeTested(x) and not x.isUnknown() and + (if x.hasResolvedPath() then hasResolvedPath = "yes" else hasResolvedPath = "no") and + ( + if x.hasResolvedCrateOrigin() + then hasResolvedCrateOrigin = "yes" + else hasResolvedCrateOrigin = "no" + ) and (if x.hasPath() then hasPath = "yes" else hasPath = "no") and if x.hasRecordPatFieldList() then hasRecordPatFieldList = "yes" else hasRecordPatFieldList = "no" -select x, "hasPath:", hasPath, "hasRecordPatFieldList:", hasRecordPatFieldList +select x, "hasResolvedPath:", hasResolvedPath, "hasResolvedCrateOrigin:", hasResolvedCrateOrigin, + "hasPath:", hasPath, "hasRecordPatFieldList:", hasRecordPatFieldList diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedCrateOrigin.expected b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedCrateOrigin.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedCrateOrigin.ql b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedCrateOrigin.ql new file mode 100644 index 00000000000..f80865d0515 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedCrateOrigin.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from RecordPat x +where toBeTested(x) and not x.isUnknown() +select x, x.getResolvedCrateOrigin() diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedPath.expected b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedPath.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedPath.ql b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedPath.ql new file mode 100644 index 00000000000..a816942e47b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getResolvedPath.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from RecordPat x +where toBeTested(x) and not x.isUnknown() +select x, x.getResolvedPath() diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.expected b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.expected index 78a0609f3b7..9e9de534b1e 100644 --- a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.expected +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.expected @@ -1,3 +1,3 @@ -| gen_tuple_struct_pat.rs:6:9:6:27 | Tuple(...) | getNumberOfFields: | 4 | hasPath: | yes | -| gen_tuple_struct_pat.rs:7:9:7:20 | Tuple(...) | getNumberOfFields: | 2 | hasPath: | yes | -| gen_tuple_struct_pat.rs:8:9:8:17 | Tuple(...) | getNumberOfFields: | 1 | hasPath: | yes | +| gen_tuple_struct_pat.rs:6:9:6:27 | Tuple(...) | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | getNumberOfFields: | 4 | +| gen_tuple_struct_pat.rs:7:9:7:20 | Tuple(...) | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | getNumberOfFields: | 2 | +| gen_tuple_struct_pat.rs:8:9:8:17 | Tuple(...) | hasResolvedPath: | no | hasResolvedCrateOrigin: | no | hasPath: | yes | getNumberOfFields: | 1 | diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql index d12f3427df5..af59101fe75 100644 --- a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql @@ -2,10 +2,19 @@ import codeql.rust.elements import TestUtils -from TupleStructPat x, int getNumberOfFields, string hasPath +from + TupleStructPat x, string hasResolvedPath, string hasResolvedCrateOrigin, string hasPath, + int getNumberOfFields where toBeTested(x) and not x.isUnknown() and - getNumberOfFields = x.getNumberOfFields() and - if x.hasPath() then hasPath = "yes" else hasPath = "no" -select x, "getNumberOfFields:", getNumberOfFields, "hasPath:", hasPath + (if x.hasResolvedPath() then hasResolvedPath = "yes" else hasResolvedPath = "no") and + ( + if x.hasResolvedCrateOrigin() + then hasResolvedCrateOrigin = "yes" + else hasResolvedCrateOrigin = "no" + ) and + (if x.hasPath() then hasPath = "yes" else hasPath = "no") and + getNumberOfFields = x.getNumberOfFields() +select x, "hasResolvedPath:", hasResolvedPath, "hasResolvedCrateOrigin:", hasResolvedCrateOrigin, + "hasPath:", hasPath, "getNumberOfFields:", getNumberOfFields diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedCrateOrigin.expected b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedCrateOrigin.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedCrateOrigin.ql b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedCrateOrigin.ql new file mode 100644 index 00000000000..144302946a9 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedCrateOrigin.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from TupleStructPat x +where toBeTested(x) and not x.isUnknown() +select x, x.getResolvedCrateOrigin() diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedPath.expected b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedPath.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedPath.ql b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedPath.ql new file mode 100644 index 00000000000..561c303d968 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getResolvedPath.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from TupleStructPat x +where toBeTested(x) and not x.isUnknown() +select x, x.getResolvedPath() diff --git a/rust/ql/test/library-tests/dataflow/sources/InlineFlow.ql b/rust/ql/test/library-tests/dataflow/sources/InlineFlow.ql index 2b08aeea63f..5bcbe05229b 100644 --- a/rust/ql/test/library-tests/dataflow/sources/InlineFlow.ql +++ b/rust/ql/test/library-tests/dataflow/sources/InlineFlow.ql @@ -10,9 +10,9 @@ module MyFlowConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { source instanceof ThreatModelSource } predicate isSink(DataFlow::Node sink) { - any(CallExpr call | - call.getFunction().(PathExpr).getPath().getResolvedPath() = "crate::test::sink" - ).getArgList().getAnArg() = sink.asExpr().getExpr() + any(CallExpr call | call.getFunction().(PathExpr).getResolvedPath() = "crate::test::sink") + .getArgList() + .getAnArg() = sink.asExpr().getExpr() } } diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index 025b0f566ba..33a83787104 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -76,7 +76,7 @@ class _: ``` """ -@annotate(Path, replace_bases={AstNode: Resolvable}) +@annotate(Path) class _: """ A path. For example: @@ -120,7 +120,7 @@ class PathExprBase(Expr): """ -@annotate(PathExpr, replace_bases={Expr: PathExprBase}, cfg = True) +@annotate(PathExpr, replace_bases={Expr: PathExprBase}, add_bases=(PathAstNode,), cfg = True) @qltest.test_with(Path) class _: """ @@ -132,6 +132,7 @@ class _: let z = ::foo; ``` """ + path: drop @annotate(IfExpr, cfg = True) @@ -412,7 +413,7 @@ class _: """ -@annotate(RecordExpr, cfg = True) +@annotate(RecordExpr, add_bases=(PathAstNode,), cfg = True) class _: """ A record expression. For example: @@ -423,6 +424,7 @@ class _: Foo { .. } = second; ``` """ + path: drop @annotate(FieldExpr, cfg = True) @@ -712,7 +714,7 @@ class _: """ -@annotate(RecordPat, cfg = True) +@annotate(RecordPat, add_bases=(PathAstNode,), cfg = True) class _: """ A record pattern. For example: @@ -723,6 +725,7 @@ class _: } ``` """ + path: drop @annotate(RangePat, cfg = True) @@ -753,7 +756,7 @@ class _: """ -@annotate(PathPat, cfg = True) +@annotate(PathPat, add_bases=(PathAstNode,), cfg = True) @qltest.test_with(Path) class _: """ @@ -765,6 +768,7 @@ class _: } ``` """ + path: drop @annotate(LiteralPat, cfg = True) @@ -799,7 +803,7 @@ class _: """ -@annotate(TupleStructPat, cfg = True) +@annotate(TupleStructPat, add_bases=(PathAstNode,), cfg = True) class _: """ A tuple struct pattern. For example: @@ -811,6 +815,7 @@ class _: }; ``` """ + path: drop @annotate(RefPat, cfg = True) diff --git a/rust/schema/prelude.py b/rust/schema/prelude.py index 5b050872609..ec67d7357ab 100644 --- a/rust/schema/prelude.py +++ b/rust/schema/prelude.py @@ -90,12 +90,19 @@ class Addressable(AstNode): class Resolvable(AstNode): """ - Either a `Path`, or a `MethodCallExpr`. + One of `PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat` or `MethodCallExpr`. """ resolved_path: optional[string] | rust.detach | ql.internal resolved_crate_origin: optional[string] | rust.detach | ql.internal +class PathAstNode(Resolvable): + """ + An AST element wrapping a path (`PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat`). + """ + path: optional["Path"] | child + + @qltest.skip @ql.internal class ExtractorStep(Element): diff --git a/shared/controlflow/CHANGELOG.md b/shared/controlflow/CHANGELOG.md index b6de6379e77..285b39a4359 100644 --- a/shared/controlflow/CHANGELOG.md +++ b/shared/controlflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/controlflow/change-notes/released/1.0.13.md b/shared/controlflow/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/controlflow/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/controlflow/codeql-pack.release.yml b/shared/controlflow/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/controlflow/codeql-pack.release.yml +++ b/shared/controlflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/controlflow/qlpack.yml b/shared/controlflow/qlpack.yml index da4368217d3..268f142bd1b 100644 --- a/shared/controlflow/qlpack.yml +++ b/shared/controlflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/controlflow -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true dependencies: diff --git a/shared/dataflow/CHANGELOG.md b/shared/dataflow/CHANGELOG.md index 7eec34670dc..df038524d2d 100644 --- a/shared/dataflow/CHANGELOG.md +++ b/shared/dataflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.7 + +No user-facing changes. + ## 1.1.6 No user-facing changes. diff --git a/shared/dataflow/change-notes/released/1.1.7.md b/shared/dataflow/change-notes/released/1.1.7.md new file mode 100644 index 00000000000..81505c0507a --- /dev/null +++ b/shared/dataflow/change-notes/released/1.1.7.md @@ -0,0 +1,3 @@ +## 1.1.7 + +No user-facing changes. diff --git a/shared/dataflow/codeql-pack.release.yml b/shared/dataflow/codeql-pack.release.yml index 9e712a00a21..75910556516 100644 --- a/shared/dataflow/codeql-pack.release.yml +++ b/shared/dataflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.6 +lastReleaseVersion: 1.1.7 diff --git a/shared/dataflow/qlpack.yml b/shared/dataflow/qlpack.yml index 15f77aa0a3a..6a8e8c3a4ae 100644 --- a/shared/dataflow/qlpack.yml +++ b/shared/dataflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/dataflow -version: 1.1.7-dev +version: 1.1.8-dev groups: shared library: true dependencies: diff --git a/shared/mad/CHANGELOG.md b/shared/mad/CHANGELOG.md index 8eb5e03400a..93a528a4f3c 100644 --- a/shared/mad/CHANGELOG.md +++ b/shared/mad/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/mad/change-notes/released/1.0.13.md b/shared/mad/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/mad/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/mad/codeql-pack.release.yml b/shared/mad/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/mad/codeql-pack.release.yml +++ b/shared/mad/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/mad/qlpack.yml b/shared/mad/qlpack.yml index 8ce60ad0cc9..125bcad622d 100644 --- a/shared/mad/qlpack.yml +++ b/shared/mad/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/mad -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true dependencies: diff --git a/shared/rangeanalysis/CHANGELOG.md b/shared/rangeanalysis/CHANGELOG.md index cedd38e3e30..6b25d16e0f7 100644 --- a/shared/rangeanalysis/CHANGELOG.md +++ b/shared/rangeanalysis/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/rangeanalysis/change-notes/released/1.0.13.md b/shared/rangeanalysis/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/rangeanalysis/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/rangeanalysis/codeql-pack.release.yml b/shared/rangeanalysis/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/rangeanalysis/codeql-pack.release.yml +++ b/shared/rangeanalysis/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/rangeanalysis/qlpack.yml b/shared/rangeanalysis/qlpack.yml index ee5954cae0b..62c8c1e46b6 100644 --- a/shared/rangeanalysis/qlpack.yml +++ b/shared/rangeanalysis/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rangeanalysis -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true dependencies: diff --git a/shared/regex/CHANGELOG.md b/shared/regex/CHANGELOG.md index 3e8a99103fe..54c3ed2b307 100644 --- a/shared/regex/CHANGELOG.md +++ b/shared/regex/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/regex/change-notes/released/1.0.13.md b/shared/regex/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/regex/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/regex/codeql-pack.release.yml b/shared/regex/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/regex/codeql-pack.release.yml +++ b/shared/regex/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/regex/qlpack.yml b/shared/regex/qlpack.yml index 34aa1065398..e2cda264dc8 100644 --- a/shared/regex/qlpack.yml +++ b/shared/regex/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/regex -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true dependencies: diff --git a/shared/ssa/CHANGELOG.md b/shared/ssa/CHANGELOG.md index b98345f361c..01c19388c92 100644 --- a/shared/ssa/CHANGELOG.md +++ b/shared/ssa/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/ssa/change-notes/released/1.0.13.md b/shared/ssa/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/ssa/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/ssa/codeql-pack.release.yml b/shared/ssa/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/ssa/codeql-pack.release.yml +++ b/shared/ssa/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/ssa/qlpack.yml b/shared/ssa/qlpack.yml index 145cd9e2192..b146ce5bc91 100644 --- a/shared/ssa/qlpack.yml +++ b/shared/ssa/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ssa -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true dependencies: diff --git a/shared/threat-models/CHANGELOG.md b/shared/threat-models/CHANGELOG.md index eeb6b0a262a..3c6fa155a32 100644 --- a/shared/threat-models/CHANGELOG.md +++ b/shared/threat-models/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/threat-models/change-notes/released/1.0.13.md b/shared/threat-models/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/threat-models/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/threat-models/codeql-pack.release.yml b/shared/threat-models/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/threat-models/codeql-pack.release.yml +++ b/shared/threat-models/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/threat-models/qlpack.yml b/shared/threat-models/qlpack.yml index 16ca1fe3a88..6ec41bbcc04 100644 --- a/shared/threat-models/qlpack.yml +++ b/shared/threat-models/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/threat-models -version: 1.0.13-dev +version: 1.0.14-dev library: true groups: shared dataExtensions: diff --git a/shared/tutorial/CHANGELOG.md b/shared/tutorial/CHANGELOG.md index da467b3de30..1f4e7ad4ed3 100644 --- a/shared/tutorial/CHANGELOG.md +++ b/shared/tutorial/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/tutorial/change-notes/released/1.0.13.md b/shared/tutorial/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/tutorial/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/tutorial/codeql-pack.release.yml b/shared/tutorial/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/tutorial/codeql-pack.release.yml +++ b/shared/tutorial/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/tutorial/qlpack.yml b/shared/tutorial/qlpack.yml index 14cbbbdc067..6677c74eed4 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.13-dev +version: 1.0.14-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/typeflow/CHANGELOG.md b/shared/typeflow/CHANGELOG.md index cae361ea7e7..dd8fb7a60b2 100644 --- a/shared/typeflow/CHANGELOG.md +++ b/shared/typeflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/typeflow/change-notes/released/1.0.13.md b/shared/typeflow/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/typeflow/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/typeflow/codeql-pack.release.yml b/shared/typeflow/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/typeflow/codeql-pack.release.yml +++ b/shared/typeflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/typeflow/qlpack.yml b/shared/typeflow/qlpack.yml index 5a659a4559d..cd9e70bba8c 100644 --- a/shared/typeflow/qlpack.yml +++ b/shared/typeflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeflow -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true dependencies: diff --git a/shared/typetracking/CHANGELOG.md b/shared/typetracking/CHANGELOG.md index 96110cb10a2..0ab05873af4 100644 --- a/shared/typetracking/CHANGELOG.md +++ b/shared/typetracking/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/typetracking/change-notes/released/1.0.13.md b/shared/typetracking/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/typetracking/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/typetracking/codeql-pack.release.yml b/shared/typetracking/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/typetracking/codeql-pack.release.yml +++ b/shared/typetracking/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/typetracking/qlpack.yml b/shared/typetracking/qlpack.yml index 216cc8696d9..fbe63f0da01 100644 --- a/shared/typetracking/qlpack.yml +++ b/shared/typetracking/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typetracking -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true dependencies: diff --git a/shared/typos/CHANGELOG.md b/shared/typos/CHANGELOG.md index 83fb2dfb4cc..c0c3cea3948 100644 --- a/shared/typos/CHANGELOG.md +++ b/shared/typos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/typos/change-notes/released/1.0.13.md b/shared/typos/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/typos/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/typos/codeql-pack.release.yml b/shared/typos/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/typos/codeql-pack.release.yml +++ b/shared/typos/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/typos/qlpack.yml b/shared/typos/qlpack.yml index 8c1a93efe5e..250f729ab5f 100644 --- a/shared/typos/qlpack.yml +++ b/shared/typos/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typos -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/util/CHANGELOG.md b/shared/util/CHANGELOG.md index 15c3b8c6225..e03d990b747 100644 --- a/shared/util/CHANGELOG.md +++ b/shared/util/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.0.0 + +### Breaking Changes + +* Deleted the old deprecated inline expectation test API that was based on the `InlineExpectationsTest` class. + ## 1.0.12 No user-facing changes. diff --git a/shared/util/change-notes/2024-12-03-remove-deprected-inline-expecation-test-classes.md b/shared/util/change-notes/released/2.0.0.md similarity index 77% rename from shared/util/change-notes/2024-12-03-remove-deprected-inline-expecation-test-classes.md rename to shared/util/change-notes/released/2.0.0.md index 6126e37b619..513290e952b 100644 --- a/shared/util/change-notes/2024-12-03-remove-deprected-inline-expecation-test-classes.md +++ b/shared/util/change-notes/released/2.0.0.md @@ -1,4 +1,5 @@ ---- -category: breaking ---- +## 2.0.0 + +### Breaking Changes + * Deleted the old deprecated inline expectation test API that was based on the `InlineExpectationsTest` class. diff --git a/shared/util/codeql-pack.release.yml b/shared/util/codeql-pack.release.yml index 2036690b201..0abe6ccede0 100644 --- a/shared/util/codeql-pack.release.yml +++ b/shared/util/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 2.0.0 diff --git a/shared/util/qlpack.yml b/shared/util/qlpack.yml index 83284f19cc3..b327c25a3d9 100644 --- a/shared/util/qlpack.yml +++ b/shared/util/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/util -version: 1.0.13-dev +version: 2.0.1-dev groups: shared library: true dependencies: null diff --git a/shared/xml/CHANGELOG.md b/shared/xml/CHANGELOG.md index c8213742dc9..c3ebc31994b 100644 --- a/shared/xml/CHANGELOG.md +++ b/shared/xml/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/xml/change-notes/released/1.0.13.md b/shared/xml/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/xml/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/xml/codeql-pack.release.yml b/shared/xml/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/xml/codeql-pack.release.yml +++ b/shared/xml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/xml/qlpack.yml b/shared/xml/qlpack.yml index f48f41ef3ff..76c408c2920 100644 --- a/shared/xml/qlpack.yml +++ b/shared/xml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/xml -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true dependencies: diff --git a/shared/yaml/CHANGELOG.md b/shared/yaml/CHANGELOG.md index 2cc2ec62057..28fcbceec8e 100644 --- a/shared/yaml/CHANGELOG.md +++ b/shared/yaml/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/shared/yaml/change-notes/released/1.0.13.md b/shared/yaml/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/shared/yaml/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/shared/yaml/codeql-pack.release.yml b/shared/yaml/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/shared/yaml/codeql-pack.release.yml +++ b/shared/yaml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/shared/yaml/qlpack.yml b/shared/yaml/qlpack.yml index 54880a8cf2f..0c756e1edbb 100644 --- a/shared/yaml/qlpack.yml +++ b/shared/yaml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/yaml -version: 1.0.13-dev +version: 1.0.14-dev groups: shared library: true warnOnImplicitThis: true diff --git a/swift/ql/lib/CHANGELOG.md b/swift/ql/lib/CHANGELOG.md index 898a3282bb5..ba76b51c80e 100644 --- a/swift/ql/lib/CHANGELOG.md +++ b/swift/ql/lib/CHANGELOG.md @@ -1,3 +1,9 @@ +## 3.0.0 + +### Breaking Changes + +* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. + ## 2.0.4 No user-facing changes. diff --git a/swift/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md b/swift/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md deleted file mode 100644 index d09ec528c99..00000000000 --- a/swift/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: breaking ---- -* Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. diff --git a/cpp/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md b/swift/ql/lib/change-notes/released/3.0.0.md similarity index 88% rename from cpp/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md rename to swift/ql/lib/change-notes/released/3.0.0.md index d09ec528c99..82b5c467407 100644 --- a/cpp/ql/lib/change-notes/2024-12-03-remove-dataflow-config-class-api.md +++ b/swift/ql/lib/change-notes/released/3.0.0.md @@ -1,4 +1,5 @@ ---- -category: breaking ---- +## 3.0.0 + +### Breaking Changes + * Deleted the old deprecated data flow API that was based on extending a configuration class. See https://github.blog/changelog/2023-08-14-new-dataflow-api-for-writing-custom-codeql-queries for instructions on migrating your queries to use the new API. diff --git a/swift/ql/lib/codeql-pack.release.yml b/swift/ql/lib/codeql-pack.release.yml index 0f306f8bd3b..33d3a2cd113 100644 --- a/swift/ql/lib/codeql-pack.release.yml +++ b/swift/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.4 +lastReleaseVersion: 3.0.0 diff --git a/swift/ql/lib/qlpack.yml b/swift/ql/lib/qlpack.yml index 2e855546d50..7752975faea 100644 --- a/swift/ql/lib/qlpack.yml +++ b/swift/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-all -version: 2.0.5-dev +version: 3.0.1-dev groups: swift extractor: swift dbscheme: swift.dbscheme diff --git a/swift/ql/src/CHANGELOG.md b/swift/ql/src/CHANGELOG.md index 76de7db1348..73ac6bef86d 100644 --- a/swift/ql/src/CHANGELOG.md +++ b/swift/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.13 + +No user-facing changes. + ## 1.0.12 No user-facing changes. diff --git a/swift/ql/src/change-notes/released/1.0.13.md b/swift/ql/src/change-notes/released/1.0.13.md new file mode 100644 index 00000000000..378f97eeb1b --- /dev/null +++ b/swift/ql/src/change-notes/released/1.0.13.md @@ -0,0 +1,3 @@ +## 1.0.13 + +No user-facing changes. diff --git a/swift/ql/src/codeql-pack.release.yml b/swift/ql/src/codeql-pack.release.yml index 2036690b201..c3be7eb7716 100644 --- a/swift/ql/src/codeql-pack.release.yml +++ b/swift/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.12 +lastReleaseVersion: 1.0.13 diff --git a/swift/ql/src/qlpack.yml b/swift/ql/src/qlpack.yml index 1d9f7154cda..ec8e2cb9932 100644 --- a/swift/ql/src/qlpack.yml +++ b/swift/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-queries -version: 1.0.13-dev +version: 1.0.14-dev groups: - swift - queries