[compiler-rt] 3c7960c - [libFuzzer] Disable Msan on InternalStrnlen
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 5 15:24:18 PDT 2021
Author: Vitaly Buka
Date: 2021-11-05T15:24:09-07:00
New Revision: 3c7960cba19ed926b8e86b4c619e81c0f7da4d15
URL: https://github.com/llvm/llvm-project/commit/3c7960cba19ed926b8e86b4c619e81c0f7da4d15
DIFF: https://github.com/llvm/llvm-project/commit/3c7960cba19ed926b8e86b4c619e81c0f7da4d15.diff
LOG: [libFuzzer] Disable Msan on InternalStrnlen
It's called from ATTRIBUTE_NO_SANITIZE_MEMORY code.
It worked as expected if inlined and complained otherwise.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D113323
Added:
Modified:
compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp b/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
index 53e3a69884e46..af8d1ce50f3fb 100644
--- a/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
@@ -391,6 +391,7 @@ void TracePC::HandleCmp(uintptr_t PC, T Arg1, T Arg2) {
ValueProfileMap.AddValue(PC * 128 + 64 + AbsoluteDistance);
}
+ATTRIBUTE_NO_SANITIZE_MEMORY
static size_t InternalStrnlen(const char *S, size_t MaxLen) {
size_t Len = 0;
for (; Len < MaxLen && S[Len]; Len++) {}
@@ -399,6 +400,7 @@ static size_t InternalStrnlen(const char *S, size_t MaxLen) {
// Finds min of (strlen(S1), strlen(S2)).
// Needed because one of these strings may actually be non-zero terminated.
+ATTRIBUTE_NO_SANITIZE_MEMORY
static size_t InternalStrnlen2(const char *S1, const char *S2) {
size_t Len = 0;
for (; S1[Len] && S2[Len]; Len++) {}
More information about the llvm-commits
mailing list