wcc_ww/check: tuple size() fold reads the type table — packed-sum C-t0 escape (#22 commit 0)
The wwstage size()/align() fold walks the AST (astsize), and its
N_TTUPLE arm still summed PACKED element sizes — C-t0 flipped the
checker type table (tupleelemslot) and cstage's N_TTUPLE to the
ratified slot layout but missed this second wwstage sizer.
size((u32,u32)) folded to 16 on cstage and 8 on wwstage: a silent
cs≠ww in every folded tuple-size constant, plus the recursive
escapes (a tuple inside struct/array size computation under the
fold). Runtime-confirmed at 74767c7.
astsize N_TTUPLE now reads the tuple tinfo, making tupleelemslot
the single wwstage tuple sizer; the tagged-element slot fix (#22
22a) lands in that one place next. 941 gains c0_sizefold_slot +
c0_sizefold_recursive rows (exit-checked under both drivers +
byte-id).
This commit is contained in:
@@ -11309,13 +11309,15 @@ fn astsize(c: *checker, t: *node) i64 = {
|
||||
return astsize(c, t.lhs) * elen;
|
||||
};
|
||||
if (k == nkind.N_TTUPLE) {
|
||||
let total: i64 = 0i64;
|
||||
let p: *node = t.list;
|
||||
for (p != nil) {
|
||||
total += astsize(c, p.lhs);
|
||||
p = p.next;
|
||||
};
|
||||
return total;
|
||||
// Route through the type table, NOT a packed element-sum:
|
||||
// slot layout is the tuple SSoT (C-t0, user-ratified) and
|
||||
// tupleelemslot is its one wwstage answer. The packed walk
|
||||
// this replaces was a C-t0 escape — size((u32,u32)) folded
|
||||
// to 8 here while cstage (check.c N_TTUPLE) and the wwstage
|
||||
// type table both said 16 (task #22 commit 0).
|
||||
let ti: *tinfo = tinfofornode(c, t);
|
||||
if (ti != nil) { return ti.size: i64; };
|
||||
return 0i64;
|
||||
};
|
||||
if (k == nkind.N_TSTRUCT) {
|
||||
let off: i64 = 0i64;
|
||||
|
||||
@@ -1045,13 +1045,15 @@ fn astsize(c: *checker, t: *node) i64 = {
|
||||
return astsize(c, t.lhs) * elen;
|
||||
};
|
||||
if (k == nkind.N_TTUPLE) {
|
||||
let total: i64 = 0i64;
|
||||
let p: *node = t.list;
|
||||
for (p != nil) {
|
||||
total += astsize(c, p.lhs);
|
||||
p = p.next;
|
||||
};
|
||||
return total;
|
||||
// Route through the type table, NOT a packed element-sum:
|
||||
// slot layout is the tuple SSoT (C-t0, user-ratified) and
|
||||
// tupleelemslot is its one wwstage answer. The packed walk
|
||||
// this replaces was a C-t0 escape — size((u32,u32)) folded
|
||||
// to 8 here while cstage (check.c N_TTUPLE) and the wwstage
|
||||
// type table both said 16 (task #22 commit 0).
|
||||
let ti: *tinfo = tinfofornode(c, t);
|
||||
if (ti != nil) { return ti.size: i64; };
|
||||
return 0i64;
|
||||
};
|
||||
if (k == nkind.N_TSTRUCT) {
|
||||
let off: i64 = 0i64;
|
||||
|
||||
@@ -11309,13 +11309,15 @@ fn astsize(c: *checker, t: *node) i64 = {
|
||||
return astsize(c, t.lhs) * elen;
|
||||
};
|
||||
if (k == nkind.N_TTUPLE) {
|
||||
let total: i64 = 0i64;
|
||||
let p: *node = t.list;
|
||||
for (p != nil) {
|
||||
total += astsize(c, p.lhs);
|
||||
p = p.next;
|
||||
};
|
||||
return total;
|
||||
// Route through the type table, NOT a packed element-sum:
|
||||
// slot layout is the tuple SSoT (C-t0, user-ratified) and
|
||||
// tupleelemslot is its one wwstage answer. The packed walk
|
||||
// this replaces was a C-t0 escape — size((u32,u32)) folded
|
||||
// to 8 here while cstage (check.c N_TTUPLE) and the wwstage
|
||||
// type table both said 16 (task #22 commit 0).
|
||||
let ti: *tinfo = tinfofornode(c, t);
|
||||
if (ti != nil) { return ti.size: i64; };
|
||||
return 0i64;
|
||||
};
|
||||
if (k == nkind.N_TSTRUCT) {
|
||||
let off: i64 = 0i64;
|
||||
|
||||
Reference in New Issue
Block a user