From 491d34b7b75c42ac746ce90cda5a124bda038383 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 25 Dec 2012 07:45:40 +0000 Subject: [PATCH] tsan: fix the code that searches for heap memory block metadata (the old code won't work with new allocator) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171054 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/tsan/rtl/tsan_mman.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tsan/rtl/tsan_mman.cc b/lib/tsan/rtl/tsan_mman.cc index b7e3c7645..bc7970f6b 100644 --- a/lib/tsan/rtl/tsan_mman.cc +++ b/lib/tsan/rtl/tsan_mman.cc @@ -119,9 +119,9 @@ void *user_realloc(ThreadState *thr, uptr pc, void *p, uptr sz) { } MBlock *user_mblock(ThreadState *thr, void *p) { - // CHECK_GT(thr->in_rtl, 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) { -- 2.11.4.GIT