]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/asan: declare asan reporting functions in C
authorIan Lance Taylor <iant@golang.org>
Tue, 2 Nov 2021 20:56:22 +0000 (13:56 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 2 Nov 2021 23:44:58 +0000 (23:44 +0000)
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>

src/runtime/asan/asan.go

index ac71466b71d46bf8affb03ff0c3dee3bb82ec7f0..eb66b3aab54711f6865cc07b5e011df89fd3c2bc 100644 (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) {