projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c048154
)
[ASan] fix deallocation hook in allocator2: according to specification, dealloc hook...
author
Alexey Samsonov
<samsonov@google.com>
Tue, 29 Jan 2013 08:19:11 +0000
(08:19 +0000)
committer
Alexey Samsonov
<samsonov@google.com>
Tue, 29 Jan 2013 08:19:11 +0000
(08:19 +0000)
llvm-svn: 173778
compiler-rt/lib/asan/asan_allocator2.cc
patch
|
blob
|
history
diff --git
a/compiler-rt/lib/asan/asan_allocator2.cc
b/compiler-rt/lib/asan/asan_allocator2.cc
index
a77b92c
..
15bdb83
100644
(file)
--- a/
compiler-rt/lib/asan/asan_allocator2.cc
+++ b/
compiler-rt/lib/asan/asan_allocator2.cc
@@
-419,6
+419,7
@@
static void *Allocate(uptr size, uptr alignment, StackTrace *stack,
static void Deallocate(void *ptr, StackTrace *stack, AllocType alloc_type) {
uptr p = reinterpret_cast<uptr>(ptr);
if (p == 0) return;
+ ASAN_FREE_HOOK(ptr);
uptr chunk_beg = p - kChunkHeaderSize;
AsanChunk *m = reinterpret_cast<AsanChunk *>(chunk_beg);
@@
-468,8
+469,6
@@
static void Deallocate(void *ptr, StackTrace *stack, AllocType alloc_type) {
quarantine.Put(&fallback_quarantine_cache, QuarantineCallback(ac),
m, m->UsedSize());
}
-
- ASAN_FREE_HOOK(ptr);
}
static void *Reallocate(void *old_ptr, uptr new_size, StackTrace *stack) {