tsan: fix the code that searches for heap memory block metadata

(the old code won't work with new allocator)

llvm-svn: 171054
This commit is contained in:
Dmitry Vyukov 2012-12-25 07:45:40 +00:00
parent 54606d57a2
commit 774defc649
1 changed files with 2 additions and 2 deletions

View File

@ -119,9 +119,9 @@ void *user_realloc(ThreadState *thr, uptr pc, void *p, uptr sz) {
} }
MBlock *user_mblock(ThreadState *thr, void *p) { MBlock *user_mblock(ThreadState *thr, void *p) {
// CHECK_GT(thr->in_rtl, 0);
CHECK_NE(p, (void*)0); CHECK_NE(p, (void*)0);
return (MBlock*)allocator()->GetMetaData(p); Allocator *a = allocator();
return (MBlock*)a->GetMetaData(a->GetBlockBegin(p));
} }
void invoke_malloc_hook(void *ptr, uptr size) { void invoke_malloc_hook(void *ptr, uptr size) {