wwstage dotchainresolve gated its *T roots on an N_TPTR-over-N_TNAME
tnode; an inferred `let p = alloc(S{...})!` rides the checker-
SYNTHESIZED N_TPTR whose pointee is the struct BODY node (the #24
TNAME-normalize covers only the direct struct-lit binding), so the
root gate failed and chained p.field.pseudo reads fell to the
unfused deref arms — shape-only divergence vs cstage's type-keyed
fold (both stages runtime-correct; the historical field(SB) leak the
pin described was already fixed). Widen the local and global root
gates to accept the N_TSTRUCT pointee; correctness stays enforced by
the stamped-tinfo peel below (TY_PTR -> pointee TY_STRUCT).
Graduates alias_g73_heapfill out of DATABYTEID_DIVERGED (2 pins
remain, both the tagged-spill family); adds compile fixtures pinning
the newly-converged siblings (nested read+store, slice .cap,
inferred-global root; pin 1730/22/3460) and a runtime lang row that
mutates then re-points the heap base — a read bypassing the pointer
returns the wrong len.
17 lines
578 B
Plaintext
17 lines
578 B
Plaintext
//ww:compile
|
|
// nested-struct chained read + store through an INFERRED alloc pointer:
|
|
// the checker-synthesized N_TPTR carries the struct BODY node, and the
|
|
// dotchainresolve root gate must still fold (byte-id with the annotated
|
|
// twin and with cstage's type-keyed fold).
|
|
package main;
|
|
type inner = struct { a: int, b: int };
|
|
type outer = struct { i: inner, n: int };
|
|
export fn main() i32 = {
|
|
let p = alloc(outer { i = inner { a = 1, b = 2 }, n = 3 })!;
|
|
if (p.i.b != 2) { return 1; };
|
|
p.i.b = 9;
|
|
if (p.i.b != 9) { return 2; };
|
|
if (p.n != 3) { return 3; };
|
|
return 0;
|
|
};
|