]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/ssagen: fix race added in CL 510539
authorMatthew Dempsky <mdempsky@google.com>
Thu, 17 Aug 2023 21:18:06 +0000 (14:18 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 17 Aug 2023 21:51:00 +0000 (21:51 +0000)
commit639f6f7e789ffbafd3d6f4327dbc10586e8163db
tree14c34b5607dc0721bcf26aa9f9f59254bcd531aa
parent6a1182027c5d715e372417a85e451b19029ac7e7
cmd/compile/internal/ssagen: fix race added in CL 510539

The ssagen pass runs concurrently, so it's not safe to mutate global
variables like this.

Instead, turn it into a constant and add an assertion that the
constant has the correct value.

Fixes #62095.

Change-Id: Ia7f07e33582564892d194153ac3d8759429fc9ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/520598
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/ssagen/ssa.go