From ba7726462fb695d5b28280572d15cccd1eb73f3d Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 26 May 2025 12:17:25 +0200 Subject: [PATCH] Rust: Also include prelude path resolution in Core --- rust/ql/lib/codeql/rust/internal/PathResolution.qll | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 8764869a152b..ca05b0fba7d1 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -1413,7 +1413,7 @@ private predicate useImportEdge(Use use, string name, ItemNode item) { */ private predicate preludeEdge(SourceFile f, string name, ItemNode i) { exists(Crate core, ModuleLikeNode mod, ModuleItemNode prelude, ModuleItemNode rust | - f = any(Crate c0 | core = c0.getDependency(_)).getASourceFile() and + f = any(Crate c0 | core = c0.getDependency(_) or core = c0).getASourceFile() and core.getName() = "core" and mod = core.getSourceFile() and prelude = mod.getASuccessorRec("prelude") and @@ -1438,8 +1438,8 @@ private module Debug { private Locatable getRelevantLocatable() { exists(string filepath, int startline, int startcolumn, int endline, int endcolumn | result.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and - filepath.matches("%/term.rs") and - startline = [71] + filepath.matches("%/test.rs") and + startline = 74 ) }