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
1 changed files with 1 additions and 1 deletions

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)