From 44654bdef624edbcbd8acb899e3e96d389b55d23 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Wed, 5 Nov 2025 12:29:31 +0000 Subject: [PATCH] Go: avoid overlay-discarding @file entities ...since they are shared between base and overlay --- go/ql/lib/semmle/go/Overlay.qll | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go/ql/lib/semmle/go/Overlay.qll b/go/ql/lib/semmle/go/Overlay.qll index 32c77c7e642..97d7f788fdb 100644 --- a/go/ql/lib/semmle/go/Overlay.qll +++ b/go/ql/lib/semmle/go/Overlay.qll @@ -20,7 +20,9 @@ private @file getFile(@locatable locatable) { /** Holds if the `locatable` is in the `file` and is part of the overlay base database. */ private predicate discardableLocatable(@file file, @locatable locatable) { not isOverlay() and - file = getFile(locatable) + file = getFile(locatable) and + // Avoid discarding @file entities, since they are shared between base and overlay. + not locatable instanceof @file } /**