From 2f115b3592954e6a9f558ebb54fe4cf5c72d80a0 Mon Sep 17 00:00:00 2001 From: electricmessiah Date: Wed, 8 Jul 2026 18:23:22 -0400 Subject: [PATCH] Fix: heap-allocate accelerator table to avoid release-build startup crash CreateAcceleratorTableW(&accels)? intermittently failed with 'Invalid access to memory location (0x800703E6)' in --release builds once the local ACCEL array reached 35 entries, while debug builds never reproduced it at any size. Confirmed size-dependent (any 34-entry array worked, content-independent) and optimizer-dependent (only --release), consistent with a stack-layout-sensitive miscompilation rather than a logic bug. Moving the array to the heap (.to_vec()) sidesteps it. --- src/platform/win32.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/win32.rs b/src/platform/win32.rs index db63363..981b41a 100644 --- a/src/platform/win32.rs +++ b/src/platform/win32.rs @@ -1251,7 +1251,8 @@ fn create_accelerators() -> Result { key: VK_PRIOR, cmd: CMD_TAB_PREV, }, - ]; + ] + .to_vec(); let accel = unsafe { CreateAcceleratorTableW(&accels)? }; Ok(accel)