Rust: Skip model generation for functions with a ; in their canonical path

This commit is contained in:
Simon Friis Vindum
2025-12-12 10:42:49 +01:00
parent 8cb0f5faa6
commit 9cdf63e175

View File

@@ -13,6 +13,10 @@ private import codeql.rust.dataflow.internal.FlowSummaryImpl as FlowSummary
private newtype TCallable =
TFunction(R::Function api, string path) {
path = api.getCanonicalPath() and
// A canonical path can contain `;` as the syntax for array types use `;`.
// This does not work with the shared model generator, so for now we just
// exclude canonical paths with `;`s.
not exists(api.getCanonicalPath().indexOf(";")) and
(
// This excludes closures (these are not exported API endpoints) and
// functions without a `pub` visibility. A function can be `pub` without