Pre-existing landmine surfaced by #5. For a struct literal whose field value is itself an N_STRUCTLIT of a struct-typed field, the inline field-walk did `cgexpr(field.lhs); store-AX-sized`. cgexpr has no whole-struct-in-register convention, so the nested literal landed AX = first qword and the trailing bytes silently stayed zero (or stack garbage). Three BP-relative sites in each stage hit it: N_LET, N_ASSIGN N_IDENT-lhs, and N_RETURN N_STRUCTLIT. Fix: shared cg_structlit_fill_bp (cstage) / cgstructlitfillbp (wwstage) helper handles TK_ELLIPSIS autofill, tagged-field widening, float vs scalar store dispatch, AND recurses on struct-typed N_STRUCTLIT field values at bp_off + field_off. All 3 sites in each stage now call the helper instead of the inline walk. Scalar store dispatch is the explicit {1->MOVB, 4->MOVL, else MOVQ} shape (not fieldstoreop, which would emit MOVW for fsz==2) to stay byte-identical with cstage pending task #13. Sister N_ASSIGN N_DOT structlit walks (via_ptr / global / BP-relative-through-N_DOT) keep their inline walk and still drop nested-STRUCTLIT silently — tracked as task #18. 703 covers 6 rows: let_nested_i64, let_nested_3deep, let_nested_i32, let_nested_middle (i64; switch to i32 once #15 lands), assign_ident_nested, return_nested. 995_self_rebuild byte-identity preserved.
8.8 KiB
8.8 KiB