[PATCH] D46597: [sanitizer] Correct 64-bit atomic_store on 32-bit "other" platforms

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 08:20:54 PDT 2018


cryptoad updated this revision to Diff 145928.
cryptoad marked 2 inline comments as done.
cryptoad added a comment.

Changing the break condition to Dmitry's suggestion.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D46597

Files:
  lib/sanitizer_common/sanitizer_atomic_clang_other.h


Index: lib/sanitizer_common/sanitizer_atomic_clang_other.h
===================================================================
--- lib/sanitizer_common/sanitizer_atomic_clang_other.h
+++ lib/sanitizer_common/sanitizer_atomic_clang_other.h
@@ -86,7 +86,7 @@
     typename T::Type cur;
     for (;;) {
       cur = __sync_val_compare_and_swap(&a->val_dont_use, cmp, v);
-      if (cmp == v)
+      if (cur == cmp || cur == v)
         break;
       cmp = cur;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46597.145928.patch
Type: text/x-patch
Size: 465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180509/1a286e1b/attachment.bin>


More information about the llvm-commits mailing list