wcc/ww: global-str default-hi slice arg loads its len word

Slicing a module-global str with default hi emitted nothing for the
bound; load the len word from g(SB)+8 (mirror the cstage twin).
Review item #47; dual-stage rows red-proven.
This commit is contained in:
2026-06-12 09:00:15 +09:00
parent fee84528da
commit 1eceb46ac3
5 changed files with 202 additions and 3 deletions

View File

@@ -620,7 +620,14 @@ fn pushargsrev(c: *cgen, arg: *node, param: *node, memphase: bool) i32 = {
emitsymname(c, globalname);
emitline("(SB), CX\n");
emitline("\tMOVQ\t8(CX), AX\n");
};};
} else { if (globaltn.kind == nkind.N_TNAME) {
if (streq(globaltn.str, "str")) {
emitline("\tLEAQ\t");
emitsymname(c, globalname);
emitline("(SB), CX\n");
emitline("\tMOVQ\t8(CX), AX\n");
};
};};};
// #60: alias-NAMED global base default-hi — chased
// kind; runtime-unreachable until #77/#78 global DATA.
if (bu60 != nil) {