File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,14 @@ void __cxa_free_exception(void *thrown_object) throw() {
7474 ((char *)cxa_exception_from_thrown_object (thrown_object));
7575 free ((void *)raw_buffer);
7676}
77+
78+ __cxa_exception*
79+ __cxa_init_primary_exception (void * object,
80+ std::type_info* tinfo,
81+ void *(_LIBCXXABI_DTOR_FUNC* dest)(void *)) throw() {
82+ __cxa_exception* exception_header = cxa_exception_from_thrown_object (object);
83+ return exception_header;
84+ }
7785#endif
7886
7987} // extern "C"
Original file line number Diff line number Diff line change @@ -14891,3 +14891,23 @@ def test_mimalloc_headers(self):
1489114891 def test_SUPPORT_BIG_ENDIAN(self):
1489214892 # Just a simple build-only test for now
1489314893 self.run_process([EMCC, '-sSUPPORT_BIG_ENDIAN', test_file('hello_world.c')])
14894+
14895+ @parameterized({
14896+ 'noexcept': ['-fno-exceptions'],
14897+ 'default': [],
14898+ 'except': ['-sDISABLE_EXCEPTION_CATCHING=0'],
14899+ 'except_wasm': ['-fwasm-exceptions'],
14900+ 'except_wasm_exnref': ['-fwasm-exceptions', '-sWASM_EXNREF']
14901+ })
14902+ def test_std_promise_link(self, *args):
14903+ # Regression test for a bug where std::promise's destructor caused a link
14904+ # error with __cxa_init_primary_exception when no exception argument was
14905+ # given (which defaults to -fignore-exceptions)
14906+ create_file('src.cpp', r'''
14907+ #include <future>
14908+ int main() {
14909+ std::promise<int> p;
14910+ return 0;
14911+ }
14912+ ''')
14913+ self.run_process([EMXX, 'src.cpp', '-pthread'] + list(args))
You can’t perform that action at this time.
0 commit comments