]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.22] 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>
Thu, 5 Sep 2024 22:14:37 +0000 (22:14 +0000)
commit71655f14cecefb16cc8969e43a6a9631f74d72ee
treea0eeb4953882b31d189242beab98918416889179
parent7529d09a11496a77ccbffe245607fbd256200991
[release-branch.go1.22] 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.

For #69086
Fixes #69218

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>
(cherry picked from commit c2098929056481d0dc09f5f42b8959f4db8878f2)
Reviewed-on: https://go-review.googlesource.com/c/go/+/611297
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/cmd/cgo/gcc.go
src/cmd/cgo/internal/test/cgo_test.go
src/cmd/cgo/internal/test/test.go