aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/msan.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2017-01-18 15:12:18 -0500
committerBryan Mills <bcmills@google.com>2017-01-19 23:06:54 +0000
commitea7d9e6a52ca64c200dcc75621e75f209ceceace (patch)
tree889f5e0fd752eeba058f19a1f8b9fbf4582bfdfc /src/runtime/msan.go
parent6593d8650da5d19787bea9383dabe94f36fa04be (diff)
downloadgo-ea7d9e6a52ca64c200dcc75621e75f209ceceace.tar.xz
runtime: check for nil g and m in msanread
fixes #18707. Change-Id: Ibc4efef01197799f66d10bfead22faf8ac00473c Reviewed-on: https://go-review.googlesource.com/35452 Run-TryBot: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/msan.go')
-rw-r--r--src/runtime/msan.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/msan.go b/src/runtime/msan.go
index 7177c8e611..c0f3957e28 100644
--- a/src/runtime/msan.go
+++ b/src/runtime/msan.go
@@ -28,9 +28,11 @@ const msanenabled = true
// the runtime, but operations like a slice copy can call msanread
// anyhow for values on the stack. Just ignore msanread when running
// on the system stack. The other msan functions are fine.
+//
+//go:nosplit
func msanread(addr unsafe.Pointer, sz uintptr) {
g := getg()
- if g == g.m.g0 || g == g.m.gsignal {
+ if g == nil || g.m == nil || g == g.m.g0 || g == g.m.gsignal {
return
}
domsanread(addr, sz)