aboutsummaryrefslogtreecommitdiffstats
path: root/sys/align.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-09-19 19:42:00 +0200
committerGitHub <noreply@github.com>2016-09-19 19:42:00 +0200
commitd18f8aa3669db8a7c2a9d235aa720bce8041f329 (patch)
tree56195536ec22d1414e7614403dc2757d9d76d4ca /sys/align.go
parent0c97d70213a4fbc6d8d57626c18b603f2a281047 (diff)
parentf41935d53ff6271e8c2a9022f41b99ccee9b634b (diff)
Merge pull request #73 from xairy/ranged_arrays
Allow range sized arrays
Diffstat (limited to 'sys/align.go')
-rw-r--r--sys/align.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/align.go b/sys/align.go
index 5e67f6175..4c91c28be 100644
--- a/sys/align.go
+++ b/sys/align.go
@@ -64,7 +64,7 @@ func addAlignment(t *StructType) Type {
}
off += f.Size()
fields = append(fields, f)
- if at, ok := f.(ArrayType); ok && at.Len == 0 {
+ if at, ok := f.(ArrayType); ok && (at.Kind == ArrayRandLen || (at.Kind == ArrayRangeLen && at.RangeBegin != at.RangeEnd)) {
varLen = true
}
if varLen && i != len(t.Fields)-1 {