1
0
mirror of https://github.com/golang/go synced 2024-11-18 23:34:45 -07:00

go.tools/go/types: fix StdSizes.Sizeof computation

Thanks to Travis Cline for finding this bug.

R=adonovan
CC=golang-dev
https://golang.org/cl/14752043
This commit is contained in:
Robert Griesemer 2013-10-16 10:45:58 -07:00
parent d8391b87d1
commit ac0a1222cb

View File

@ -105,7 +105,7 @@ func (s *StdSizes) Sizeof(T Type) int64 {
offsets := t.offsets
if t.offsets == nil {
// compute offsets on demand
offsets = stdSizes.Offsetsof(t.fields)
offsets = s.Offsetsof(t.fields)
t.offsets = offsets
}
return offsets[n-1] + s.Sizeof(t.fields[n-1].typ)