mirror of
https://github.com/golang/go
synced 2024-11-11 23:10:23 -07:00
cmd/compile/internal/gc: make sure nonzero-sized objects have nonzero alignment
See issue #11354. Change-Id: I6817d499e6c02e4a9c83f80bc66a2bee368a69ec Reviewed-on: https://go-review.googlesource.com/11406 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
f81f6d6ee8
commit
dbe9ab69d9
@ -119,6 +119,10 @@ func dowidth(t *Type) {
|
||||
}
|
||||
|
||||
if t.Width > 0 {
|
||||
if t.Align == 0 {
|
||||
// See issue 11354
|
||||
Fatal("zero alignment with nonzero size %v", t)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user