Skip to content

Commit 44654bd

Browse files
committed
Go: avoid overlay-discarding @file entities
...since they are shared between base and overlay
1 parent 734cba7 commit 44654bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

go/ql/lib/semmle/go/Overlay.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ private @file getFile(@locatable locatable) {
2020
/** Holds if the `locatable` is in the `file` and is part of the overlay base database. */
2121
private predicate discardableLocatable(@file file, @locatable locatable) {
2222
not isOverlay() and
23-
file = getFile(locatable)
23+
file = getFile(locatable) and
24+
// Avoid discarding @file entities, since they are shared between base and overlay.
25+
not locatable instanceof @file
2426
}
2527

2628
/**

0 commit comments

Comments
 (0)