Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit f5a9ace

Browse files
committed
[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
1 parent 8e66cf5 commit f5a9ace

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

lib/lsan/lsan_common.cc

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,19 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
155155

156156
if (flags()->use_tls()) {
157157
if (flags()->log_threads) Report("TLS at %p-%p.\n", tls_begin, tls_end);
158-
// Because LSan should not be loaded with dlopen(), we can assume
159-
// that allocator cache will be part of static TLS image.
160-
CHECK_LE(tls_begin, cache_begin);
161-
CHECK_GE(tls_end, cache_end);
162-
if (tls_begin < cache_begin)
163-
ScanRangeForPointers(tls_begin, cache_begin, frontier, "TLS",
164-
kReachable);
165-
if (tls_end > cache_end)
166-
ScanRangeForPointers(cache_end, tls_end, frontier, "TLS", kReachable);
158+
if (cache_begin == cache_end) {
159+
ScanRangeForPointers(tls_begin, tls_end, frontier, "TLS", kReachable);
160+
} else {
161+
// Because LSan should not be loaded with dlopen(), we can assume
162+
// that allocator cache will be part of static TLS image.
163+
CHECK_LE(tls_begin, cache_begin);
164+
CHECK_GE(tls_end, cache_end);
165+
if (tls_begin < cache_begin)
166+
ScanRangeForPointers(tls_begin, cache_begin, frontier, "TLS",
167+
kReachable);
168+
if (tls_end > cache_end)
169+
ScanRangeForPointers(cache_end, tls_end, frontier, "TLS", kReachable);
170+
}
167171
}
168172
}
169173
}

0 commit comments

Comments
 (0)