w6c: return of a module-global struct ident copies the global's bytes
cstage zeroed the return scratch; mirror the landed wwstage emission (copy from the g(SB) base). Flips the F8-era residual row to cs==ww==correct. Task #42.
This commit is contained in:
@@ -13675,12 +13675,21 @@ cgstmt(Cg *c, Node *n, Local **locals, int *frame)
|
||||
scr + idx * esz));
|
||||
idx++;
|
||||
}
|
||||
} else if (n->lhs->kind == N_IDENT) {
|
||||
} else if (n->lhs->kind == N_IDENT
|
||||
&& localfind(*locals, n->lhs->str) != 0) {
|
||||
/* N_IDENT: word-copy rhs slot into
|
||||
* scratch. Whole 8B words via MOVQ;
|
||||
* trailing partial word via MOVL/MOVB
|
||||
* so we read no further than the
|
||||
* source slot's declared size. */
|
||||
* source slot's declared size.
|
||||
*
|
||||
* #42 (#263): only a LOCAL ident has a
|
||||
* BP slot. A module-global struct ident
|
||||
* (localfind==0) falls to the addr-copy
|
||||
* else below — aggarg_srcaddr lands
|
||||
* g(SB) in SI. Pre-fix this read frame
|
||||
* garbage off 0(BP). ww half landed
|
||||
* F8-c6. */
|
||||
int rhsoff = localfind(*locals,
|
||||
n->lhs->str);
|
||||
int k = 0;
|
||||
|
||||
Reference in New Issue
Block a user