diff options
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rw-r--r-- | tests/core/test_exceptions_white_list_2.c | 27 | ||||
-rw-r--r-- | tests/core/test_exceptions_white_list_2.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 12 |
4 files changed, 39 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index f4819584..ab5440f7 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1223,7 +1223,7 @@ function JSify(data, functionsOnly) { // in an assignment var disabled = DISABLE_EXCEPTION_CATCHING == 2 && !(item.funcData.ident in EXCEPTION_CATCHING_WHITELIST); var phiSets = calcPhiSets(item); - var call_ = makeFunctionCall(item, item.params, item.funcData, item.type, ASM_JS && !disabled, !!item.assignTo || !item.standalone, true); + var call_ = makeFunctionCall(item, item.params, item.funcData, item.type, ASM_JS && !disabled, !!item.assignTo || !item.standalone, !disabled); var ret; diff --git a/tests/core/test_exceptions_white_list_2.c b/tests/core/test_exceptions_white_list_2.c new file mode 100644 index 00000000..40d7c56c --- /dev/null +++ b/tests/core/test_exceptions_white_list_2.c @@ -0,0 +1,27 @@ +#include <stdio.h> + +void throwhere(void) { + throw(1); +} + +void (*funptr)(void) = throwhere; + +void nocatch(void) { + try { + funptr(); + } + catch (...) { + printf("ERROR\n"); + } +} + +int main(void) { + try { + nocatch(); + } + catch (...) { + printf("SUCCESS\n"); + } + return 0; +} + diff --git a/tests/core/test_exceptions_white_list_2.out b/tests/core/test_exceptions_white_list_2.out new file mode 100644 index 00000000..ff43ca40 --- /dev/null +++ b/tests/core/test_exceptions_white_list_2.out @@ -0,0 +1 @@ +SUCCESS diff --git a/tests/test_core.py b/tests/test_core.py index 18d7d74a..6c2968f6 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1299,8 +1299,16 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run_from_file(src, output) - Settings.DISABLE_EXCEPTION_CATCHING = 0 - Settings.EXCEPTION_CATCHING_WHITELIST = [] + def test_exceptions_white_list_2(self): + if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') + + Settings.DISABLE_EXCEPTION_CATCHING = 2 + Settings.EXCEPTION_CATCHING_WHITELIST = ["_main"] + Settings.INLINING_LIMIT = 50 # otherwise it is inlined and not identified + + test_path = path_from_root('tests', 'core', 'test_exceptions_white_list_2') + src, output = (test_path + s for s in ('.c', '.out')) + self.do_run_from_file(src, output) def test_exceptions_uncaught(self): if self.emcc_args is None: return self.skip('no libcxx inclusion without emcc') |