-
- Downloads
go/types, types2: do not mutate arguments in NewChecker
CL 507975 resulted in new data races (as reported in #61212), because the pkg argument to NewChecker was mutated. Fix this by deferring the recording of the goVersion in pkg until type checking is actually initiated via a call to Checker.Files. Additionally, modify types2/check.go to bring it in sync with the changes in go/types/check.go, and generate the new version_test.go from the types2 file. Also move parsing the version into checkFiles, for simplicity. Fixes #61212 Change-Id: I15edb6c2cff3085622fe7c6a3b0dab531d27bd04 Reviewed-on: https://go-review.googlesource.com/c/go/+/508439 Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by:Alan Donovan <adonovan@google.com>
Showing
- src/cmd/compile/internal/types2/check.go 27 additions, 11 deletionssrc/cmd/compile/internal/types2/check.go
- src/cmd/compile/internal/types2/version_test.go 24 additions, 0 deletionssrc/cmd/compile/internal/types2/version_test.go
- src/go/types/check.go 28 additions, 21 deletionssrc/go/types/check.go
- src/go/types/generate_test.go 1 addition, 0 deletionssrc/go/types/generate_test.go
- src/go/types/version_test.go 2 additions, 0 deletionssrc/go/types/version_test.go
Please register or sign in to comment