File tree 2 files changed +28
-0
lines changed
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() {
74
74
((char *)cxa_exception_from_thrown_object (thrown_object));
75
75
free ((void *)raw_buffer);
76
76
}
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
+ }
77
85
#endif
78
86
79
87
} // extern "C"
Original file line number Diff line number Diff line change @@ -14891,3 +14891,23 @@ def test_mimalloc_headers(self):
14891
14891
def test_SUPPORT_BIG_ENDIAN(self):
14892
14892
# Just a simple build-only test for now
14893
14893
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