summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerCorpus.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-12-16 22:42:05 +0000
committerKostya Serebryany <kcc@google.com>2016-12-16 22:42:05 +0000
commitbe7003f99c778beb4917b0caa19c974b0b5bc6fb (patch)
tree824540b5bec2d77501b173d3de3720ad94f1ae5a /llvm/lib/Fuzzer/FuzzerCorpus.h
parent7972bb7b875b275799b968cb57773aca54ba17fe (diff)
downloadbcm5719-llvm-be7003f99c778beb4917b0caa19c974b0b5bc6fb.tar.gz
bcm5719-llvm-be7003f99c778beb4917b0caa19c974b0b5bc6fb.zip
[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
llvm-svn: 289998
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerCorpus.h')
-rw-r--r--llvm/lib/Fuzzer/FuzzerCorpus.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerCorpus.h b/llvm/lib/Fuzzer/FuzzerCorpus.h
index 663c5854b4c..42b3d2482fa 100644
--- a/llvm/lib/Fuzzer/FuzzerCorpus.h
+++ b/llvm/lib/Fuzzer/FuzzerCorpus.h
@@ -59,6 +59,12 @@ class InputCorpus {
Res += !II->U.empty();
return Res;
}
+ size_t MaxInputSize() const {
+ size_t Res = 0;
+ for (auto II : Inputs)
+ Res = std::max(Res, II->U.size());
+ return Res;
+ }
bool empty() const { return Inputs.empty(); }
const Unit &operator[] (size_t Idx) const { return Inputs[Idx]->U; }
void AddToCorpus(const Unit &U, size_t NumFeatures, bool MayDeleteFile = false) {
OpenPOWER on IntegriCloud