From ac0a1222cb65222fce311782ccad7379c1c09490 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 16 Oct 2013 10:45:58 -0700 Subject: [PATCH] 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 --- go/types/sizes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/types/sizes.go b/go/types/sizes.go index 5d069a9371e..3c378117a95 100644 --- a/go/types/sizes.go +++ b/go/types/sizes.go @@ -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)