Fix automatic initializers after statements
authorRobert Pengelly <robertapengelly@hotmail.com>
Mon, 9 Nov 2026 00:57:17 +0000 (00:57 +0000)
committerRobert Pengelly <robertapengelly@hotmail.com>
Mon, 9 Nov 2026 00:57:17 +0000 (00:57 +0000)
amd64.c
i386.c

diff --git a/amd64.c b/amd64.c
index c47ec4177f139631ed11124da1f530ff64a452aa..d2c4845ef2ea66510e60f57453ba0184fcd811c1 100644 (file)
--- a/amd64.c
+++ b/amd64.c
@@ -9984,6 +9984,13 @@ static void parse_block (void) {
                 ensure_block_stack_allocated (block_stack_start, &block_stack_bytes, &block_stack_emitted);
             }
             
+            if (!declaration_phase) {
+            
+                emit_local_initializers (inits, init_count);
+                init_count = 0;
+            
+            }
+            
             if (fallthrough_switch_depth > 0 && fallthrough_case_active[fallthrough_switch_depth - 1]) {
             
                 fallthrough_case_has_statement[fallthrough_switch_depth - 1] = 1;
diff --git a/i386.c b/i386.c
index be8295f45c0c138db02ad0b835b686783c72a336..6b7aa944c414ff4c2fcb6214876bb6c1286ae31b 100644 (file)
--- a/i386.c
+++ b/i386.c
@@ -9054,6 +9054,13 @@ static void parse_block (void) {
                 ensure_block_stack_allocated (block_stack_start, &block_stack_bytes, &block_stack_emitted);
             }
             
+            if (!declaration_phase) {
+            
+                emit_local_initializers (inits, init_count);
+                init_count = 0;
+            
+            }
+            
             if (fallthrough_switch_depth > 0 && fallthrough_case_active[fallthrough_switch_depth - 1]) {
             
                 fallthrough_case_has_statement[fallthrough_switch_depth - 1] = 1;