diff options
author | Ian Lance Taylor <iant@golang.org> | 2018-07-03 22:10:58 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2018-07-05 05:15:15 +0000 |
commit | e2f8766c30881fbbd97e1e039f5ecc38104f907f (patch) | |
tree | 2edac01c11a10459f328bcbcb17d6cf23fe5cbcb /misc/cgo/testsanitizers/msan_test.go | |
parent | 9e5fe6baf1dfd8ea7ba1456845a7e1f7256eeeaa (diff) | |
download | go-e2f8766c30881fbbd97e1e039f5ecc38104f907f.tar.gz go-e2f8766c30881fbbd97e1e039f5ecc38104f907f.zip |
cmd/cgo: mark C result as written for msan
Otherwise it is possible that msan will consider the C result to be
partially initialized, which may cause msan to think that the Go stack
is partially uninitialized. The compiler will never mark the stack as
initialized, so without this CL it is possible for stack addresses to
be passed to msanread, which will cause a false positive error from msan.
Fixes #26209
Change-Id: I43a502beefd626eb810ffd8753e269a55dff8248
Reviewed-on: https://go-review.googlesource.com/122196
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'misc/cgo/testsanitizers/msan_test.go')
-rw-r--r-- | misc/cgo/testsanitizers/msan_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/misc/cgo/testsanitizers/msan_test.go b/misc/cgo/testsanitizers/msan_test.go index af5afa9ee4..88b90d3d70 100644 --- a/misc/cgo/testsanitizers/msan_test.go +++ b/misc/cgo/testsanitizers/msan_test.go @@ -27,6 +27,7 @@ func TestMSAN(t *testing.T) { {src: "msan3.go"}, {src: "msan4.go"}, {src: "msan5.go"}, + {src: "msan6.go"}, {src: "msan_fail.go", wantErr: true}, } for _, tc := range cases { |