Files
ww/selfhost
Hojun-Cho a1ee817906 selfhost/cmd/ww/main.ww: 3× ".\0" amalloc → stack [2]u8
dobuild/dorun/dotest each allocated a 2-byte heap "." prefix buffer via
amalloc, set dot[0]='.'; dot[1]=0; passed dot as *u8 to a callee, then
let the arena chunk live forever. The dot pointer never escapes the
function — every callee chain (resolvemodule, cstrendswithlit,
rundirtests/runsingletest) byte-copies its input into a fresh arena
allocation before returning, never storing the original pointer.

Replace with `let dot: [2]u8 = ['.': u8, 0u8]; ... &dot[0]`. Both
stages allocate a fresh frame slot per let at function-frame entry
(localoff cstage / localadd wwstage), so the slot lives across the
synchronous callee.

Verified 132/132 + 995_self_rebuild byte-identity.
2026-05-20 19:28:59 +09:00
..