diff options
author | Sergey Matveev <earthdok@google.com> | 2013-05-24 18:07:53 +0000 |
---|---|---|
committer | Sergey Matveev <earthdok@google.com> | 2013-05-24 18:07:53 +0000 |
commit | f5a9ace4904e9daf3d962274cbbcb702ebc5450e (patch) | |
tree | b067b2ba3b5b06660b5a98e2ce7769253c9ca0f8 | |
parent | 8e66cf5e2b56214996185fce37cd704898d8bc9b (diff) | |
download | compiler-rt-f5a9ace4904e9daf3d962274cbbcb702ebc5450e.tar.gz compiler-rt-f5a9ace4904e9daf3d962274cbbcb702ebc5450e.tar.bz2 compiler-rt-f5a9ace4904e9daf3d962274cbbcb702ebc5450e.tar.xz |
[lsan] Allow the ignored TLS range to be empty.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182657 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/lsan/lsan_common.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/lsan/lsan_common.cc b/lib/lsan/lsan_common.cc index 815e78bd..53a90091 100644 --- a/lib/lsan/lsan_common.cc +++ b/lib/lsan/lsan_common.cc @@ -155,15 +155,19 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads, if (flags()->use_tls()) { if (flags()->log_threads) Report("TLS at %p-%p.\n", tls_begin, tls_end); - // Because LSan should not be loaded with dlopen(), we can assume - // that allocator cache will be part of static TLS image. - CHECK_LE(tls_begin, cache_begin); - CHECK_GE(tls_end, cache_end); - if (tls_begin < cache_begin) - ScanRangeForPointers(tls_begin, cache_begin, frontier, "TLS", - kReachable); - if (tls_end > cache_end) - ScanRangeForPointers(cache_end, tls_end, frontier, "TLS", kReachable); + if (cache_begin == cache_end) { + ScanRangeForPointers(tls_begin, tls_end, frontier, "TLS", kReachable); + } else { + // Because LSan should not be loaded with dlopen(), we can assume + // that allocator cache will be part of static TLS image. + CHECK_LE(tls_begin, cache_begin); + CHECK_GE(tls_end, cache_end); + if (tls_begin < cache_begin) + ScanRangeForPointers(tls_begin, cache_begin, frontier, "TLS", + kReachable); + if (tls_end > cache_end) + ScanRangeForPointers(cache_end, tls_end, frontier, "TLS", kReachable); + } } } } |