]> Cypherpunks repositories - gostls13.git/commit
go/types: fix race-y initialization of Struct.offsets
authorAleksandr Demakin <alexander.demakin@gmail.com>
Tue, 20 Oct 2015 20:05:50 +0000 (23:05 +0300)
committerRobert Griesemer <gri@golang.org>
Tue, 1 Dec 2015 19:22:19 +0000 (19:22 +0000)
commita4cd0a49c7d1b9b09c3da15c62a5915eb4b45fa0
tree1d266d824d9efeeb3cbf95fbcb879798a9d9d317
parent5ff309f48d4a4ae1995cb930413e62d546079e9c
go/types: fix race-y initialization of Struct.offsets

Use sync.Once to ensure, that 'offsets' field is initialized
once only in a threadsafe way.

Fixes #12887

Change-Id: I90ef929c421ccd3094339c67a39b02d8f2e47211
Reviewed-on: https://go-review.googlesource.com/16013
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/sizes.go
src/go/types/type.go