[compiler-rt] r182657 - [lsan] Allow the ignored TLS range to be empty.
Sergey Matveev
earthdok at google.com
Fri May 24 11:07:54 PDT 2013
Author: smatveev
Date: Fri May 24 13:07:53 2013
New Revision: 182657
URL: http://llvm.org/viewvc/llvm-project?rev=182657&view=rev
Log:
[lsan] Allow the ignored TLS range to be empty.
Modified:
compiler-rt/trunk/lib/lsan/lsan_common.cc
Modified: compiler-rt/trunk/lib/lsan/lsan_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common.cc?rev=182657&r1=182656&r2=182657&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common.cc Fri May 24 13:07:53 2013
@@ -155,15 +155,19 @@ static void ProcessThreads(SuspendedThre
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);
+ }
}
}
}
More information about the llvm-commits
mailing list