]> Cypherpunks repositories - gostls13.git/commitdiff
don't crash on:
authorRuss Cox <rsc@golang.org>
Fri, 16 Jan 2009 01:32:31 +0000 (17:32 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 16 Jan 2009 01:32:31 +0000 (17:32 -0800)
package main
var x int
type x struct { a int }

R=ken
OCL=22903
CL=22903

src/cmd/gc/dcl.c

index aab47b6539496d5ded2dfd5cf238d40a879cdd0e..50967b53e3efa1e54019b69044a2e670b0971be3 100644 (file)
@@ -63,7 +63,7 @@ dodcltype(Type *n)
        // if n has been forward declared,
        // use the Type* created then
        s = n->sym;
-       if(s->block == block) {
+       if(s->block == block && s->otype != T) {
                switch(s->otype->etype) {
                case TFORWSTRUCT:
                case TFORWINTER: