From: Kostya Serebryany Date: Tue, 15 Mar 2016 01:28:00 +0000 (+0000) Subject: [libFuzzer] use max_len exactly equal to the max size of input. Fix 32-bit build X-Git-Tag: llvmorg-3.9.0-rc1~11713 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c5e3af862d9b594fef7609be8388342bdf5de89;p=platform%2Fupstream%2Fllvm.git [libFuzzer] use max_len exactly equal to the max size of input. Fix 32-bit build llvm-svn: 263518 --- diff --git a/llvm/lib/Fuzzer/FuzzerDriver.cpp b/llvm/lib/Fuzzer/FuzzerDriver.cpp index 50a9cff..386caef 100644 --- a/llvm/lib/Fuzzer/FuzzerDriver.cpp +++ b/llvm/lib/Fuzzer/FuzzerDriver.cpp @@ -270,6 +270,7 @@ static int FuzzerDriver(const std::vector &Args, return RunInMultipleProcesses(Args, Flags.workers, Flags.jobs); const size_t kMaxSaneLen = 1 << 20; + const size_t kMinDefaultLen = 64; Fuzzer::FuzzingOptions Options; Options.Verbosity = Flags.verbosity; Options.MaxLen = Flags.max_len; @@ -373,7 +374,7 @@ static int FuzzerDriver(const std::vector &Args, if (Options.MaxLen == 0) F.SetMaxLen( - std::min(std::max(64UL, 2 * F.MaxUnitSizeInCorpus()), kMaxSaneLen)); + std::min(std::max(kMinDefaultLen, F.MaxUnitSizeInCorpus()), kMaxSaneLen)); if (F.CorpusSize() == 0) F.AddToCorpus(Unit()); // Can't fuzz empty corpus, so add an empty input.