Skip to content

Commit

Permalink
cmd/compile/internal/gc: make sure nonzero-sized objects have nonzero…
Browse files Browse the repository at this point in the history
… alignment

See issue #11354.

Change-Id: I6817d499e6c02e4a9c83f80bc66a2bee368a69ec
Reviewed-on: https://go-review.googlesource.com/11406
Reviewed-by: Russ Cox <rsc@golang.org>
  • Loading branch information
randall77 committed Jun 25, 2015
1 parent f81f6d6 commit dbe9ab6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cmd/compile/internal/gc/align.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit dbe9ab6

Please sign in to comment.