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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user