x86/x86asm: make x86asm.Decode thread-safe

Moves initialization of the decoderCover variable from happening
unconditionally to only being initialized by the test code using it so
that it does not cause a data race when not being used and Decode is
called in parallel.

Fixes golang/go#33532

Change-Id: I64d748f94d135f0c1f55f1456ff770ac5205c85a
GitHub-Last-Rev: 679e78ed1daf3ddbd03792155e3be90b7b498fc4
GitHub-Pull-Request: golang/arch#4
Reviewed-on: https://go-review.googlesource.com/c/arch/+/189919
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2 files changed
tree: 89518b4990f7bfa71324750038198ed584ecea5d
  1. AUTHORS
  2. CONTRIBUTING.md
  3. CONTRIBUTORS
  4. LICENSE
  5. PATENTS
  6. README.md
  7. arm/
  8. arm64/
  9. codereview.cfg
  10. go.mod
  11. go.sum
  12. ppc64/
  13. vendor/
  14. x86/
README.md

arch

This repository holds machine architecture information used by the Go toolchain. The parts needed in the main Go repository are copied in.

This repository requires Go 1.5+ with the vendor experiment enabled.