]> Cypherpunks repositories - gostls13.git/commit
cmd/go: prevent necessary GCFlag from being removed
authorKatie Hockman <katie@golang.org>
Mon, 27 Sep 2021 20:12:05 +0000 (16:12 -0400)
committerKatie Hockman <katie@golang.org>
Wed, 29 Sep 2021 17:15:06 +0000 (17:15 +0000)
commitc9af2bd21e86a218622b9c753cddfb5bba46d780
treef213e3dda1b45c85a80cc9ae9ff8686dc5e7983f
parent99d5d8ab6b6819f84bb62aeb3b1eaefaab01989f
cmd/go: prevent necessary GCFlag from being removed

There are special flags that must be passed to the
compiler at build time in order to instrument the
testing binary for fuzzing.
One potential option would be to add these flags to
p.Internal.Gcflags inside cmd/go/internal/test. However,
future calls to setToolFlags can cause these flags to
get cleared about before the build starts, removing
virtually all coverage guidance. This change moves the
logic to add the flag deeper down the call stack,
preventing it from being cleared.

Change-Id: I40eadb0cacc18f29cee75379cd9380f9e73bb8da
Reviewed-on: https://go-review.googlesource.com/c/go/+/352511
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/test/test.go
src/cmd/go/internal/work/exec.go
src/cmd/go/internal/work/gc.go
src/cmd/go/internal/work/init.go