Skip to content

Commit 8fc85aa

Browse files
authored
Don't include __cxa_find_matching_catch helpers with WASM_EXCEPTIONS. NFC (#19195)
Split out from #18905
1 parent 5f84e88 commit 8fc85aa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/jsifier.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function ${name}(${args}) {
221221
// the number specifies the number of arguments. In Emscripten, route all
222222
// these to a single function '__cxa_find_matching_catch' that variadically
223223
// processes all of these functions using JS 'arguments' object.
224-
if (symbol.startsWith('__cxa_find_matching_catch_')) {
224+
if (!WASM_EXCEPTIONS && symbol.startsWith('__cxa_find_matching_catch_')) {
225225
if (DISABLE_EXCEPTION_THROWING) {
226226
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.');
227227
return;

src/library_exceptions.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ var LibraryExceptions = {
238238
// functionality boils down to picking a suitable 'catch' block.
239239
// We'll do that here, instead, to keep things simpler.
240240
__cxa_find_matching_catch__deps: ['$exceptionLast', '$ExceptionInfo', '__resumeException', '__cxa_can_catch', 'setTempRet0'],
241-
//__cxa_find_matching_catch__sig: 'p',
242241
__cxa_find_matching_catch: function() {
243242
var thrown =
244243
#if EXCEPTION_STACK_TRACES
@@ -408,6 +407,7 @@ var LibraryExceptions = {
408407
#endif
409408
};
410409

410+
#if !WASM_EXCEPTIONS
411411
// In LLVM, exceptions generate a set of functions of form
412412
// __cxa_find_matching_catch_1(), __cxa_find_matching_catch_2(), etc. where the
413413
// number specifies the number of arguments. In Emscripten, route all these to
@@ -416,5 +416,6 @@ var LibraryExceptions = {
416416
addCxaCatch = function(n) {
417417
LibraryManager.library['__cxa_find_matching_catch_' + n] = '__cxa_find_matching_catch';
418418
};
419+
#endif
419420

420421
mergeInto(LibraryManager.library, LibraryExceptions);

0 commit comments

Comments
 (0)