From 43a123c1ae6613b3efeed291fa552ecd909d3acf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 16 Apr 2024 21:23:18 +0200 Subject: Adding upstream version 1.20.14. Signed-off-by: Daniel Baumann --- src/runtime/msan/msan.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/runtime/msan/msan.go (limited to 'src/runtime/msan') diff --git a/src/runtime/msan/msan.go b/src/runtime/msan/msan.go new file mode 100644 index 0000000..4e41f85 --- /dev/null +++ b/src/runtime/msan/msan.go @@ -0,0 +1,32 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build msan && ((linux && (amd64 || arm64)) || (freebsd && amd64)) + +package msan + +/* +#cgo CFLAGS: -fsanitize=memory +#cgo LDFLAGS: -fsanitize=memory + +#include +#include + +void __msan_read_go(void *addr, uintptr_t sz) { + __msan_check_mem_is_initialized(addr, sz); +} + +void __msan_write_go(void *addr, uintptr_t sz) { + __msan_unpoison(addr, sz); +} + +void __msan_malloc_go(void *addr, uintptr_t sz) { + __msan_unpoison(addr, sz); +} + +void __msan_free_go(void *addr, uintptr_t sz) { + __msan_poison(addr, sz); +} +*/ +import "C" -- cgit v1.2.3