Skip to content

Commit d804b78

Browse files
committed
Fix issue with stacktrace on wasm
1 parent c76daa2 commit d804b78

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmake/yup_standalone.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ function (yup_standalone_app)
184184
-sFETCH=1
185185
#-sASYNCIFY=1
186186
-sEXPORTED_RUNTIME_METHODS=ccall,cwrap
187-
-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='$dynCall','$stackTrace'
187+
-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='$dynCall'
188188
--shell-file "${YUP_ARG_CUSTOM_SHELL}")
189189

190-
foreach (preload_file IN LISTS ${YUP_ARG_PRELOAD_FILES})
190+
foreach (preload_file IN ITEMS ${YUP_ARG_PRELOAD_FILES})
191191
list (APPEND additional_link_options --preload-file "${preload_file}")
192192
endforeach()
193193

modules/yup_core/system/yup_SystemStats.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ String SystemStats::getStackBacktrace()
252252

253253
#elif YUP_EMSCRIPTEN
254254
std::string temporaryStack;
255-
temporaryStack.resize (10 * EM_ASM_INT_V ({ return (lengthBytesUTF8 || Module.lengthBytesUTF8) (stackTrace()); }));
256-
EM_ASM_ARGS ({ (stringToUTF8 || Module.stringToUTF8) (stackTrace(), $0, $1); }, temporaryStack.data(), temporaryStack.size());
255+
temporaryStack.resize (emscripten_get_callstack (EM_LOG_C_STACK, nullptr, 0));
256+
emscripten_get_callstack (EM_LOG_C_STACK, temporaryStack.data(), static_cast<int> (temporaryStack.size()));
257257
result << temporaryStack.c_str();
258258

259259
#elif YUP_WINDOWS

0 commit comments

Comments
 (0)