From 6dab29e62d0f4d68a53272cd79ccf28a86db7a04 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 26 Jul 2025 10:50:43 +1000 Subject: [PATCH] Fix 32 bit windows build crashing due to obscure possible compiler bug It was crashing with 'attempt to read from 0xFFFFFF', despite the fact that the faulting instruction was 'load XMM7 from ESP-0x10' and ESP was normal values like 0x01E3A048 Also, compiling at -O0 instead of -O1 didn't crash. So just disable the code, because working out exactly why it is crashing would take too much work --- src/ClassiCube.vcxproj | 3 +-- third_party/bearssl/chacha20_sse2.c | 12 ++---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/ClassiCube.vcxproj b/src/ClassiCube.vcxproj index 80aa3886a..7682f5336 100644 --- a/src/ClassiCube.vcxproj +++ b/src/ClassiCube.vcxproj @@ -599,7 +599,6 @@ - @@ -668,4 +667,4 @@ - \ No newline at end of file + diff --git a/third_party/bearssl/chacha20_sse2.c b/third_party/bearssl/chacha20_sse2.c index 92b4a4a83..2905d09b4 100644 --- a/third_party/bearssl/chacha20_sse2.c +++ b/third_party/bearssl/chacha20_sse2.c @@ -40,21 +40,13 @@ br_chacha20_sse2_get(void) * If using 64-bit mode, then SSE2 opcodes should be automatically * available, since they are part of the ABI. * - * In 32-bit mode, we use CPUID to detect the SSE2 feature. + * In 32-bit mode, not used due anymore to hitting an obscure possible compiler bug. */ #if BR_amd64 return &br_chacha20_sse2_run; #else - - /* - * SSE2 support is indicated by bit 26 in EDX. - */ - if (br_cpuid(0, 0, 0, 0x04000000)) { - return &br_chacha20_sse2_run; - } else { - return 0; - } + return 0; #endif }