]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: correct alignment of atomic.Int64
authorAustin Clements <austin@google.com>
Wed, 13 Jul 2022 19:18:41 +0000 (15:18 -0400)
committerAustin Clements <austin@google.com>
Fri, 15 Jul 2022 14:56:54 +0000 (14:56 +0000)
commit2aa473cc54128c1498f80263763a2a876308e565
treeb3478cea0fd023f1e383f09b342a8f63b967bdbc
parent4651ebf96191ffa3c0bc4c0b479bc97fbdd97b67
go/types, types2: correct alignment of atomic.Int64

atomic.Int64 has special logic in the compiler to ensure it's 8-byte
aligned on 32-bit architectures. The equivalent logic is missing in
go/types, which means the compiler and go/types can come to different
conclusions about the layout of types.

Fix this by mirroring the compiler's logic into go/types.

Fixes #53884.

Change-Id: I3f58a56babb76634839a161ca174c8f085fe3ba4
Reviewed-on: https://go-review.googlesource.com/c/go/+/417555
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types/size.go
src/cmd/compile/internal/types2/sizes.go
src/cmd/compile/internal/types2/sizes_test.go
src/go/types/sizes.go
src/go/types/sizes_test.go