[lib/Fuzzer] don't record traces when trace collection is off
authorKostya Serebryany <kcc@google.com>
Mon, 11 May 2015 23:25:28 +0000 (23:25 +0000)
committerKostya Serebryany <kcc@google.com>
Mon, 11 May 2015 23:25:28 +0000 (23:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237067 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Fuzzer/FuzzerTraceState.cpp

index c040849..4bd5a76 100644 (file)
@@ -191,6 +191,7 @@ class TraceState {
                            size_t DataSize);
 
   void StartTraceRecording() {
+    if (!Options.UseTraces) return;
     RecordingTraces = true;
     Mutations.clear();
   }
@@ -294,7 +295,7 @@ int TraceState::TryToAddDesiredData(uint64_t PresentData, uint64_t DesiredData,
 
 void TraceState::TraceCmpCallback(size_t CmpSize, size_t CmpType, uint64_t Arg1,
                         uint64_t Arg2) {
-  if (!Options.UseTraces) return;
+  if (!RecordingTraces) return;
   int Added = 0;
   if (Options.Verbosity >= 3)
     std::cerr << "TraceCmp: " << Arg1 << " " << Arg2 << "\n";