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

Issue 4398047: code review 4398047: gofmt: don't crash when rewriting nil interfaces in AST. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years ago by gri
Modified:
14 years ago
Reviewers:
CC:
rsc, r, golang-dev
Visibility:
Public.

Description

gofmt: don't crash when rewriting nil interfaces in AST. The new reflection API makes it an error to call value.Set(x) if x is invalid. Guard for it. Added corresponding test case. Fixes issue 1696.

Patch Set 1 #

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

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

Patch Set 4 : diff -r 00dbc1478eca https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 00dbc1478eca https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -0 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 4 chunks +16 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite1.golden View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite1.input View 1 1 chunk +4 lines, -0 lines 0 comments Download
A src/cmd/gofmt/testdata/rewrite2.golden View 1 1 chunk +10 lines, -0 lines 0 comments Download
A src/cmd/gofmt/testdata/rewrite2.input View 1 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 3
gri
Hello rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
14 years ago (2011-04-14 21:16:02 UTC) #1
r
LGTM
14 years ago (2011-04-14 21:17:30 UTC) #2
gri
14 years ago (2011-04-14 21:25:31 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=6aa7ab6b6a9d ***

gofmt: don't crash when rewriting nil interfaces in AST.

The new reflection API makes it an error to call value.Set(x)
if x is invalid. Guard for it.

Added corresponding test case.

Fixes issue 1696.

R=rsc, r
CC=golang-dev
http://codereview.appspot.com/4398047
Sign in to reply to this message.

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