Skip to content

Commit f6d2ab1

Browse files
yfeldblumfacebook-github-bot
authored andcommitted
fix make_exception_ptr_with build under wasm after D74343701
Summary: {D74343701} attempted to fix the exception destructor function-pointer type but was incomplete. Reviewed By: Millsky Differential Revision: D74480608 fbshipit-source-id: 2028c99b43e8f0d1e5ff84233faf8e6ea98e5b79
1 parent 785f1a3 commit f6d2ab1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

folly/lang/Exception.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,13 @@ namespace __cxxabiv1 {
170170

171171
// the definition until llvm v10.0.0-rc2
172172
struct __folly_cxa_exception_sans_reserve {
173+
using dtor_ret_t = std::conditional_t<folly::kIsArchWasm, void*, void>;
174+
173175
#if defined(__LP64__) || defined(_WIN64) || defined(_LIBCXXABI_ARM_EHABI)
174176
size_t referenceCount;
175177
#endif
176178
std::type_info* exceptionType;
177-
void (*exceptionDestructor)(void*);
179+
dtor_ret_t (*exceptionDestructor)(void*);
178180
void (*unexpectedHandler)();
179181
std::terminate_handler terminateHandler;
180182
__folly_cxa_exception_sans_reserve* nextException;
@@ -197,12 +199,14 @@ struct __folly_cxa_exception_sans_reserve {
197199

198200
// the definition since llvm v10.0.0-rc2
199201
struct __folly_cxa_exception_with_reserve {
202+
using dtor_ret_t = std::conditional_t<folly::kIsArchWasm, void*, void>;
203+
200204
#if defined(__LP64__) || defined(_WIN64) || defined(_LIBCXXABI_ARM_EHABI)
201205
void* reserve;
202206
size_t referenceCount;
203207
#endif
204208
std::type_info* exceptionType;
205-
void (*exceptionDestructor)(void*);
209+
dtor_ret_t (*exceptionDestructor)(void*);
206210
void (*unexpectedHandler)();
207211
std::terminate_handler terminateHandler;
208212
__folly_cxa_exception_with_reserve* nextException;

folly/lang/Exception.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ struct make_exception_ptr_with_arg_ {
746746
: size{sizeof(E)},
747747
type{FOLLY_TYPE_INFO_OF(E)},
748748
ctor{make<F, E>},
749-
dtor{kIsArchWasm ? dtor_<E> : thunk::dtor<E>} {}
749+
dtor{dtor_<E>} {}
750750
};
751751

752752
std::exception_ptr make_exception_ptr_with_(

0 commit comments

Comments
 (0)