From 7ef60a864974c8c790766fa0fbd877cbb5bd63e3 Mon Sep 17 00:00:00 2001 From: Jonas Jensen Date: Wed, 11 Mar 2026 13:15:31 +0100 Subject: [PATCH] Update the overlay annotation script for go The Go libraries follow their own naming convention for "query libraries". These need to be exempted from automatic `overlay[local?]` annotations since otherwise it appears that too many predicates are evaluated, possibly because of inadequate use of sentinels. --- config/add-overlay-annotations.py | 1 + 1 file changed, 1 insertion(+) diff --git a/config/add-overlay-annotations.py b/config/add-overlay-annotations.py index 0a30eee5799..4fbd9a2b7fc 100644 --- a/config/add-overlay-annotations.py +++ b/config/add-overlay-annotations.py @@ -199,6 +199,7 @@ def annotate_as_appropriate(filename, lines): # as overlay[local?]. It is not clear that these heuristics are exactly what we want, # but they seem to work well enough for now (as determined by speed and accuracy numbers). if (filename.endswith("Test.qll") or + re.search(r"go/ql/lib/semmle/go/security/[^/]+[.]qll$", filename.replace(os.sep, "/")) or ((filename.endswith("Query.qll") or filename.endswith("Config.qll")) and any("implements DataFlow::ConfigSig" in line for line in lines))): return None