[compiler-rt] r177745 - Band-aid fix for the Windows build caused by r177710. Long-term, atomic_compare_exchange_strong should be a template on Windows too...

Timur Iskhodzhanov timurrrr at google.com
Fri Mar 22 11:05:28 PDT 2013


Author: timurrrr
Date: Fri Mar 22 13:05:28 2013
New Revision: 177745

URL: http://llvm.org/viewvc/llvm-project?rev=177745&view=rev
Log:
Band-aid fix for the Windows build caused by r177710. Long-term, atomic_compare_exchange_strong should be a template on Windows too...

Modified:
    compiler-rt/trunk/lib/asan/asan_allocator2.cc

Modified: compiler-rt/trunk/lib/asan/asan_allocator2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator2.cc?rev=177745&r1=177744&r2=177745&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator2.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator2.cc Fri Mar 22 13:05:28 2013
@@ -423,7 +423,8 @@ static void Deallocate(void *ptr, StackT
 
   u8 old_chunk_state = CHUNK_ALLOCATED;
   // Flip the chunk_state atomically to avoid race on double-free.
-  if (!atomic_compare_exchange_strong((atomic_uint8_t*)m, &old_chunk_state,
+  if (!atomic_compare_exchange_strong((atomic_uintptr_t*)m,
+                                      (uptr*)&old_chunk_state,
                                       CHUNK_QUARANTINE, memory_order_relaxed)) {
     if (old_chunk_state == CHUNK_QUARANTINE)
       ReportDoubleFree((uptr)ptr, stack);





More information about the llvm-commits mailing list