Skip to content

Commit

Permalink
Improve error reporting in EMCC.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Apr 15, 2024
1 parent 84ee7ee commit cc38a5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/emcc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set (SRC ${SRC} ${BINDINGS})
set (WASM_EXPORTED "\"['UTF8ToString', 'stringToUTF8', 'FS']\"")
file (GLOB LIBSNDFILE ${WASMGLUE}/*.a)

set (WASM_LINK_FLAGS "--no-heap-copy --bind -O3 --memory-init-file 0 -s LINKABLE=0 -s DYNAMIC_EXECUTION=0 -s WASM=1 -s EXPORT_NAME=\"'FaustModule'\" -s MODULARIZE=1 --preload-file ../../wasm-filesystem@usr -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1 -s STACK_SIZE=5MB -s DISABLE_EXCEPTION_CATCHING=1 -s EXPORTED_RUNTIME_METHODS=${WASM_EXPORTED} ${LIBSNDFILE}")
set (WASM_LINK_FLAGS "--no-heap-copy --bind -O3 --memory-init-file 0 -s LINKABLE=0 -s DYNAMIC_EXECUTION=0 -s WASM=1 -s EXPORT_NAME=\"'FaustModule'\" -s MODULARIZE=1 --preload-file ../../wasm-filesystem@usr -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1 -s STACK_SIZE=8MB -s DISABLE_EXCEPTION_CATCHING=1 -s EXPORTED_RUNTIME_METHODS=${WASM_EXPORTED} ${LIBSNDFILE}")

####################################
# Add the different targets
Expand Down
4 changes: 3 additions & 1 deletion compiler/generator/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ const char* faustexception::gJSExceptionMsg = nullptr;

extern "C" LIBFAUST_API const char* getErrorAfterException()
{
return faustexception::gJSExceptionMsg;
return (std::string(faustexception::gJSExceptionMsg) == "emsc")
? "ERROR : stack overflow\n"
: faustexception::gJSExceptionMsg;
}
#endif

Expand Down

0 comments on commit cc38a5f

Please sign in to comment.