Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4871)

Issue 7490046: code review 7490046: encoding/json: properly handle extra objects with fixed... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by rick
Modified:
11 years, 1 month ago
Reviewers:
CC:
golang-dev, adg, rsc
Visibility:
Public.

Description

encoding/json: properly handle extra objects with fixed size arrays If a fixed size array is passed in as the decode target and the JSON to decode has extra array elements that are objects, then previously the decoder would return a "data changing underfoot" error. Fixes issue 3717.

Patch Set 1 #

Patch Set 2 : diff -r 3ab94dcee59a https://code.google.com/p/go #

Patch Set 3 : diff -r 3ab94dcee59a https://code.google.com/p/go #

Total comments: 1

Patch Set 4 : diff -r 3ab94dcee59a https://code.google.com/p/go #

Patch Set 5 : diff -r 3ab94dcee59a https://code.google.com/p/go #

Total comments: 2

Patch Set 6 : diff -r 3ab94dcee59a https://code.google.com/p/go #

Total comments: 2

Patch Set 7 : diff -r 3ab94dcee59a https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -0 lines) Patch
M src/pkg/encoding/json/decode.go View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M src/pkg/encoding/json/decode_test.go View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 9
rick
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 1 month ago (2013-03-12 02:02:15 UTC) #1
rick
https://codereview.appspot.com/7490046/diff/5001/src/pkg/encoding/json/decode.go File src/pkg/encoding/json/decode.go (right): https://codereview.appspot.com/7490046/diff/5001/src/pkg/encoding/json/decode.go#newcode394 src/pkg/encoding/json/decode.go:394: m := make(map[string]interface{}) I couldn't find a more efficient ...
11 years, 1 month ago (2013-03-12 02:02:47 UTC) #2
rick
PTAL
11 years, 1 month ago (2013-03-12 23:02:48 UTC) #3
adg
https://codereview.appspot.com/7490046/diff/14001/src/pkg/encoding/json/decode_test.go File src/pkg/encoding/json/decode_test.go (right): https://codereview.appspot.com/7490046/diff/14001/src/pkg/encoding/json/decode_test.go#newcode1186 src/pkg/encoding/json/decode_test.go:1186: json := `["article",{"category":1}, {"type": "foo"}, 2, {"data": {"bar": "baz"}}, ...
11 years, 1 month ago (2013-03-13 02:23:40 UTC) #4
rick
PTAL https://codereview.appspot.com/7490046/diff/14001/src/pkg/encoding/json/decode_test.go File src/pkg/encoding/json/decode_test.go (right): https://codereview.appspot.com/7490046/diff/14001/src/pkg/encoding/json/decode_test.go#newcode1186 src/pkg/encoding/json/decode_test.go:1186: json := `["article",{"category":1}, {"type": "foo"}, 2, {"data": {"bar": ...
11 years, 1 month ago (2013-03-13 02:50:26 UTC) #5
adg
https://codereview.appspot.com/7490046/diff/22001/src/pkg/encoding/json/decode.go File src/pkg/encoding/json/decode.go (right): https://codereview.appspot.com/7490046/diff/22001/src/pkg/encoding/json/decode.go#newcode397 src/pkg/encoding/json/decode.go:397: d.value(reflect.Value{}) I just don't see why this shouldn't work. ...
11 years, 1 month ago (2013-03-13 05:38:58 UTC) #6
rick
PTAL https://codereview.appspot.com/7490046/diff/22001/src/pkg/encoding/json/decode.go File src/pkg/encoding/json/decode.go (right): https://codereview.appspot.com/7490046/diff/22001/src/pkg/encoding/json/decode.go#newcode397 src/pkg/encoding/json/decode.go:397: d.value(reflect.Value{}) On 2013/03/13 05:38:58, adg wrote: > I ...
11 years, 1 month ago (2013-03-13 13:59:34 UTC) #7
rsc
LGTM
11 years, 1 month ago (2013-03-13 18:51:41 UTC) #8
rsc
11 years, 1 month ago (2013-03-13 18:53:07 UTC) #9
*** Submitted as https://code.google.com/p/go/source/detail?r=088249126434 ***

encoding/json: properly handle extra objects with fixed size arrays

If a fixed size array is passed in as the decode target and the JSON
to decode has extra array elements that are objects, then previously
the decoder would return a "data changing underfoot" error.

Fixes issue 3717.

R=golang-dev, adg, rsc
CC=golang-dev
https://codereview.appspot.com/7490046

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b