amd64: Fix incorrect store width for structure array elements
authorRobert Pengelly <robertapengelly@hotmail.com>
Mon, 9 Nov 2026 20:52:28 +0000 (20:52 +0000)
committerRobert Pengelly <robertapengelly@hotmail.com>
Mon, 9 Nov 2026 20:52:28 +0000 (20:52 +0000)
amd64.c

diff --git a/amd64.c b/amd64.c
index d2c4845ef2ea66510e60f57453ba0184fcd811c1..a9f77b3e667fc6cdcb5deffe71f7e1e26da696a6 100644 (file)
--- a/amd64.c
+++ b/amd64.c
@@ -17357,6 +17357,7 @@ static int emit_parse_postfix_copy_source_address_now (const char *reg, struct l
         if (tok.kind == TOK_LBRACK) {
         
             int elem_size = last_elem_size;
+            int member_seen = postfix_member_seen;
             
             if (!have_address) {
             
@@ -17419,9 +17420,10 @@ static int emit_parse_postfix_copy_source_address_now (const char *reg, struct l
              * storage size as the scalar load width (e.g. UINT8 Length[2]
              * becomes a 16-bit load for Length[i]).
              */
-            if (postfix_member_seen) {
+            if (member_seen) {
             
                 postfix_member_size = index_step_size (elem_size);
+                postfix_member_seen = 1;
                 
                 if (postfix_member_pointer_depth > 0) {
                     postfix_member_pointer_depth--;