diff options
author | Daniel Jasper <djasper@google.com> | 2016-12-17 12:27:49 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-12-17 12:27:49 +0000 |
commit | fa1030e40b5febfd41af64e1a4114792b91e4bbc (patch) | |
tree | 156493dda1a649ede7338d88166d36667041f64e /llvm/lib/Fuzzer/FuzzerLoop.cpp | |
parent | 607fa711b2c9023daea909b539322250a79dec8a (diff) | |
download | llvm-fa1030e40b5febfd41af64e1a4114792b91e4bbc.zip llvm-fa1030e40b5febfd41af64e1a4114792b91e4bbc.tar.gz llvm-fa1030e40b5febfd41af64e1a4114792b91e4bbc.tar.bz2 |
Revert "[libFuzzer] add an experimental flag -experimental_len_control=1 that sets max_len to 1M and tries to increases the actual max sizes of mutations very gradually. Also remove a bit of dead code"
This reverts commit r289998.
See comment:
https://reviews.llvm.org/rL289998
llvm-svn: 290043
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerLoop.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp index d4a36d9..00dac22 100644 --- a/llvm/lib/Fuzzer/FuzzerLoop.cpp +++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp @@ -700,19 +700,6 @@ void Fuzzer::TryDetectingAMemoryLeak(const uint8_t *Data, size_t Size, } } -static size_t ComputeMutationLen(size_t MaxInputSize, size_t MaxMutationLen, - Random &Rand) { - assert(MaxInputSize <= MaxMutationLen); - if (MaxInputSize == MaxMutationLen) return MaxMutationLen; - size_t Result = MaxInputSize; - size_t R = Rand.Rand(); - if ((R % (1U << 7)) == 0) - Result++; - if ((R % (1U << 15)) == 0) - Result += 10 + Result / 2; - return Min(Result, MaxMutationLen); -} - void Fuzzer::MutateAndTestOne() { MD.StartMutationSequence(); @@ -726,19 +713,13 @@ void Fuzzer::MutateAndTestOne() { assert(MaxMutationLen > 0); - size_t CurrentMaxMutationLen = - Options.ExperimentalLenControl - ? ComputeMutationLen(Corpus.MaxInputSize(), MaxMutationLen, - MD.GetRand()) - : MaxMutationLen; - for (int i = 0; i < Options.MutateDepth; i++) { if (TotalNumberOfRuns >= Options.MaxNumberOfRuns) break; size_t NewSize = 0; - NewSize = MD.Mutate(CurrentUnitData, Size, CurrentMaxMutationLen); + NewSize = MD.Mutate(CurrentUnitData, Size, MaxMutationLen); assert(NewSize > 0 && "Mutator returned empty unit"); - assert(NewSize <= CurrentMaxMutationLen && "Mutator return overisized unit"); + assert(NewSize <= MaxMutationLen && "Mutator return overisized unit"); Size = NewSize; if (i == 0) StartTraceRecording(); |