Revert 177745 as it was incorrect

llvm-svn: 177746
This commit is contained in:
Timur Iskhodzhanov 2013-03-22 18:16:57 +00:00
parent e117eef77f
commit fb74020cea
1 changed files with 1 additions and 2 deletions

View File

@ -423,8 +423,7 @@ static void Deallocate(void *ptr, StackTrace *stack, AllocType alloc_type) {
u8 old_chunk_state = CHUNK_ALLOCATED;
// Flip the chunk_state atomically to avoid race on double-free.
if (!atomic_compare_exchange_strong((atomic_uintptr_t*)m,
(uptr*)&old_chunk_state,
if (!atomic_compare_exchange_strong((atomic_uint8_t*)m, &old_chunk_state,
CHUNK_QUARANTINE, memory_order_relaxed)) {
if (old_chunk_state == CHUNK_QUARANTINE)
ReportDoubleFree((uptr)ptr, stack);