surprisingly, a duplicate case can cause 5c to loop generating instructions until memory runs out. better to stop cc/pswt.c once the case is known to be wrong. it doesn't cause 8c to fail because it doesn't do the direct case the same way while(q->val != v) { nextpc(); p->as = ABCASE; patch(p, def); v++; } and the subsequent v++ for the next case doesn't expect a matching pair of q->val. Reference: /n/sources/patch/applied/swt-dup Date: Mon Nov 30 17:50:48 CET 2009 Signed-off-by: forsyth@terzarima.net --- /sys/src/cmd/cc/pswt.c Mon Nov 30 17:46:56 2009 +++ /sys/src/cmd/cc/pswt.c Mon Nov 30 17:46:54 2009 @@ -18,6 +18,7 @@ Case *c; C1 *q, *iq; long def, nc, i, isv; + int dup; def = 0; nc = 0; @@ -51,9 +52,14 @@ if(debug['W']) for(i=0; i