8dc2499aa6
gotools/ * Makefile.am (go_cmd_cgo_files): Add ast_go118.go (check-go-tool): Copy golang.org/x/tools directories. * Makefile.in: Regenerate. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384695
33 lines
692 B
Go
33 lines
692 B
Go
// 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)
|
|
|
|
package msan
|
|
|
|
/*
|
|
#cgo CFLAGS: -fsanitize=memory
|
|
#cgo LDFLAGS: -fsanitize=memory
|
|
|
|
#include <stdint.h>
|
|
#include <sanitizer/msan_interface.h>
|
|
|
|
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"
|