cmd: α/γ-5 rt.malloc/amalloc → alloc([], N)! (w6l stack-promotes + cgenutil mkvarargname)
Phase 0 #8/#11 small batch. 4 sites:
w6l/main.ww δ stack-promotes (3):
- :67 appenddec — 16B → [16]u8
- :106 islinkable — 8B → [8]u8, &mp[0] to os.read
- :176 isso — 20B → [20]u8, &mp[0] to os.read
wcc/cgenutil.ww:108 mkvarargname α (1):
- amalloc → alloc([], n)!. Standard slice indexing
(`p[k]` not `p.ptr[k]`) — ww's slice subscript has no
bounds check (cgenexpr.ww:816-856 in cgindex), same
shape as the dup pilot (4c07ef0).
Closes #11 (arenau64tos was re-routed via #8 separately;
the δ-shape was the genuinely trivial case). Advances #46.
Verified 132/132 + 995_self_rebuild byte-identity.
This commit is contained in:
@@ -105,12 +105,12 @@ fn mkvarargname(c: *cgen, prefix: str, seq: i32) str = {
|
||||
let dk: i32 = 0;
|
||||
for (dk < n) { buf[i + dk] = ns.ptr[dk]; dk += 1; };
|
||||
let total: i32 = i + n;
|
||||
let p: *u8 = amalloc(c.a, (total: u64) + 1u64): *u8;
|
||||
let p: []u8 = alloc([], (total: u64) + 1u64)!;
|
||||
let k: i32 = 0;
|
||||
for (k < total) { p[k] = buf[k]; k += 1; };
|
||||
p[total] = 0u8;
|
||||
let r: str;
|
||||
r.ptr = p;
|
||||
r.ptr = p.ptr;
|
||||
r.len = total;
|
||||
return r;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user