go/src/reflect
Keith Randall 6f07ac2f28 cmd/gc: pad structs which end in zero-sized fields
For a non-zero-sized struct with a final zero-sized field,
add a byte to the size (before rounding to alignment).  This
change ensures that taking the address of the zero-sized field
will not incorrectly leak the following object in memory.

reflect.funcLayout also needs this treatment.

Fixes #9401

Change-Id: I1dc503dc5af4ca22c8f8c048fb7b4541cc957e0f
Reviewed-on: https://go-review.googlesource.com/2452
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-08 21:05:10 +00:00
..
all_test.go reflect: set dir when creating a channel via ChanOf 2015-01-04 19:42:14 +00:00
asm_386.s runtime: look up arg stackmap for makeFuncStub/methodValueStub during traceback 2014-09-12 07:29:19 -04:00
asm_amd64.s runtime: look up arg stackmap for makeFuncStub/methodValueStub during traceback 2014-09-12 07:29:19 -04:00
asm_amd64p32.s runtime: look up arg stackmap for makeFuncStub/methodValueStub during traceback 2014-09-12 07:29:19 -04:00
asm_arm.s runtime: look up arg stackmap for makeFuncStub/methodValueStub during traceback 2014-09-12 07:29:19 -04:00
asm_ppc64x.s all: power64 is now ppc64 2014-12-05 19:13:20 -05:00
deepequal.go build: move package sources from src/pkg to src 2014-09-08 00:08:51 -04:00
example_test.go build: move package sources from src/pkg to src 2014-09-08 00:08:51 -04:00
export_test.go reflect, runtime: gofmt 2014-12-26 04:43:33 +00:00
makefunc.go reflect: a few microoptimizations 2014-10-17 12:54:31 -04:00
set_test.go build: move package sources from src/pkg to src 2014-09-08 00:08:51 -04:00
tostring_test.go build: move package sources from src/pkg to src 2014-09-08 00:08:51 -04:00
type.go cmd/gc: pad structs which end in zero-sized fields 2015-01-08 21:05:10 +00:00
value.go reflect: add write barriers 2015-01-06 00:28:31 +00:00