File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ 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* __cxa_init_primary_exception (void * object, std::type_info* tinfo,
79
+ void *(_LIBCXXABI_DTOR_FUNC* dest)(void *)) throw() {
80
+ __cxa_exception* exception_header = cxa_exception_from_thrown_object (object);
81
+ return exception_header;
82
+ }
77
83
#endif
78
84
79
85
} // extern "C"
Original file line number Diff line number Diff line change @@ -14859,3 +14859,23 @@ def test_mimalloc_headers(self):
14859
14859
def test_SUPPORT_BIG_ENDIAN(self):
14860
14860
# Just a simple build-only test for now
14861
14861
self.run_process([EMCC, '-sSUPPORT_BIG_ENDIAN', test_file('hello_world.c')])
14862
+
14863
+ @parameterized({
14864
+ 'noexcept': ['-fno-exceptions'],
14865
+ 'default': [],
14866
+ 'except': ['-sDISABLE_EXCEPTION_CATCHING=0'],
14867
+ 'except_wasm': ['-fwasm-exceptions'],
14868
+ 'except_wasm_exnref': ['-fwasm-exceptions', '-sWASM_EXNREF']
14869
+ })
14870
+ def test_std_promise(self, *args):
14871
+ # Regression test for the bug where std::promise's destructor caused a link
14872
+ # error with __cxa_init_primary_exception when no exception argument is
14873
+ # given (which defaults to -fignore-exceptions)
14874
+ create_file('src.cpp', r'''
14875
+ #include <future>
14876
+ int main() {
14877
+ std::promise<int> p;
14878
+ return 0;
14879
+ }
14880
+ ''')
14881
+ self.run_process([EMXX, 'src.cpp', '-pthread'] + list(args))
You can’t perform that action at this time.
0 commit comments