diff options
-rw-r--r-- | src/jsifier.js | 3 | ||||
-rw-r--r-- | system/include/libcxx/exception | 2 | ||||
-rw-r--r-- | tests/runner.py | 36 |
3 files changed, 39 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 501ed3f9..88d9dbc6 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -945,7 +945,8 @@ function JSify(data, functionsOnly, givenFunctions) { }); makeFuncLineActor('landingpad', function(item) { // Just a stub - return '{ f0: 0, f1: 0 }'; + return '{ f0: ' + makeGetValue('_llvm_eh_exception.buf', '0', 'void*') + + ', f1:' + makeGetValue('_llvm_eh_exception.buf', '4', 'void*') + ' }'; }); makeFuncLineActor('load', function(item) { var value = finalizeLLVMParameter(item.pointer); diff --git a/system/include/libcxx/exception b/system/include/libcxx/exception index 5b1db9b6..f05855b4 100644 --- a/system/include/libcxx/exception +++ b/system/include/libcxx/exception @@ -89,7 +89,7 @@ class _LIBCPP_EXCEPTION_ABI exception { public: _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {} - virtual ~exception() _NOEXCEPT; + virtual ~exception() _NOEXCEPT{} virtual const char* what() const _NOEXCEPT; }; diff --git a/tests/runner.py b/tests/runner.py index 22e8ff1d..185fdcfe 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -1189,6 +1189,42 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv): Settings.DISABLE_EXCEPTION_CATCHING = 1 self.do_run(src, 'Compiled code throwing an exception') + + src = ''' + #include <iostream> + + class MyException + { + + }; + + int function() + { + throw MyException(); + } + + int function2() + { + return function(); + } + + int main() + { + try + { + function2(); + } + catch (MyException e) + { + std::cout << "Exception catched" ; + } + + return 0; + } + ''' + + Settings.DISABLE_EXCEPTION_CATCHING = 0 + self.do_run(src, 'Exception catched') def test_typed_exceptions(self): return self.skip('TODO: fix this for llvm 3.0') |