diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-20 19:43:09 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-20 19:43:09 -0800 |
commit | d806b71796493113e000b1dd5f918aaab691aba0 (patch) | |
tree | e030b46c43ec306c2e0ad2d2c5a4af8616d2dee3 | |
parent | df4d91df0e527cad9558fb0e967371c27fdb2401 (diff) | |
parent | e7ae95bd86e363d6c51ca00abacb6733fc0d01cb (diff) |
Merge pull request #2037 from waywardmonkeys/updates5
Updates 5
-rw-r--r-- | src/library.js | 23 | ||||
-rw-r--r-- | system/include/libcxx/exception | 4 | ||||
-rw-r--r-- | tests/core/test_exceptions_std.in | 1 | ||||
-rw-r--r-- | tests/core/test_exceptions_std.out | 3 |
4 files changed, 19 insertions, 12 deletions
diff --git a/src/library.js b/src/library.js index c668a5aa..f9af8a96 100644 --- a/src/library.js +++ b/src/library.js @@ -4427,14 +4427,6 @@ LibraryManager.library = { throw exception; }, - _Unwind_Resume_or_Rethrow: function(ptr) { - {{{ makeThrow('ptr') }}}; - }, - _Unwind_RaiseException: function(ptr) { - {{{ makeThrow('ptr') }}}; - }, - _Unwind_DeleteException: function(ptr) {}, - terminate: '__cxa_call_unexpected', __gxx_personality_v0__deps: ['llvm_eh_exception', '_ZSt18uncaught_exceptionv', '__cxa_find_matching_catch'], @@ -4547,7 +4539,20 @@ LibraryManager.library = { } }, - _ZNSt9exceptionD2Ev: function(){}, // XXX a dependency of dlmalloc, but not actually needed if libcxx is not anyhow included + // Destructors for std::exception since we don't have them implemented in libcxx as we aren't using libcxxabi. + // These are also needed for the dlmalloc tests. + _ZNSt9exceptionD1Ev: function() {}, + _ZNSt9exceptionD2Ev: function() {}, + + _ZNKSt9exception4whatEv__deps: ['_malloc'], + _ZNKSt9exception4whatEv: function() { + if (!__ZNKSt9exception4whatEv.buffer) { + var name = "std::exception"; + __ZNKSt9exception4whatEv.buffer = _malloc(name.length + 1); + writeStringToMemory(name, __ZNKSt9exception4whatEv.buffer); + } + return __ZNKSt9exception4whatEv.buffer; + }, _ZNSt9type_infoD2Ev: function(){}, diff --git a/system/include/libcxx/exception b/system/include/libcxx/exception index ddd75bd4..cad802e0 100644 --- a/system/include/libcxx/exception +++ b/system/include/libcxx/exception @@ -91,8 +91,8 @@ class _LIBCPP_EXCEPTION_ABI exception { public: _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {} - virtual ~exception() _NOEXCEPT {} // XXX EMSCRIPTEN - implement in header - virtual const char* what() const _NOEXCEPT { return "std::exception"; } // XXX EMSCRIPTEN - implement in header + virtual ~exception() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; }; class _LIBCPP_EXCEPTION_ABI bad_exception diff --git a/tests/core/test_exceptions_std.in b/tests/core/test_exceptions_std.in index 4b5905d8..3b9f874b 100644 --- a/tests/core/test_exceptions_std.in +++ b/tests/core/test_exceptions_std.in @@ -7,6 +7,7 @@ int main() { throw e; } catch (std::exception e) { + printf("what? %s\n", e.what()); printf("caught std::exception\n"); } return 0; diff --git a/tests/core/test_exceptions_std.out b/tests/core/test_exceptions_std.out index c1660de4..eddab21c 100644 --- a/tests/core/test_exceptions_std.out +++ b/tests/core/test_exceptions_std.out @@ -1 +1,2 @@ -caught std::exception
\ No newline at end of file +what? std::exception +caught std::exception |