go/misc
Ian Lance Taylor fbdaa96563 cmd/cgo: use field alignment when setting field offset
The old code ignored the field alignment, and only looked at the field
offset: if the field offset required padding, cgo added padding. But
while that approach works for Go (at least with the gc toolchain) it
doesn't work for C code using packed structs. With a packed struct the
added padding may leave the struct at a misaligned position, and the
inserted alignment, which cgo is not considering, may introduce
additional, unexpected, padding. Padding that ignores alignment is not
a good idea when the struct is not packed, and Go structs are never
packed. So don't ignore alignment.

Fixes #28896

Change-Id: Ie50ea15fa6dc35557497097be9fecfecb11efd8a
Reviewed-on: https://go-review.googlesource.com/c/150602
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-11-29 19:18:12 +00:00
..
android misc/android: forward SIGQUIT to the process running on the device 2018-05-23 18:18:39 +00:00
arm all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
cgo cmd/cgo: use field alignment when setting field offset 2018-11-29 19:18:12 +00:00
chrome/gophertool all: link to https instead of http 2015-07-11 14:36:33 +00:00
git misc/git: Fix non-literal period in pre-commit grep 2016-02-26 19:06:38 +00:00
ios misc/ios: remove note from output of detect.go 2018-10-24 15:33:31 +00:00
linkcheck misc/linkcheck: better redirect handling, use meaningful exit code 2013-10-25 17:31:02 +03:00
nacl cmd/trace: revert internal/traceparser 2018-11-22 02:59:55 +00:00
sortac misc/sortac: add tool to sort the AUTHORS and CONTRIBUTORS files 2015-11-12 17:07:09 +00:00
swig cmd/go: fix swig support and run swig tests during run.bash 2017-11-16 17:19:19 +00:00
trace misc/trace: update trace_viewer_full.html 2018-04-26 20:26:23 +00:00
wasm misc/wasm: add stub for fs.read on browsers 2018-11-20 22:06:33 +00:00
benchcmp all: use golang.org/x/... import paths 2014-11-10 09:15:57 +11:00
editors all: don't refer to code.google.com/p/go{,-wiki}/ 2015-02-06 14:41:47 +00:00