wcc_ww/check: c3 spread-member + &len/cap base walks chase the full alias chain
F2a batch-4 c3, the check.ww behavior pair (exact set). Both cs twins
ALREADY full-chase at this SHA — ww-only align-up, no fuse:
B1 (check.ww:2038 census line; peel was at :2041 post-c1): the
`...inner` spread member peeled ONE level, so a 2-level-alias inner
union escaped the TY_TAGGED splice test and rode as a SURFACE member —
the outer box sized off the inner union's own header (probe sp_alias2:
runtime 0/0 BOTH but byte-DIVERGE, ww frame $48 vs $32). cs twin
chases (check.c:755 type_chase_named, the spec's :660-667 cite moved).
Fix: vu = tichase(vu) under the isspread gate, mirroring cs's
`spread ? type_chase_named(vt) : vt`. sp_alias2 graduates 0/0 byte-id;
sp_alias1 1-level control held throughout.
B2 (check.ww:2273/:2275): the &x.len/&x.cap base walk hand-peeled
NAMED->PTR->NAMED one level per hop — 2-level alias bases fell out of
the slice/str detect and took the generic *opt typing. cs twin chases
both hops (check.c:1198-1201). Fix: tichase per hop, exact cs mirror.
B2 ROUTE-TRACE (flagged, not edited): the spec's "post 0/0" cell for
amplen2 is NOT achievable inside this grant — OBSERVED pre-fix that
ww dies LATER at the cgen ADDRESS tail ("unsupported address-of
shape") for ALL alias bases 1+ LEVEL (cs runs 0): task #96 (ken
b4-oracle), a cgenexpr.ww site outside c3's check.ww set. The chase
here aligns the stamped type only (latent until #96); rows pinned
LOUD-HOLD via the new K_RUN_CS_WWERR kind (cs builds+runs; the ww
build must keep FAILING loud with the pinned diagnostic — a silent
ww accept-and-run is the regression the bound row exists to catch),
citing #96; they graduate K_RUN with it. Also OBSERVED: the let-init
spelling (`let s: sl1 = [1,2,3]`) is blocked further upstream by the
rows use the param route.
Pin rows (944): sp_alias1 K_RUN hold, sp_alias2 K_RUN graduation,
amplen_plain K_RUN control hold, amplen1/amplen2/ampcap2
K_RUN_CS_WWERR LOUD-HOLD bound on #96 (ww leg asserts "unsupported
address-of shape"). 944: 196/196.
Corpus: five-mains NEUTRAL vs base on identical inputs, cs==ww holds
(both clusters zero-in-corpus). combined.ww regens ride along.
This commit is contained in:
@@ -12308,11 +12308,11 @@ fn tinfofornode(c: *checker, n: *node) *tinfo = {
|
||||
if (circularnamed(c, vt, v)) { vt = c.tc.tyerr; };
|
||||
let isspread: bool = (v.op == tkind.TK_ELLIPSIS);
|
||||
let vu: *tinfo = vt;
|
||||
if (isspread) {
|
||||
if (vu != nil) {
|
||||
if (vu.kind == tykind.TY_NAMED) { vu = vu.under; };
|
||||
};
|
||||
};
|
||||
// Full chase (F2a batch-4 c3-B1): the single peel left a
|
||||
// 2-level-alias inner union a SURFACE member — the box
|
||||
// sized off the inner union's own header, not its
|
||||
// spliced variants (cs twin check.c:755 chases).
|
||||
if (isspread) { vu = tichase(vu); };
|
||||
if (isspread && vu != nil && vu.kind == tykind.TY_TAGGED) {
|
||||
// #209: a `...inner` spread's PAYLOAD is its
|
||||
// members, not the whole inner union — size/align
|
||||
@@ -12544,10 +12544,17 @@ fn unoptype(c: *checker, e: *node) *node = {
|
||||
if (streq(fld, "len") || streq(fld, "cap")) {
|
||||
let base: *node = e.lhs.lhs;
|
||||
if (base != nil && base.type_ != nil) {
|
||||
let bu: *tinfo = base.type_: *tinfo;
|
||||
if (bu != nil && bu.kind == tykind.TY_NAMED) { bu = bu.under; };
|
||||
// Full chase per hop (F2a batch-4 c3-B2):
|
||||
// the one-peel-per-hop walk lost 2-level
|
||||
// alias bases out of the slice/str detect
|
||||
// (cs twin check.c:1198-1201 chases both
|
||||
// hops). NOTE the ww cgen ADDRESS tail
|
||||
// stays loud for ALL alias bases (task
|
||||
// #96) — this aligns the stamped type
|
||||
// only; rows graduate with #96.
|
||||
let bu: *tinfo = tichase(base.type_: *tinfo);
|
||||
if (bu != nil && bu.kind == tykind.TY_PTR) { bu = bu.sub; };
|
||||
if (bu != nil && bu.kind == tykind.TY_NAMED) { bu = bu.under; };
|
||||
bu = tichase(bu);
|
||||
if (bu != nil) {
|
||||
if (bu.kind == tykind.TY_SLICE || bu.kind == tykind.TY_STR) {
|
||||
let pp: *node = newnode(nkind.N_TPTR, "", 0, 0);
|
||||
|
||||
@@ -2036,11 +2036,11 @@ fn tinfofornode(c: *checker, n: *node) *tinfo = {
|
||||
if (circularnamed(c, vt, v)) { vt = c.tc.tyerr; };
|
||||
let isspread: bool = (v.op == tkind.TK_ELLIPSIS);
|
||||
let vu: *tinfo = vt;
|
||||
if (isspread) {
|
||||
if (vu != nil) {
|
||||
if (vu.kind == tykind.TY_NAMED) { vu = vu.under; };
|
||||
};
|
||||
};
|
||||
// Full chase (F2a batch-4 c3-B1): the single peel left a
|
||||
// 2-level-alias inner union a SURFACE member — the box
|
||||
// sized off the inner union's own header, not its
|
||||
// spliced variants (cs twin check.c:755 chases).
|
||||
if (isspread) { vu = tichase(vu); };
|
||||
if (isspread && vu != nil && vu.kind == tykind.TY_TAGGED) {
|
||||
// #209: a `...inner` spread's PAYLOAD is its
|
||||
// members, not the whole inner union — size/align
|
||||
@@ -2272,10 +2272,17 @@ fn unoptype(c: *checker, e: *node) *node = {
|
||||
if (streq(fld, "len") || streq(fld, "cap")) {
|
||||
let base: *node = e.lhs.lhs;
|
||||
if (base != nil && base.type_ != nil) {
|
||||
let bu: *tinfo = base.type_: *tinfo;
|
||||
if (bu != nil && bu.kind == tykind.TY_NAMED) { bu = bu.under; };
|
||||
// Full chase per hop (F2a batch-4 c3-B2):
|
||||
// the one-peel-per-hop walk lost 2-level
|
||||
// alias bases out of the slice/str detect
|
||||
// (cs twin check.c:1198-1201 chases both
|
||||
// hops). NOTE the ww cgen ADDRESS tail
|
||||
// stays loud for ALL alias bases (task
|
||||
// #96) — this aligns the stamped type
|
||||
// only; rows graduate with #96.
|
||||
let bu: *tinfo = tichase(base.type_: *tinfo);
|
||||
if (bu != nil && bu.kind == tykind.TY_PTR) { bu = bu.sub; };
|
||||
if (bu != nil && bu.kind == tykind.TY_NAMED) { bu = bu.under; };
|
||||
bu = tichase(bu);
|
||||
if (bu != nil) {
|
||||
if (bu.kind == tykind.TY_SLICE || bu.kind == tykind.TY_STR) {
|
||||
let pp: *node = newnode(nkind.N_TPTR, "", 0, 0);
|
||||
|
||||
@@ -12308,11 +12308,11 @@ fn tinfofornode(c: *checker, n: *node) *tinfo = {
|
||||
if (circularnamed(c, vt, v)) { vt = c.tc.tyerr; };
|
||||
let isspread: bool = (v.op == tkind.TK_ELLIPSIS);
|
||||
let vu: *tinfo = vt;
|
||||
if (isspread) {
|
||||
if (vu != nil) {
|
||||
if (vu.kind == tykind.TY_NAMED) { vu = vu.under; };
|
||||
};
|
||||
};
|
||||
// Full chase (F2a batch-4 c3-B1): the single peel left a
|
||||
// 2-level-alias inner union a SURFACE member — the box
|
||||
// sized off the inner union's own header, not its
|
||||
// spliced variants (cs twin check.c:755 chases).
|
||||
if (isspread) { vu = tichase(vu); };
|
||||
if (isspread && vu != nil && vu.kind == tykind.TY_TAGGED) {
|
||||
// #209: a `...inner` spread's PAYLOAD is its
|
||||
// members, not the whole inner union — size/align
|
||||
@@ -12544,10 +12544,17 @@ fn unoptype(c: *checker, e: *node) *node = {
|
||||
if (streq(fld, "len") || streq(fld, "cap")) {
|
||||
let base: *node = e.lhs.lhs;
|
||||
if (base != nil && base.type_ != nil) {
|
||||
let bu: *tinfo = base.type_: *tinfo;
|
||||
if (bu != nil && bu.kind == tykind.TY_NAMED) { bu = bu.under; };
|
||||
// Full chase per hop (F2a batch-4 c3-B2):
|
||||
// the one-peel-per-hop walk lost 2-level
|
||||
// alias bases out of the slice/str detect
|
||||
// (cs twin check.c:1198-1201 chases both
|
||||
// hops). NOTE the ww cgen ADDRESS tail
|
||||
// stays loud for ALL alias bases (task
|
||||
// #96) — this aligns the stamped type
|
||||
// only; rows graduate with #96.
|
||||
let bu: *tinfo = tichase(base.type_: *tinfo);
|
||||
if (bu != nil && bu.kind == tykind.TY_PTR) { bu = bu.sub; };
|
||||
if (bu != nil && bu.kind == tykind.TY_NAMED) { bu = bu.under; };
|
||||
bu = tichase(bu);
|
||||
if (bu != nil) {
|
||||
if (bu.kind == tykind.TY_SLICE || bu.kind == tykind.TY_STR) {
|
||||
let pp: *node = newnode(nkind.N_TPTR, "", 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user