From 3d4ce09a8092842291933f2daeff36412449f1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Sat, 19 Aug 2023 20:53:09 +0200 Subject: [PATCH] Emscripten: Fix a crash from SDL2 by disabling asserts Clearly not ideal. --- src/common/platform/Emscripten.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/platform/Emscripten.cpp b/src/common/platform/Emscripten.cpp index 14aaa6aad..aa780e274 100644 --- a/src/common/platform/Emscripten.cpp +++ b/src/common/platform/Emscripten.cpp @@ -126,6 +126,12 @@ namespace Platform void SetupCrt() { EM_ASM({ + // If we don't castrate assert here, we get a crash from within the emscripten port of + // SDL2 having to do with registering a callback that reports to the main thread, ever + // since this "fix" https://github.com/emscripten-core/emscripten/pull/19691/files + // TODO: Review later. + assert = () => {}; + let ddir = UTF8ToString($0); let prefix = ddir + '/'; let shouldSyncFs = Module.cwrap(