]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add -asan option
authorfanzha02 <fannie.zhang@arm.com>
Mon, 4 Jan 2021 09:14:35 +0000 (17:14 +0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 25 Oct 2021 21:51:20 +0000 (21:51 +0000)
commit85b3b4ee036e7460bf7621f64c6781e5dd0eed98
tree1cc220e9b8751df4d3496b7386212e701fd0eed2
parent60c3069dd82eee30c00f2a8d829ba74b11bcf07e
cmd/compile: add -asan option

The -asan option causes the compiler to add instrumentation for the
C/C++ address sanitizer.  Every memory read/write will be replaced
by a call to asanread/asanwrite.

This CL also inserts asan instrumentation during SSA building.

This CL passes tests but is not usable by itself. The actual
implementation of asanread/asanwrite in the runtime package, and
support for -asan in the go tool and tests, will follow in subsequent
CLs.

Updates #44853.

Change-Id: Ia18c9c5d5c351857420d2f6835f0daec2ad31096
Reviewed-on: https://go-review.googlesource.com/c/go/+/298611
Trust: fannie zhang <Fannie.Zhang@arm.com>
Run-TryBot: fannie zhang <Fannie.Zhang@arm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
12 files changed:
src/cmd/compile/doc.go
src/cmd/compile/internal/base/base.go
src/cmd/compile/internal/base/flag.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/ir/symtab.go
src/cmd/compile/internal/noder/import.go
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/typecheck/builtin.go
src/cmd/compile/internal/typecheck/builtin/runtime.go
src/cmd/internal/sys/supported.go