cgen: narrow 2-byte deref stores in the wwstage assign arm

The plain `*p = v` arm's storeop map handled 1- and 4-byte pointees
but let a 2-byte one fall to MOVQ, an 8-byte over-store that clobbers
six adjacent bytes (masked in the pinned fixture by the lone frame
slot; loud with `&a[0]` of a [4]i16). cstage fldstoreop maps 2 to
MOVW. Graduates r660_i16_out_param_negative.
This commit is contained in:
2026-08-07 23:48:36 +09:00
parent 83c8a4f34f
commit 58641e97a5
2 changed files with 3 additions and 2 deletions

View File

@@ -8955,7 +8955,8 @@ fn cgassign(c: *cgen, n: *syntax.node) void = {
typenodeprimresolved(c, pe, &ps, &uns);
};
if (ps == 1) { storeop = "MOVB"; }
else { if (ps == 4) { storeop = "MOVL"; }; };
else { if (ps == 2) { storeop = "MOVW"; }
else { if (ps == 4) { storeop = "MOVL"; }; }; };
}; }; };
};
// A slice IS the same 3-word {ptr,len,cap}