[libFuzzer] do not initialize parts of TracePC -- let them be initialized by the...
authorKostya Serebryany <kcc@google.com>
Fri, 11 Nov 2016 23:06:53 +0000 (23:06 +0000)
committerKostya Serebryany <kcc@google.com>
Fri, 11 Nov 2016 23:06:53 +0000 (23:06 +0000)
llvm-svn: 286665

llvm/lib/Fuzzer/FuzzerTracePC.cpp
llvm/lib/Fuzzer/FuzzerTracePC.h

index e61d5e0cdb6a14e24352418090c3b0c8bec83514..f85b150a0002d4a8b815c063ae225fc62cd22f9f 100644 (file)
@@ -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;
index 4cce36354d7e2642f78d2db6e749719a825ff8e4..9c7f563d88a6a067df9f06d69f6b697c962a8688 100644 (file)
@@ -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];