aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2019-10-17 13:24:34 -0700
committerMatthew Dempsky <mdempsky@google.com>2019-10-22 23:28:20 +0000
commitdded58760d3e97907d9ee2d5c7b0252970508044 (patch)
tree13151aeec696786c0d503eefca0f43dbe42002ca /src
parent5a5854c2d1a0eed6d48734ab2cc674c25aa670cb (diff)
downloadgo-dded58760d3e97907d9ee2d5c7b0252970508044.tar.xz
cmd/compile: enable -d=checkptr when -race or -msan is specified
It can still be manually disabled again using -d=checkptr=0. It's also still disabled by default for GOOS=windows, because the Windows standard library code has a lot of unsafe pointer conversions that need updating. Updates #34964. Change-Id: Ie0b8b4fdf9761565e0dcb00d69997ad896ac233d Reviewed-on: https://go-review.googlesource.com/c/go/+/201783 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/gc/main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go
index 771b4fe973..51e9f0071a 100644
--- a/src/cmd/compile/internal/gc/main.go
+++ b/src/cmd/compile/internal/gc/main.go
@@ -340,6 +340,11 @@ func Main(archInit func(*Arch)) {
if flag_race && flag_msan {
log.Fatal("cannot use both -race and -msan")
}
+ if (flag_race || flag_msan) && objabi.GOOS != "windows" {
+ // -race and -msan imply -d=checkptr for now (except on windows).
+ // TODO(mdempsky): Re-evaluate before Go 1.14. See #34964.
+ Debug_checkptr = 1
+ }
if ispkgin(omit_pkgs) {
flag_race = false
flag_msan = false