Skip to content

[EH] Guard destructor changes in libc++abi with __wasm__ #21974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/lib/libcxxabi/include/cxxabi.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ __cxa_init_primary_exception(void* object, std::type_info* tinfo, void(_LIBCXXAB
// 2.4.3 Throwing the Exception Object
extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void
__cxa_throw(void *thrown_exception, std::type_info *tinfo,
#ifdef __WASM_EXCEPTIONS__
#ifdef __wasm__
void *(_LIBCXXABI_DTOR_FUNC *dest)(void *));
#else
void (_LIBCXXABI_DTOR_FUNC *dest)(void *));
Expand Down
4 changes: 2 additions & 2 deletions system/lib/libcxxabi/src/cxa_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void __cxa_free_exception(void *thrown_object) throw() {
}

__cxa_exception* __cxa_init_primary_exception(void* object, std::type_info* tinfo,
#ifdef __WASM_EXCEPTIONS__
#ifdef __wasm__
// In Wasm, a destructor returns its argument
void *(_LIBCXXABI_DTOR_FUNC* dest)(void*)) throw() {
#else
Expand Down Expand Up @@ -279,7 +279,7 @@ void __throw_exception_with_stack_trace(_Unwind_Exception*);
#endif

void
#ifdef __WASM_EXCEPTIONS__
#ifdef __wasm__
// In Wasm, a destructor returns its argument
__cxa_throw(void *thrown_object, std::type_info *tinfo, void *(_LIBCXXABI_DTOR_FUNC *dest)(void *)) {
#else
Expand Down
2 changes: 1 addition & 1 deletion system/lib/libcxxabi/src/cxa_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {

// Manage the exception object itself.
std::type_info *exceptionType;
#ifdef __WASM_EXCEPTIONS__
#ifdef __wasm__
// In Wasm, a destructor returns its argument
void *(_LIBCXXABI_DTOR_FUNC *exceptionDestructor)(void *);
#else
Expand Down
Loading