Commit a0a14b98 authored by Ken Thompson's avatar Ken Thompson

empty switches -- bug128

R=r
OCL=20520
CL=20522
parent c597845e
......@@ -536,6 +536,8 @@ swgen(Node *n)
c1 = listfirst(&save1, &n->nbody);
while(c1 != N) {
setlineno(c1);
if(c1->op == OEMPTY)
break;
if(c1->op != OCASE) {
if(s0 == C && dflt == P)
yyerror("unreachable statements in a switch");
......
......@@ -277,9 +277,7 @@ loop:
if(top != Etop)
goto nottop;
if(!casebody(n->nbody))
yyerror("switch statement must have case labels");
casebody(n->nbody);
if(n->ntest == N)
n->ntest = booltrue;
walkstate(n->ninit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment