mirror of
https://github.com/golang/go
synced 2024-11-18 21:05:02 -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:
parent
d8391b87d1
commit
ac0a1222cb
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user