aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/decl.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/decl.go b/sys/decl.go
index 9c7887f99..de3554dbf 100644
--- a/sys/decl.go
+++ b/sys/decl.go
@@ -312,6 +312,9 @@ func (t *StructType) Align() uintptr {
if t.align != 0 {
return t.align // overrided by user attribute
}
+ if t.packed {
+ return 1
+ }
var align uintptr
for _, f := range t.Fields {
if a1 := f.Align(); align < a1 {