summaryrefslogtreecommitdiff
path: root/libcxxabi/src
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2022-05-04 15:50:24 +0300
committerMartin Storsjö <martin@martin.st>2022-05-05 23:21:18 +0300
commitaeb4907ed658ad5538f8cd569facae5beaab2940 (patch)
treebed4d633fdd2b664b4e8645675ad33914f7c2dc4 /libcxxabi/src
parent448eabd754852b6939ac5c54d8e71b6e3ff9b78a (diff)
downloadllvm-aeb4907ed658ad5538f8cd569facae5beaab2940.tar.gz
[libcxxabi] Use the right calling convention for exception destructors on i386 Windows
On Windows on i386, C++ member functions use a different calling convention (`__thiscall`) than the default one for regular functions (`__cdecl`). (On Windows on architectures other than i386, both calling convention attributes are no-ops.) This matches how libstdc++ declares these types. This fixes the std/thread/futures/futures.{shared,unique}_future/dtor.pass.cpp tests on i386 mingw. Differential Revision: https://reviews.llvm.org/D124990
Diffstat (limited to 'libcxxabi/src')
-rw-r--r--libcxxabi/src/cxa_exception.cpp2
-rw-r--r--libcxxabi/src/cxa_exception.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/libcxxabi/src/cxa_exception.cpp b/libcxxabi/src/cxa_exception.cpp
index 059d75ca2ab4..b17c79eea303 100644
--- a/libcxxabi/src/cxa_exception.cpp
+++ b/libcxxabi/src/cxa_exception.cpp
@@ -254,7 +254,7 @@ will call terminate, assuming that there was no handler for the
exception.
*/
void
-__cxa_throw(void *thrown_object, std::type_info *tinfo, void (*dest)(void *)) {
+__cxa_throw(void *thrown_object, std::type_info *tinfo, void (_LIBCXXABI_DTOR_FUNC *dest)(void *)) {
__cxa_eh_globals *globals = __cxa_get_globals();
__cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object);
diff --git a/libcxxabi/src/cxa_exception.h b/libcxxabi/src/cxa_exception.h
index 7a32fb653b07..64123d443a9b 100644
--- a/libcxxabi/src/cxa_exception.h
+++ b/libcxxabi/src/cxa_exception.h
@@ -43,7 +43,7 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {
// Manage the exception object itself.
std::type_info *exceptionType;
- void (*exceptionDestructor)(void *);
+ void (_LIBCXXABI_DTOR_FUNC *exceptionDestructor)(void *);
std::unexpected_handler unexpectedHandler;
std::terminate_handler terminateHandler;
@@ -81,7 +81,7 @@ struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {
#endif
std::type_info *exceptionType;
- void (*exceptionDestructor)(void *);
+ void (_LIBCXXABI_DTOR_FUNC *exceptionDestructor)(void *);
std::unexpected_handler unexpectedHandler;
std::terminate_handler terminateHandler;