[llvm] r258462 - [libFuzzer] don't do expensive memmem if the result will not be used
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 21 17:04:58 PST 2016
Author: kcc
Date: Thu Jan 21 19:04:58 2016
New Revision: 258462
URL: http://llvm.org/viewvc/llvm-project?rev=258462&view=rev
Log:
[libFuzzer] don't do expensive memmem if the result will not be used
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=258462&r1=258461&r2=258462&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp Thu Jan 21 19:04:58 2016
@@ -362,6 +362,7 @@ void TraceState::DFSanSwitchCallback(uin
int TraceState::TryToAddDesiredData(uint64_t PresentData, uint64_t DesiredData,
size_t DataSize) {
+ if (NumMutations >= kMaxMutations) return 0;
int Res = 0;
const uint8_t *Beg = *CurrentUnitData;
const uint8_t *End = Beg + *CurrentUnitSize;
@@ -382,6 +383,7 @@ int TraceState::TryToAddDesiredData(uint
int TraceState::TryToAddDesiredData(const uint8_t *PresentData,
const uint8_t *DesiredData,
size_t DataSize) {
+ if (NumMutations >= kMaxMutations) return 0;
int Res = 0;
const uint8_t *Beg = *CurrentUnitData;
const uint8_t *End = Beg + *CurrentUnitSize;
More information about the llvm-commits
mailing list