aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2022-04-27 13:15:09 +0000
committerEd Maste <emaste@FreeBSD.org>2022-04-27 13:41:26 +0000
commitc40e4349889b32500e51e60f9529dbcc080f468b (patch)
treed4986b5602e912b9a2c7e8d05025b621e8d2d0a3
parentb40c0db6f6d61ed594118d81dc691b9263a7e4d7 (diff)
downloadsrc-c40e4349889b32500e51e60f9529dbcc080f468b.tar.gz
src-c40e4349889b32500e51e60f9529dbcc080f468b.zip
libcxxrt: Insert padding in __cxa_dependent_exception
Padding was added to __cxa_exception in 45ca8b19 and __cxa_dependent_exception needs the same layout. Add some static_asserts to detect this in the future. Merge of libcxxrt commit b00c6c564357
-rw-r--r--contrib/libcxxrt/exception.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc
index 2f1dc4030ba4..f28082ab7e80 100644
--- a/contrib/libcxxrt/exception.cc
+++ b/contrib/libcxxrt/exception.cc
@@ -197,6 +197,7 @@ struct __cxa_thread_info
struct __cxa_dependent_exception
{
#if __LP64__
+ void *reserve;
void *primaryException;
#endif
std::type_info *exceptionType;
@@ -219,6 +220,17 @@ struct __cxa_dependent_exception
#endif
_Unwind_Exception unwindHeader;
};
+static_assert(sizeof(__cxa_exception) == sizeof(__cxa_dependent_exception),
+ "__cxa_exception and __cxa_dependent_exception should have the same size");
+static_assert(offsetof(__cxa_exception, referenceCount) ==
+ offsetof(__cxa_dependent_exception, primaryException),
+ "referenceCount and primaryException should have the same offset");
+static_assert(offsetof(__cxa_exception, unwindHeader) ==
+ offsetof(__cxa_dependent_exception, unwindHeader),
+ "unwindHeader fields should have the same offset");
+static_assert(offsetof(__cxa_dependent_exception, unwindHeader) ==
+ offsetof(__cxa_dependent_exception, adjustedPtr) + 8,
+ "there should be no padding before unwindHeader");
namespace std