Skip to content

Commit df076e5

Browse files
committed
wip
1 parent 84517f0 commit df076e5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rust/ql/lib/codeql/rust/internal/PathResolution.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,14 @@ class CrateItemNode extends ItemNode instanceof Crate {
334334

335335
override TypeParam getTypeParam(int i) { none() }
336336

337-
override string getCanonicalPath(Crate c) { c = this and result = Crate.super.getName() }
337+
override string getCanonicalPath(Crate c) {
338+
c = this and
339+
result = Crate.super.getName() and
340+
not exists(FunctionItemNode main |
341+
main.getImmediateParent() = this.getModuleNode() and
342+
main.getName() = "main"
343+
)
344+
}
338345

339346
override string getCanonicalPathPrefixFor(Crate c, ItemNode child) {
340347
exists(ModuleLikeNode m |

0 commit comments

Comments
 (0)