]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: correct padding required by alignment
authorIan Lance Taylor <iant@golang.org>
Tue, 27 Aug 2024 17:19:17 +0000 (10:19 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 30 Aug 2024 19:17:50 +0000 (19:17 +0000)
commitc2098929056481d0dc09f5f42b8959f4db8878f2
tree7d73193797dd442743fb33d99d0e73169a9be7c6
parent6781ff226d8d2f9b49a61eaa8de40be68fea7037
cmd/cgo: correct padding required by alignment

If the aligned offset isn't sufficient for the field offset,
we were padding based on the aligned offset. We need to pad
based on the original offset instead.

Also set the Go alignment correctly for int128. We were defaulting
to the maximum alignment, but since we translate int128 into an
array of uint8 the correct Go alignment is 1.

Fixes #69086

Change-Id: I23ce583335c81beac2ac51f7f9336ac97ccebf09
Reviewed-on: https://go-review.googlesource.com/c/go/+/608815
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
src/cmd/cgo/gcc.go
src/cmd/cgo/internal/test/cgo_test.go
src/cmd/cgo/internal/test/test.go