[PATCH] D54484: [lsan] [NFC] Change ARRAY_SIZE to internal_strnlen
George Karpenkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 13 12:22:14 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL346792: [lsan] [NFC] Change ARRAY_SIZE to internal_strnlen (authored by george.karpenkov, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D54484?vs=173895&id=173911#toc
Repository:
rL LLVM
https://reviews.llvm.org/D54484
Files:
compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
Index: compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
===================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
+++ compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
@@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#include "sanitizer_common/sanitizer_platform.h"
+#include "sanitizer_common/sanitizer_libc.h"
#include "lsan_common.h"
#if CAN_SANITIZE_LEAKS && SANITIZER_MAC
@@ -116,7 +117,8 @@
// Scans global variables for heap pointers.
void ProcessGlobalRegions(Frontier *frontier) {
- for (auto name : kSkippedSecNames) CHECK(ARRAY_SIZE(name) < kMaxSegName);
+ for (auto name : kSkippedSecNames)
+ CHECK(internal_strnlen(name, kMaxSegName) < kMaxSegName);
MemoryMappingLayout memory_mapping(false);
InternalMmapVector<LoadedModule> modules;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54484.173911.patch
Type: text/x-patch
Size: 876 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181113/360a19d4/attachment.bin>
More information about the llvm-commits
mailing list