summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerTraceState.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-07-31 18:09:08 +0000
committerKostya Serebryany <kcc@google.com>2015-07-31 18:09:08 +0000
commit73932e5fe3ddd6ac365390bb829081f7ea02da16 (patch)
tree0642e3d9d22ddc96d4aba144cda3cd2f98d2310b /llvm/lib/Fuzzer/FuzzerTraceState.cpp
parentdbf1045ad75c41e0711e075cf9e0ffd433c55c67 (diff)
downloadbcm5719-llvm-73932e5fe3ddd6ac365390bb829081f7ea02da16.tar.gz
bcm5719-llvm-73932e5fe3ddd6ac365390bb829081f7ea02da16.zip
[libFuzzer] record traces from the switch statements only when told to do so
llvm-svn: 243768
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerTraceState.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerTraceState.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerTraceState.cpp b/llvm/lib/Fuzzer/FuzzerTraceState.cpp
index 7af5f74d2a9..5eae2ec8882 100644
--- a/llvm/lib/Fuzzer/FuzzerTraceState.cpp
+++ b/llvm/lib/Fuzzer/FuzzerTraceState.cpp
@@ -364,6 +364,7 @@ void TraceState::TraceCmpCallback(uintptr_t PC, size_t CmpSize, size_t CmpType,
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);
}
OpenPOWER on IntegriCloud