1
0
mirror of https://github.com/golang/go synced 2024-11-24 06:20:02 -07:00

runtime/asan: declare asan reporting functions in C

Fixes #49287

Change-Id: I3f970d6db0b1dee886df2f7bb6cbeb56a37c42c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/360860
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2021-11-02 13:56:22 -07:00
parent eb63cbd295
commit a0f373ca08

View File

@ -10,9 +10,21 @@ package asan
#cgo CFLAGS: -fsanitize=address
#cgo LDFLAGS: -fsanitize=address
#include <stdbool.h>
#include <stdint.h>
#include <sanitizer/asan_interface.h>
extern void __asan_report_load1(void*);
extern void __asan_report_load2(void*);
extern void __asan_report_load4(void*);
extern void __asan_report_load8(void*);
extern void __asan_report_load_n(void*, uintptr_t);
extern void __asan_report_store1(void*);
extern void __asan_report_store2(void*);
extern void __asan_report_store4(void*);
extern void __asan_report_store8(void*);
extern void __asan_report_store_n(void*, uintptr_t);
void __asan_read_go(void *addr, uintptr_t sz) {
if (__asan_region_is_poisoned(addr, sz)) {
switch (sz) {