[compiler-rt] r346804 - [lsan] [FIXUP] Fixup for http://reviews.llvm.org/D54484

George Karpenkov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 14:17:16 PST 2018


Author: george.karpenkov
Date: Tue Nov 13 14:17:16 2018
New Revision: 346804

URL: http://llvm.org/viewvc/llvm-project?rev=346804&view=rev
Log:
[lsan] [FIXUP] Fixup for http://reviews.llvm.org/D54484

After the change, the tests started failing, as skipped sections can be
equal in size to kMaxSegName.
Changing `<` to `<=` to address the off-by-one problem.

Modified:
    compiler-rt/trunk/lib/lsan/lsan_common_mac.cc

Modified: compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common_mac.cc?rev=346804&r1=346803&r2=346804&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common_mac.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common_mac.cc Tue Nov 13 14:17:16 2018
@@ -118,7 +118,7 @@ static const char *kSkippedSecNames[] =
 // Scans global variables for heap pointers.
 void ProcessGlobalRegions(Frontier *frontier) {
   for (auto name : kSkippedSecNames)
-    CHECK(internal_strnlen(name, kMaxSegName) < kMaxSegName);
+    CHECK(internal_strnlen(name, kMaxSegName + 1) <= kMaxSegName);
 
   MemoryMappingLayout memory_mapping(false);
   InternalMmapVector<LoadedModule> modules;




More information about the llvm-commits mailing list