From: Shenghou Ma Date: Fri, 9 Oct 2015 00:24:17 +0000 (-0400) Subject: cmd/internal/obj: move empty field to the top X-Git-Tag: go1.6beta1~848 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=30b966307f475b1445816308f8cb2c5813b38232;p=gostls13.git cmd/internal/obj: move empty field to the top Due to #9401, trailing empty fields will occupy at least 1 byte of space. Fixes #12884. Change-Id: I838d3f1a73637e526f5a6dbc348981227d5bb2fd Reviewed-on: https://go-review.googlesource.com/15660 Run-TryBot: Minux Ma TryBot-Result: Gobot Gobot Reviewed-by: Dave Cheney Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index 3a1faa2edf..75b8d5ee1e 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -247,11 +247,11 @@ func (p *Prog) From3Offset() int64 { // by clients such as the compiler. The exact meaning of this // data is up to the client and is not interpreted by the cmd/internal/obj/... packages. type ProgInfo struct { + _ struct{} // to prevent unkeyed literals. Trailing zero-sized field will take space. + Flags uint32 // flag bits Reguse uint64 // registers implicitly used by this instruction Regset uint64 // registers implicitly set by this instruction Regindex uint64 // registers used by addressing mode - Flags uint32 // flag bits - _ struct{} // to prevent unkeyed literals } // Prog.as opcodes.