default as first case
in a switch
SVN=123398
while(c1 != N) {
dynlineno = c1->lineno; // for diagnostics
if(c1->op != OCASE) {
- if(s0 == C)
+ if(s0 == C && dflt == P)
yyerror("unreachable statements in a switch");
gen(c1);
dflt = pc;
while(c2 != N) {
-
s = mal(sizeof(*s));
if(s0 == C)
s0 = s;
walktype(n->ninit, Etop);
walktype(n->ntest, Erv);
walktype(n->nbody, Etop);
+
// find common type
if(n->ntest->type == T)
n->ntest->type = walkswitch(n, sw1);
// set the type on all literals
if(n->ntest->type != T)
walkswitch(n, sw3);
-
- walktype(n->ntest, Erv);
-
- n = n->nincr;
- goto loop;
+ walktype(n->ntest, Erv); // BOTCH is this right
+ walktype(n->nincr, Erv);
+ goto ret;
case OEMPTY:
if(top != Etop)