w6c: forrange bind cap loud; drain widen gates keyed on type-eq (#55)

Two silent seams in one sweep. The for-range destructure silently
dropped the 9th+ binding in both stages (bind arrays are sized 8);
the cap now hard-stops per the DEFER_MAX/LOOP_MAX discipline (the
shape is unreachable today -- every wide-tuple construction path
already loud-stops). argtaggedwidensz, the drain-side SSoT for
widened call args, still keyed "natural push" on slot-size equality
while pushargsrev flipped to type equality with #55 -- a same-slot
subset was classified widen by push, natural by drain (counts
coincide today; a classification reader desyncs, the #48 shape).
Both sides now share the wsame key; the widen-branch tag miss for a
concrete source joins the task-2 loud-stop family (tagged subset
sources keep t=0 -- their widentag is never read, the scratch store
remaps).

Lead 17 (enum fold-failure prev+1) DISPROVED: enumvalfold gates
every member init in the checker and its fold set is op-for-op
equal to cgen's enumevalmember, so the fallback only runs inside
already-failing compiles.
This commit is contained in:
2026-08-09 00:52:27 +09:00
parent 973dd964c9
commit f06c95e66b
5 changed files with 67 additions and 14 deletions

View File

@@ -3892,8 +3892,14 @@ fn cgforrange(c: *cgen, n: *syntax.node) void = {
let field_off: i32 = 0;
let m: *syntax.node = n.list;
for (m != nil) {
if (nbinds >= 8) { m = nil; }
else {
// bind_* arrays are sized 8; a 9th binding silently
// vanished pre-gate (rule 7 — the DEFER_MAX/LOOP_MAX
// cap discipline).
if (nbinds >= 8) {
let mfr: str = "for-range destructure: more than 8 bindings (rule 7)\n";
os.write(2, mfr.ptr, mfr.len: u64);
os.exit(1);
} else {
let fsz: i32 = 8;
let signf: bool = false;
// tp walks the N_TPARAM wrapper chain; tpt is the