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

llvm-svn: 243768
This commit is contained in:
Kostya Serebryany 2015-07-31 18:09:08 +00:00
parent dbf1045ad7
commit 73932e5fe3
1 changed files with 1 additions and 0 deletions

View File

@ -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);
}