]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/compile: fix data race on LSym.Pkg
authorCherry Zhang <cherryyz@google.com>
Wed, 2 Oct 2019 21:45:05 +0000 (17:45 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 3 Oct 2019 14:14:43 +0000 (14:14 +0000)
commita09cd8ccb372d760bd21d7e56f42b9dbea6ecc2b
treeb7fb933a69cbb9db7792ddceb6edc49339b78bd8
parent53b7c18284a404de6ca814bc3313d980b8e5ecc3
[dev.link] cmd/compile: fix data race on LSym.Pkg

LSym may be created concurrently. Reading/writing LSym.Pkg may
cause data race (see
https://build.golang.org/log/f0351c5cc7bf4c92e3aa5e78e294c2d009ebf118).
Fix this by setting LSym.Pkg only when holding the lock.

Change-Id: Ib3160ecf47c4ca530b09369e0e8284db6597cfd0
Reviewed-on: https://go-review.googlesource.com/c/go/+/198492
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/types/sym.go
src/cmd/internal/obj/sym.go