diff --git a/src/jsifier.js b/src/jsifier.js index 69176e3b21aef..7302ea0dd6c93 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -221,7 +221,7 @@ function ${name}(${args}) { // the number specifies the number of arguments. In Emscripten, route all // these to a single function '__cxa_find_matching_catch' that variadically // processes all of these functions using JS 'arguments' object. - if (symbol.startsWith('__cxa_find_matching_catch_')) { + if (!WASM_EXCEPTIONS && symbol.startsWith('__cxa_find_matching_catch_')) { if (DISABLE_EXCEPTION_THROWING) { error('DISABLE_EXCEPTION_THROWING was set (likely due to -fno-exceptions), which means no C++ exception throwing support code is linked in, but exception catching code appears. Either do not set DISABLE_EXCEPTION_THROWING (if you do want exception throwing) or compile all source files with -fno-except (so that no exceptions support code is required); also make sure DISABLE_EXCEPTION_CATCHING is set to the right value - if you want exceptions, it should be off, and vice versa.'); return; diff --git a/src/library_exceptions.js b/src/library_exceptions.js index d64e217cf1aa5..61ad2568e36a2 100644 --- a/src/library_exceptions.js +++ b/src/library_exceptions.js @@ -238,7 +238,6 @@ var LibraryExceptions = { // functionality boils down to picking a suitable 'catch' block. // We'll do that here, instead, to keep things simpler. __cxa_find_matching_catch__deps: ['$exceptionLast', '$ExceptionInfo', '__resumeException', '__cxa_can_catch', 'setTempRet0'], - //__cxa_find_matching_catch__sig: 'p', __cxa_find_matching_catch: function() { var thrown = #if EXCEPTION_STACK_TRACES @@ -408,6 +407,7 @@ var LibraryExceptions = { #endif }; +#if !WASM_EXCEPTIONS // In LLVM, exceptions generate a set of functions of form // __cxa_find_matching_catch_1(), __cxa_find_matching_catch_2(), etc. where the // number specifies the number of arguments. In Emscripten, route all these to @@ -416,5 +416,6 @@ var LibraryExceptions = { addCxaCatch = function(n) { LibraryManager.library['__cxa_find_matching_catch_' + n] = '__cxa_find_matching_catch'; }; +#endif mergeInto(LibraryManager.library, LibraryExceptions);