From: Russ Cox Date: Thu, 15 Jul 2010 22:22:51 +0000 (-0700) Subject: gc: issue 901 X-Git-Tag: weekly.2010-07-29~97 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=31c07dfddf022c07e82c63f37c66825e1dfc2aa7;p=gostls13.git gc: issue 901 Fixes #901. R=ken2 CC=golang-dev https://golang.org/cl/1674049 --- diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index 8b8096400e..50d2ba3ea1 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -281,6 +281,13 @@ walkdef(Node *n) if(n->defn == N) { if(n->etype != 0) // like OPRINTN break; + if(nerrors > 0) { + // Can have undefined variables in x := foo + // that make x have an n->ndefn == nil. + // If there are other errors anyway, don't + // bother adding to the noise. + break; + } fatal("var without type, init: %S", n->sym); } if(n->defn->op == ONAME) {