summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2010-06-28 16:30:55 -0700
committerKen Thompson <ken@golang.org>2010-06-28 16:30:55 -0700
commita869874499b802e10d2cda5fa9b2d055cd97c745 (patch)
treeefdf05ce36278e2f6ea169ff6a554eb35c3259db
parent9c97bd7654b9386bf964bc1466c213dbabaa1e62 (diff)
downloadgolang-a869874499b802e10d2cda5fa9b2d055cd97c745.tar.gz
compiler fatal error in switch.
fixes issue 867. R=rsc CC=golang-dev http://codereview.appspot.com/1691045
-rw-r--r--src/cmd/gc/swt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cmd/gc/swt.c b/src/cmd/gc/swt.c
index 2ed8216bc..fbc9c4903 100644
--- a/src/cmd/gc/swt.c
+++ b/src/cmd/gc/swt.c
@@ -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