Fixed I386 64-bit shift of structure members
authorRobert Pengelly <robertapengelly@hotmail.com>
Thu, 17 Sep 2026 19:20:19 +0000 (20:20 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Thu, 17 Sep 2026 19:20:19 +0000 (20:20 +0100)
i386.c

diff --git a/i386.c b/i386.c
index f9e93341378c2a33cc383d756612f60e51f7263b..bcdc45e88bd169da504d56179defd7b0cca28a27 100644 (file)
--- a/i386.c
+++ b/i386.c
@@ -26376,6 +26376,16 @@ static void emit_load_assignment_rhs_expression_to_pair (const char *lo, const c
             emit_push_reg_now ("eax");
             emit_push_reg_now ("edx");
             
+            /*
+             * The left operand may have been loaded from a 64-bit structure
+             * member, leaving postfix_member_seen set while its address was
+             * consumed by the pair loader.  The shift count starts a new
+             * operand, so do not let that stale member state make the 32-bit
+             * RHS loader dereference the count as though it were the previous
+             * member address.
+             */
+            postfix_member_seen = 0;
+            
             emit_load_assignment_binary_expression_to_reg ("ebx");
             
             if (state->syntax & ASM_SYNTAX_INTEL) {