aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile
diff options
context:
space:
mode:
authorMateusz Poliwczak <mpoliwczak34@gmail.com>2025-05-16 21:07:46 +0200
committerGopher Robot <gobot@golang.org>2025-05-20 10:47:59 -0700
commit3e82316a4357c44c193790bdc02d1f8032f34289 (patch)
tree625f365ea1e13cdb9c462f8430338a0cd4fdbe4a /src/cmd/compile
parent123141166bf77b60062d830224b85131791647fd (diff)
downloadgo-3e82316a4357c44c193790bdc02d1f8032f34289.tar.xz
cmd/compile: don't instrument counter globals in internal/fuzz
Fixes: #72766 Change-Id: I45b521e53c2a11e259dc99e2dfc8e40cac39139a Reviewed-on: https://go-review.googlesource.com/c/go/+/673575 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile')
-rw-r--r--src/cmd/compile/internal/pkginit/initAsanGlobals.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/pkginit/initAsanGlobals.go b/src/cmd/compile/internal/pkginit/initAsanGlobals.go
index 42db0eaf1b..96c052204a 100644
--- a/src/cmd/compile/internal/pkginit/initAsanGlobals.go
+++ b/src/cmd/compile/internal/pkginit/initAsanGlobals.go
@@ -227,6 +227,12 @@ func canInstrumentGlobal(g ir.Node) bool {
return false
}
+ // Do not instrument counter globals in internal/fuzz. These globals are replaced by the linker.
+ // See go.dev/issue/72766 for more details.
+ if n.Sym().Pkg.Path == "internal/fuzz" && (n.Sym().Name == "_counters" || n.Sym().Name == "_ecounters") {
+ return false
+ }
+
// Do not instrument globals that are linknamed, because their home package will do the work.
if n.Sym().Linkname != "" {
return false