summaryrefslogtreecommitdiffstats
path: root/lib/libcxxabi/src/cxa_exception.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-02-04 16:55:17 +0000
committerpatrick <patrick@openbsd.org>2019-02-04 16:55:17 +0000
commit79b3959bf0bd0a9885328f3a8b81bd84271245d9 (patch)
tree0b07affff0e2a349a07a444d20083dd65fbf27f4 /lib/libcxxabi/src/cxa_exception.cpp
parentImport libunwind 7.0.1 (diff)
downloadwireguard-openbsd-79b3959bf0bd0a9885328f3a8b81bd84271245d9.tar.xz
wireguard-openbsd-79b3959bf0bd0a9885328f3a8b81bd84271245d9.zip
Import libc++abi 7.0.1.
Diffstat (limited to 'lib/libcxxabi/src/cxa_exception.cpp')
-rw-r--r--lib/libcxxabi/src/cxa_exception.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libcxxabi/src/cxa_exception.cpp b/lib/libcxxabi/src/cxa_exception.cpp
index d5230cdc7d9..397427a0299 100644
--- a/lib/libcxxabi/src/cxa_exception.cpp
+++ b/lib/libcxxabi/src/cxa_exception.cpp
@@ -18,6 +18,7 @@
#include "cxa_exception.hpp"
#include "cxa_handlers.hpp"
#include "fallback_malloc.h"
+#include "include/atomic_support.h"
#if __has_feature(address_sanitizer)
extern "C" void __asan_handle_no_return(void);
@@ -616,7 +617,7 @@ __cxa_increment_exception_refcount(void *thrown_object) throw() {
if (thrown_object != NULL )
{
__cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object);
- __sync_add_and_fetch(&exception_header->referenceCount, 1);
+ std::__libcpp_atomic_add(&exception_header->referenceCount, size_t(1));
}
}
@@ -628,12 +629,12 @@ __cxa_increment_exception_refcount(void *thrown_object) throw() {
Requires: If thrown_object is not NULL, it is a native exception.
*/
-void
-__cxa_decrement_exception_refcount(void *thrown_object) throw() {
+_LIBCXXABI_NO_CFI
+void __cxa_decrement_exception_refcount(void *thrown_object) throw() {
if (thrown_object != NULL )
{
__cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object);
- if (__sync_sub_and_fetch(&exception_header->referenceCount, size_t(1)) == 0)
+ if (std::__libcpp_atomic_add(&exception_header->referenceCount, size_t(-1)) == 0)
{
if (NULL != exception_header->exceptionDestructor)
exception_header->exceptionDestructor(thrown_object);