The selfhost checker's resolvewalk had no loop-nesting guard and no N_BREAK/N_CONTINUE arm, so `break`/`continue` outside any loop fell through the generic child recursion and was silently accepted -- while cstage (cmd/wcc/check.c) correctly rejects them. A cs!=ww checker divergence (rule 10); cstage is correct (break/continue outside a loop is an error in Hare/C/Go), so align wwstage DOWN, not cstage up. Mirror cstage's mechanism exactly (check.c:598/2494/2529/2611): a `loops` counter incremented around for and for-range bodies -- the for-`else` and the init/cond/post walked OUTSIDE the count, since a break there targets an enclosing loop -- rejecting break/continue when loops==0 with a byte-identical `file:line:col: error: <kw> outside loop` diagnostic. match/switch are not loop targets, matching cstage. The divergence survived because 300_check.c only exercised the in-process C checker, never w6c_ww; the fix adds 4 rows to the both-stage 989_catA_f2_reject carrier (break/continue outside loop, the for-else els-outside-count edge, and an in-loop control). make clean && make test: all 402 passed, byte-id self-compile gates 990-996 green.
299 KiB
299 KiB