aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-01-05 14:06:58 -0800
committerIan Lance Taylor <iant@golang.org>2016-01-06 04:04:42 +0000
commit934e055f414839a9af59601aebacfeeef2b52740 (patch)
tree9b0580829773516ea966243caeebc2832ef4bb55 /src/runtime/proc.go
parent17ce03725cc549fc24e8972780d18ffd673f6b6c (diff)
downloadgo-934e055f414839a9af59601aebacfeeef2b52740.tar.xz
runtime: call msanwrite on object passed to runtime/cgo
Avoids an msan error when runtime/cgo is explicitly rebuilt with -fsanitize=memory. Fixes #13815. Change-Id: I70308034011fb308b63585bcd40b0d1e62ec93ef Reviewed-on: https://go-review.googlesource.com/18263 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 3fa21d8e6f..12fba1404c 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -1489,6 +1489,9 @@ func newm(fn func(), _p_ *p) {
ts.g.set(mp.g0)
ts.tls = (*uint64)(unsafe.Pointer(&mp.tls[0]))
ts.fn = unsafe.Pointer(funcPC(mstart))
+ if msanenabled {
+ msanwrite(unsafe.Pointer(&ts), unsafe.Sizeof(ts))
+ }
asmcgocall(_cgo_thread_start, unsafe.Pointer(&ts))
return
}