diff options
| author | Kostya Serebryany <kcc@google.com> | 2017-07-15 01:31:40 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2017-07-15 01:31:40 +0000 |
| commit | e9838cdcc5d96192f492e5772d9a43557337a2aa (patch) | |
| tree | 032e1deaab8760dd9d8e0d5e5aabba415296ff51 /llvm/lib/Fuzzer/FuzzerCorpus.h | |
| parent | 663603490b4bc10f37276b8c0c8089473f77d8a4 (diff) | |
| download | bcm5719-llvm-e9838cdcc5d96192f492e5772d9a43557337a2aa.tar.gz bcm5719-llvm-e9838cdcc5d96192f492e5772d9a43557337a2aa.zip | |
[libFuzzer] remove stale code
llvm-svn: 308075
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerCorpus.h')
| -rw-r--r-- | llvm/lib/Fuzzer/FuzzerCorpus.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerCorpus.h b/llvm/lib/Fuzzer/FuzzerCorpus.h index 218ae5b6ac4..2567fe4d135 100644 --- a/llvm/lib/Fuzzer/FuzzerCorpus.h +++ b/llvm/lib/Fuzzer/FuzzerCorpus.h @@ -218,7 +218,6 @@ class InputCorpus { Printf("ADD FEATURE %zd sz %d\n", Idx, NewSize); SmallestElementPerFeature[Idx] = Inputs.size(); InputSizesPerFeature[Idx] = NewSize; - CountingFeatures = true; } } @@ -238,7 +237,6 @@ private: size_t GetFeature(size_t Idx) const { return InputSizesPerFeature[Idx]; } void ValidateFeatureSet() { - if (!CountingFeatures) return; if (FeatureDebug) PrintFeatureSet(); for (size_t Idx = 0; Idx < kFeatureSetSize; Idx++) @@ -256,14 +254,12 @@ private: // Must be called whenever the corpus or unit weights are changed. void UpdateCorpusDistribution() { size_t N = Inputs.size(); + assert(N); Intervals.resize(N + 1); Weights.resize(N); std::iota(Intervals.begin(), Intervals.end(), 0); - if (CountingFeatures) - for (size_t i = 0; i < N; i++) - Weights[i] = Inputs[i]->NumFeatures * (i + 1); - else - std::iota(Weights.begin(), Weights.end(), 1); + for (size_t i = 0; i < N; i++) + Weights[i] = Inputs[i]->NumFeatures * (i + 1); CorpusDistribution = std::piecewise_constant_distribution<double>( Intervals.begin(), Intervals.end(), Weights.begin()); } @@ -275,7 +271,6 @@ private: std::unordered_set<std::string> Hashes; std::vector<InputInfo*> Inputs; - bool CountingFeatures = false; size_t NumAddedFeatures = 0; size_t NumUpdatedFeatures = 0; uint32_t InputSizesPerFeature[kFeatureSetSize]; |

