Source file
src/runtime/asan.go
1
2
3
4
5
6
7 package runtime
8
9 import (
10 "internal/runtime/sys"
11 "unsafe"
12 )
13
14
15 func ASanRead(addr unsafe.Pointer, len int) {
16 sp := sys.GetCallerSP()
17 pc := sys.GetCallerPC()
18 doasanread(addr, uintptr(len), sp, pc)
19 }
20
21 func ASanWrite(addr unsafe.Pointer, len int) {
22 sp := sys.GetCallerSP()
23 pc := sys.GetCallerPC()
24 doasanwrite(addr, uintptr(len), sp, pc)
25 }
26
27
28 const asanenabled = true
29
30
31
32
33
34
35 func asanread(addr unsafe.Pointer, sz uintptr) {
36 sp := sys.GetCallerSP()
37 pc := sys.GetCallerPC()
38 doasanread(addr, sz, sp, pc)
39 }
40
41
42
43 func asanwrite(addr unsafe.Pointer, sz uintptr) {
44 sp := sys.GetCallerSP()
45 pc := sys.GetCallerPC()
46 doasanwrite(addr, sz, sp, pc)
47 }
48
49
50 func doasanread(addr unsafe.Pointer, sz, sp, pc uintptr)
51
52
53 func doasanwrite(addr unsafe.Pointer, sz, sp, pc uintptr)
54
55
56 func asanunpoison(addr unsafe.Pointer, sz uintptr)
57
58
59 func asanpoison(addr unsafe.Pointer, sz uintptr)
60
61
62 func asanregisterglobals(addr unsafe.Pointer, n uintptr)
63
64
65
66
67
68
69
70
71
View as plain text