Also fix the msan_fail test. It was bogus, since it always aborted one
way or another.
Change-Id: Ic693327d1bddb7bc5c7d859ac047fc93cb9b5b1c
Reviewed-on: https://go-review.googlesource.com/16172
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
void g(int32_t *p, int n) {
if (p[4] != 1) {
- abort();
+ // We shouldn't get here; msan should stop us first.
+ exit(0);
}
}
*/
cgoLDFLAGS = append(cgoLDFLAGS, "-lobjc")
}
+ if buildMSan && p.ImportPath != "runtime/cgo" {
+ cgoCFLAGS = append([]string{"-fsanitize=memory"}, cgoCFLAGS...)
+ cgoLDFLAGS = append([]string{"-fsanitize=memory"}, cgoLDFLAGS...)
+ }
+
// Allows including _cgo_export.h from .[ch] files in the package.
cgoCPPFLAGS = append(cgoCPPFLAGS, "-I", obj)