]> Cypherpunks repositories - gostls13.git/commitdiff
compiler fatal error in switch.
authorKen Thompson <ken@golang.org>
Mon, 28 Jun 2010 23:30:55 +0000 (16:30 -0700)
committerKen Thompson <ken@golang.org>
Mon, 28 Jun 2010 23:30:55 +0000 (16:30 -0700)
fixes #867.

R=rsc
CC=golang-dev
https://golang.org/cl/1691045

src/cmd/gc/swt.c

index 2ed8216bc0d7ec9b29de598568a6f3371a817c1a..fbc9c49030a66de129bda4af85427edb5fd9a231 100644 (file)
@@ -777,11 +777,12 @@ typeswitch(Node *sw)
                // binary search among cases to narrow by hash
                cas = list(cas, typebsw(c1, ncase));
        }
-       
-       cas = list(cas, def);
-       sw->nbody = concat(cas, sw->nbody);
-       sw->list = nil;
-       walkstmtlist(sw->nbody);
+       if(nerrors == 0) {
+               cas = list(cas, def);
+               sw->nbody = concat(cas, sw->nbody);
+               sw->list = nil;
+               walkstmtlist(sw->nbody);
+       }
 }
 
 void