]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: make sure nonzero-sized objects have nonzero alignment
authorKeith Randall <khr@golang.org>
Wed, 24 Jun 2015 14:23:40 +0000 (07:23 -0700)
committerKeith Randall <khr@golang.org>
Thu, 25 Jun 2015 02:22:58 +0000 (02:22 +0000)
See issue #11354.

Change-Id: I6817d499e6c02e4a9c83f80bc66a2bee368a69ec
Reviewed-on: https://go-review.googlesource.com/11406
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/align.go

index 741c5dd76c4240338547644cd1d0df72f6ecc4c7..0fc3c2b97c3bf5792fc96804780072820c6dda43 100644 (file)
@@ -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
        }