Re: Go patch committed: Pad structs that end with a zero-sized field

2019-01-15 Thread Ian Lance Taylor
On Fri, Jan 11, 2019 at 3:16 PM Ian Lance Taylor wrote: > > This patch by Cherry Zhang changes the Go frontend to pad structs > ending with a zero-sized field. For a struct with zero-sized last > field, the address of the field falls out of the object boundary, > which confuses the garbage collec

Go patch committed: Pad structs that end with a zero-sized field

2019-01-11 Thread Ian Lance Taylor
This patch by Cherry Zhang changes the Go frontend to pad structs ending with a zero-sized field. For a struct with zero-sized last field, the address of the field falls out of the object boundary, which confuses the garbage collector. Pad an extra byte in this case. Bootstrapped and ran Go tests