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

Issue 6945065: code review 6945065: encoding/json: don't panic marshaling anonymous non-str... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 6 months ago by tkappler
Modified:
13 years, 5 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

encoding/json: don't panic marshaling anonymous non-struct field Add a check for this case and don't try to follow the anonymous type's non-existent fields. Fixes issue 4474.

Patch Set 1 #

Patch Set 2 : diff -r a70be086fe02 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r a70be086fe02 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 4 : diff -r 111aa291b561 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -7 lines) Patch
M src/pkg/encoding/json/encode.go View 1 2 3 2 chunks +9 lines, -7 lines 0 comments Download
M src/pkg/encoding/json/encode_test.go View 1 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 8
tkappler
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 6 months ago (2012-12-16 15:06:00 UTC) #1
rsc
https://codereview.appspot.com/6945065/diff/4001/src/pkg/encoding/json/encode.go File src/pkg/encoding/json/encode.go (right): https://codereview.appspot.com/6945065/diff/4001/src/pkg/encoding/json/encode.go#newcode621 src/pkg/encoding/json/encode.go:621: if name != "" || !sf.Anonymous { Can you ...
13 years, 6 months ago (2012-12-17 00:37:40 UTC) #2
tkappler
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 6 months ago (2012-12-17 20:45:09 UTC) #3
tkappler
On 2012/12/17 00:37:40, rsc wrote: > https://codereview.appspot.com/6945065/diff/4001/src/pkg/encoding/json/encode.go > File src/pkg/encoding/json/encode.go (right): > > https://codereview.appspot.com/6945065/diff/4001/src/pkg/encoding/json/encode.go#newcode621 > ...
13 years, 6 months ago (2012-12-17 20:48:47 UTC) #4
rsc
LGTM
13 years, 6 months ago (2012-12-22 14:49:24 UTC) #5
rsc
It looks like you need to complete a CLA as described at http://golang.org/doc/contribute.html#copyright. Thanks.
13 years, 6 months ago (2012-12-22 14:54:14 UTC) #6
tkappler
On 2012/12/22 14:54:14, rsc wrote: > It looks like you need to complete a CLA ...
13 years, 6 months ago (2012-12-26 09:14:57 UTC) #7
rsc
13 years, 6 months ago (2013-01-02 22:39:48 UTC) #8
*** Submitted as https://code.google.com/p/go/source/detail?r=94f706ea3818 ***

encoding/json: don't panic marshaling anonymous non-struct field

Add a check for this case and don't try to follow the anonymous
type's non-existent fields.

Fixes issue 4474.

R=rsc
CC=golang-dev
https://codereview.appspot.com/6945065

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