From: Robert Pengelly Date: Mon, 9 Nov 2026 00:57:17 +0000 (+0000) Subject: Fix automatic initializers after statements X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=28c94ff898a243d64fbfceb8cf1e3ea80dfd4db9;p=scc.git Fix automatic initializers after statements --- diff --git a/amd64.c b/amd64.c index c47ec41..d2c4845 100644 --- 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 be8295f..6b7aa94 100644 --- 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;