forked from OSchip/llvm-project
[asan] Fix invalid thread registry access when checking if LSan is disabled.
llvm-svn: 183218
This commit is contained in:
parent
82dfc97f66
commit
b256ac7584
|
@ -422,8 +422,10 @@ static void *Allocate(uptr size, uptr alignment, StackTrace *stack,
|
||||||
uptr fill_size = Min(size, (uptr)fl.max_malloc_fill_size);
|
uptr fill_size = Min(size, (uptr)fl.max_malloc_fill_size);
|
||||||
REAL(memset)(res, fl.malloc_fill_byte, fill_size);
|
REAL(memset)(res, fl.malloc_fill_byte, fill_size);
|
||||||
}
|
}
|
||||||
m->lsan_tag =
|
if (t && t->lsan_disabled())
|
||||||
t->lsan_disabled() ? __lsan::kSuppressed : __lsan::kDirectlyLeaked;
|
m->lsan_tag = __lsan::kSuppressed;
|
||||||
|
else
|
||||||
|
m->lsan_tag = __lsan::kDirectlyLeaked;
|
||||||
// Must be the last mutation of metadata in this function.
|
// Must be the last mutation of metadata in this function.
|
||||||
atomic_store((atomic_uint8_t *)m, CHUNK_ALLOCATED, memory_order_release);
|
atomic_store((atomic_uint8_t *)m, CHUNK_ALLOCATED, memory_order_release);
|
||||||
ASAN_MALLOC_HOOK(res, size);
|
ASAN_MALLOC_HOOK(res, size);
|
||||||
|
|
Loading…
Reference in New Issue