[llvm] r243768 - [libFuzzer] record traces from the switch statements only when told to do so

Kostya Serebryany kcc at google.com
Fri Jul 31 11:09:08 PDT 2015


Author: kcc
Date: Fri Jul 31 13:09:08 2015
New Revision: 243768

URL: http://llvm.org/viewvc/llvm-project?rev=243768&view=rev
Log:
[libFuzzer] record traces from the switch statements only when told to do so

Modified:
    llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp

Modified: llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp?rev=243768&r1=243767&r2=243768&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp Fri Jul 31 13:09:08 2015
@@ -364,6 +364,7 @@ void TraceState::TraceCmpCallback(uintpt
 void TraceState::TraceSwitchCallback(uintptr_t PC, size_t ValSizeInBits,
                                      uint64_t Val, size_t NumCases,
                                      uint64_t *Cases) {
+  if (!RecordingTraces) return;
   for (size_t i = 0; i < NumCases; i++)
     TryToAddDesiredData(Val, Cases[i], ValSizeInBits / 8);
 }





More information about the llvm-commits mailing list