aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mbarrier.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2015-10-21 11:04:42 -0700
committerIan Lance Taylor <iant@golang.org>2015-10-21 19:17:46 +0000
commit73f329f47236c6952235db395802810156a7bd65 (patch)
tree4f26e4e00e448a5d005535cca4b660f8b0922ffb /src/runtime/mbarrier.go
parentc27925094640f0d151da92663d19d511d8dfdc31 (diff)
downloadgo-73f329f47236c6952235db395802810156a7bd65.tar.gz
go-73f329f47236c6952235db395802810156a7bd65.zip
runtime, syscall: add calls to msan functions
Add explicit memory sanitizer instrumentation to the runtime and syscall packages. The compiler does not instrument the runtime package. It does instrument the syscall package, but we need to add a couple of cases that it can't see. Change-Id: I2d66073f713fe67e33a6720460d2bb8f72f31394 Reviewed-on: https://go-review.googlesource.com/16164 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/runtime/mbarrier.go')
-rw-r--r--src/runtime/mbarrier.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/mbarrier.go b/src/runtime/mbarrier.go
index 0dbe1ffc9d..6ca2672b8d 100644
--- a/src/runtime/mbarrier.go
+++ b/src/runtime/mbarrier.go
@@ -241,6 +241,10 @@ func typedslicecopy(typ *_type, dst, src slice) int {
racewriterangepc(dstp, uintptr(n)*typ.size, callerpc, pc)
racereadrangepc(srcp, uintptr(n)*typ.size, callerpc, pc)
}
+ if msanenabled {
+ msanwrite(dstp, uintptr(n)*typ.size)
+ msanread(srcp, uintptr(n)*typ.size)
+ }
// Note: No point in checking typ.kind&kindNoPointers here:
// compiler only emits calls to typedslicecopy for types with pointers,