diff options
| author | Adam Langley <agl@golang.org> | 2009-11-13 11:29:13 -0800 |
|---|---|---|
| committer | Adam Langley <agl@golang.org> | 2009-11-13 11:29:13 -0800 |
| commit | 94b229c9b08b41907e3382f7112bea30574b197c (patch) | |
| tree | 2e3e31007e604c56fa114ae503dc5fc86f8d1755 /src/pkg/json/struct.go | |
| parent | 6462f9307491d37af52007ae41f72c5fc411e769 (diff) | |
| download | golang-94b229c9b08b41907e3382f7112bea30574b197c.tar.gz | |
json: fix addressing of slice indexes that are multiples of 8.
Fixes issue 147.
R=rsc
CC=golang-dev
http://codereview.appspot.com/152123
Diffstat (limited to 'src/pkg/json/struct.go')
| -rw-r--r-- | src/pkg/json/struct.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/json/struct.go b/src/pkg/json/struct.go index 3fcf00e89..d94988b64 100644 --- a/src/pkg/json/struct.go +++ b/src/pkg/json/struct.go @@ -154,7 +154,7 @@ func (b *structBuilder) Elem(i int) Builder { return &structBuilder{val: v.Elem(i)} } case *reflect.SliceValue: - if i > v.Cap() { + if i >= v.Cap() { n := v.Cap(); if n < 8 { n = 8 |
