The atomicalign Analyzer checks the alignment of 64-bits variables accessed atomically via sync/atomic functions on 32-bits architectures. Per the sync/atomic BUG note those variables must be 64-bits aligned, otherwise a runtime panic is issued. The analyzer only shows and runs on 32-bits architectures. This CL should not introduce any false positives. Add some tests in testdata/src/a to verify the analyzer behavior on affected architectures plus some very basic test to verify that no warning is generated on non-affected ones. Fixes golang/go#11891 Change-Id: I02cfc574883564cd2a213a92d33bda3cc9a1ea98 Reviewed-on: https://go-review.googlesource.com/c/158277 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com> |
||
|---|---|---|
| .. | ||
| asmdecl | ||
| assign | ||
| atomic | ||
| atomicalign | ||
| bools | ||
| buildssa | ||
| buildtag | ||
| cgocall | ||
| composite | ||
| copylock | ||
| ctrlflow | ||
| findcall | ||
| httpresponse | ||
| inspect | ||
| internal/analysisutil | ||
| loopclosure | ||
| lostcancel | ||
| nilfunc | ||
| nilness | ||
| pkgfact | ||
| printf | ||
| shadow | ||
| shift | ||
| stdmethods | ||
| structtag | ||
| tests | ||
| unmarshal | ||
| unreachable | ||
| unsafeptr | ||
| unusedresult | ||
| README | ||
README
This directory does not contain a Go package, but acts as a container for various analyses that implement the golang.org/x/tools/go/analysis API and may be imported into an analysis tool. By convention, each package foo provides the analysis, and each command foo/cmd/foo provides a standalone driver.