From: Ken Thompson Date: Mon, 28 Jun 2010 23:30:55 +0000 (-0700) Subject: compiler fatal error in switch. X-Git-Tag: weekly.2010-07-01~42 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2795282b50272b0f4d65513658bda5539d07b8a1;p=gostls13.git compiler fatal error in switch. fixes #867. R=rsc CC=golang-dev https://golang.org/cl/1691045 --- diff --git a/src/cmd/gc/swt.c b/src/cmd/gc/swt.c index 2ed8216bc0..fbc9c49030 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