]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: fix nil pointer dereference
authorDavid du Colombier <0intro@gmail.com>
Fri, 7 Feb 2014 14:43:40 +0000 (15:43 +0100)
committerDavid du Colombier <0intro@gmail.com>
Fri, 7 Feb 2014 14:43:40 +0000 (15:43 +0100)
LGTM=iant
R=golang-codereviews, dave, iant
CC=golang-codereviews
https://golang.org/cl/60740044

src/cmd/gc/typecheck.c

index 3c27d991543d4e1865c6eacdc225fd6807a283ae..7de01e3cf8d459a9740838293377a15318fcd420 100644 (file)
@@ -3199,7 +3199,7 @@ typecheckdef(Node *n)
                n->type->sym = n->sym;
                nerrors0 = nerrors;
                typecheckdeftype(n);
-               if(n->type->etype == TFORW && nerrors > nerrors0) {
+               if(n->type != T && n->type->etype == TFORW && nerrors > nerrors0) {
                        // Something went wrong during type-checking,
                        // but it was reported. Silence future errors.
                        n->type->broke = 1;