summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-11-11 23:06:53 +0000
committerKostya Serebryany <kcc@google.com>2016-11-11 23:06:53 +0000
commit235679181b9500eaf4c1eea25b886c51d5b00789 (patch)
tree17d778e28e60a540251f8d6457b4d3ea74106d26 /llvm/lib/Fuzzer
parentcb2199b2f33e978b7ad4eaa5bea327162a63478b (diff)
downloadbcm5719-llvm-235679181b9500eaf4c1eea25b886c51d5b00789.tar.gz
bcm5719-llvm-235679181b9500eaf4c1eea25b886c51d5b00789.zip
[libFuzzer] do not initialize parts of TracePC -- let them be initialized by the linker. Add no-msan attribute to the memcmp hook.
llvm-svn: 286665
Diffstat (limited to 'llvm/lib/Fuzzer')
-rw-r--r--llvm/lib/Fuzzer/FuzzerTracePC.cpp3
-rw-r--r--llvm/lib/Fuzzer/FuzzerTracePC.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerTracePC.cpp b/llvm/lib/Fuzzer/FuzzerTracePC.cpp
index e61d5e0cdb6..f85b150a000 100644
--- a/llvm/lib/Fuzzer/FuzzerTracePC.cpp
+++ b/llvm/lib/Fuzzer/FuzzerTracePC.cpp
@@ -218,6 +218,9 @@ void TracePC::PrintCoverage() {
// For cmp instructions the interesting value is a XOR of the parameters.
// The interesting value is mixed up with the PC and is then added to the map.
+#ifdef __clang__ // avoid gcc warning.
+__attribute__((no_sanitize("memory")))
+#endif
void TracePC::AddValueForMemcmp(void *caller_pc, const void *s1, const void *s2,
size_t n) {
if (!n) return;
diff --git a/llvm/lib/Fuzzer/FuzzerTracePC.h b/llvm/lib/Fuzzer/FuzzerTracePC.h
index 4cce36354d7..9c7f563d88a 100644
--- a/llvm/lib/Fuzzer/FuzzerTracePC.h
+++ b/llvm/lib/Fuzzer/FuzzerTracePC.h
@@ -101,8 +101,8 @@ private:
};
Module Modules[4096];
- size_t NumModules = 0;
- size_t NumGuards = 0;
+ size_t NumModules; // linker-initialized.
+ size_t NumGuards; // linker-initialized.
static const size_t kNumCounters = 1 << 14;
alignas(8) uint8_t Counters[kNumCounters];
OpenPOWER on IntegriCloud