OSDN Git Service

[libFuzzer] try to use less RAM while processing the initial corpus
authorKostya Serebryany <kcc@google.com>
Mon, 14 Aug 2017 20:34:35 +0000 (20:34 +0000)
committerKostya Serebryany <kcc@google.com>
Mon, 14 Aug 2017 20:34:35 +0000 (20:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310881 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Fuzzer/FuzzerLoop.cpp

index 2064783..2349459 100644 (file)
@@ -388,11 +388,12 @@ void Fuzzer::ShuffleAndMinimize(UnitVector *InitialCorpus) {
   uint8_t dummy;
   ExecuteCallback(&dummy, 0);
 
-  for (const auto &U : *InitialCorpus) {
+  for (auto &U : *InitialCorpus) {
     RunOne(U.data(), U.size());
     CheckExitOnSrcPosOrItem();
     TryDetectingAMemoryLeak(U.data(), U.size(),
                             /*DuringInitialCorpusExecution*/ true);
+    U.clear();
   }
   PrintStats("INITED");
   if (Corpus.empty()) {