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

Issue 5376061: code review 5376061: gofmt: leave nil nodes of the AST unchanged. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 8 months ago by remyoudompheng
Modified:
13 years, 8 months ago
Reviewers:
CC:
rsc, gri, golang-dev, remy_archlinux.org
Visibility:
Public.

Description

gofmt: leave nil nodes of the AST unchanged. Without this check, gofmt panics when trying to apply the identity transformation on "item.field" expressions. Fixes issue 2410.

Patch Set 1 #

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

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

Total comments: 2

Patch Set 4 : diff -r 5a1c75805f59 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -2 lines) Patch
M src/cmd/gofmt/gofmt_test.go View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/gofmt/rewrite.go View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
A src/cmd/gofmt/testdata/rewrite3.golden View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
A src/cmd/gofmt/testdata/rewrite3.input View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 7
remyoudompheng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com, remy@archlinux.org), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 8 months ago (2011-11-11 09:21:17 UTC) #1
rsc
Thanks for fixing this. http://codereview.appspot.com/5376061/diff/3001/src/cmd/gofmt/rewrite.go File src/cmd/gofmt/rewrite.go (right): http://codereview.appspot.com/5376061/diff/3001/src/cmd/gofmt/rewrite.go#newcode67 src/cmd/gofmt/rewrite.go:67: if (val.Kind() == reflect.Ptr || ...
13 years, 8 months ago (2011-11-11 19:51:37 UTC) #2
gri
In addition to rsc' comments. - gri http://codereview.appspot.com/5376061/diff/3001/src/cmd/gofmt/testdata/rewrite3.input File src/cmd/gofmt/testdata/rewrite3.input (right): http://codereview.appspot.com/5376061/diff/3001/src/cmd/gofmt/testdata/rewrite3.input#newcode6 src/cmd/gofmt/testdata/rewrite3.input:6: Can you ...
13 years, 8 months ago (2011-11-11 19:54:11 UTC) #3
remyoudompheng
Hello rsc@golang.org, gri@golang.org (cc: golang-dev@googlegroups.com, remy@archlinux.org), Please take another look.
13 years, 8 months ago (2011-11-11 21:56:23 UTC) #4
rsc
LGTM Leaving for gri.
13 years, 8 months ago (2011-11-11 21:58:20 UTC) #5
gri
LGTM. Much better. - gri
13 years, 8 months ago (2011-11-11 22:11:13 UTC) #6
gri
13 years, 8 months ago (2011-11-11 22:11:48 UTC) #7
*** Submitted as http://code.google.com/p/go/source/detail?r=b793c9ddf021 ***

gofmt: leave nil nodes of the AST unchanged.

Without this check, gofmt panics when trying to apply
the identity transformation on "item.field" expressions.
Fixes issue 2410.

R=rsc, gri
CC=golang-dev, remy
http://codereview.appspot.com/5376061

Committer: Robert Griesemer <gri@golang.org>
Sign in to reply to this message.

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