summaryrefslogtreecommitdiff
path: root/src/cmd/gc
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
commit4fc2828086c7ec572ca3edbfbb8ecabf84c57f33 (patch)
treeefdf05ce36278e2f6ea169ff6a554eb35c3259db /src/cmd/gc
parent8d4ed516d027e0b5b38b0cd6106cd9bb3bf95fd5 (diff)
downloadgo-4fc2828086c7ec572ca3edbfbb8ecabf84c57f33.tar.gz
compiler fatal error in switch.
fixes issue 867. R=rsc CC=golang-dev http://codereview.appspot.com/1691045
Diffstat (limited to 'src/cmd/gc')
-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