]> Cypherpunks repositories - gostls13.git/commit
gofmt: fix a couple of crashes, disallow rewrites for incomplete programs
authorRobert Griesemer <gri@golang.org>
Wed, 12 Oct 2011 04:49:53 +0000 (21:49 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 12 Oct 2011 04:49:53 +0000 (21:49 -0700)
commite9ba607bf531c5e5b223a54c164714b6b00411a6
tree7b34f447e58cdbc0995232014d2dfb7661a6961c
parent187c3536a894b7d50db2133f3c8da1a6f6f1af9f
gofmt: fix a couple of crashes, disallow rewrites for incomplete programs

The current implementation of formatting for incomplete programs
cannot tolerate program rewrites; ignore -rewrite in that case
with a warning message (temporary solution).

Fix a couple of crashes that were introduced recently.

Fixes #2348.

R=rsc
CC=golang-dev
https://golang.org/cl/5233054
src/cmd/gofmt/gofmt.go
src/cmd/gofmt/rewrite.go