[libcxx-commits] [libcxxabi] r369109 - [libcxxabi] __cxa_guard_require: test guard byte with != 0 instead of == 1

Fangrui Song via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 16 06:54:44 PDT 2019


Author: maskray
Date: Fri Aug 16 06:54:44 2019
New Revision: 369109

URL: http://llvm.org/viewvc/llvm-project?rev=369109&view=rev
Log:
[libcxxabi] __cxa_guard_require: test guard byte with != 0 instead of == 1

Modified:
    libcxxabi/trunk/src/cxa_guard_impl.h

Modified: libcxxabi/trunk/src/cxa_guard_impl.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_guard_impl.h?rev=369109&r1=369108&r2=369109&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_guard_impl.h (original)
+++ libcxxabi/trunk/src/cxa_guard_impl.h Fri Aug 16 06:54:44 2019
@@ -175,7 +175,7 @@ public:
   /// Implements __cxa_guard_acquire
   AcquireResult cxa_guard_acquire() {
     AtomicInt<uint8_t> guard_byte(guard_byte_address);
-    if (guard_byte.load(std::_AO_Acquire) == COMPLETE_BIT)
+    if (guard_byte.load(std::_AO_Acquire) != UNSET)
       return INIT_IS_DONE;
     return derived()->acquire_init_byte();
   }




More information about the libcxx-commits mailing list