[libFuzzer] make sure to update CurrentUnit when drilling
authorKostya Serebryany <kcc@google.com>
Wed, 13 Jan 2016 01:58:27 +0000 (01:58 +0000)
committerKostya Serebryany <kcc@google.com>
Wed, 13 Jan 2016 01:58:27 +0000 (01:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257560 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Fuzzer/FuzzerLoop.cpp

index 089e911a697bfec0aaeed4bb912ee02fc3f415de..5237682ff24d58001e1d9159133dc792050874c5 100644 (file)
@@ -455,12 +455,15 @@ void Fuzzer::Drill() {
 
   PrintStats("REINIT");
   SavedOutputCorpusPath.swap(Options.OutputCorpus);
-  for (auto &U : SavedCorpus)
+  for (auto &U : SavedCorpus) {
+    CurrentUnit = U;
     RunOne(U);
+  }
   PrintStats("MERGE ");
   Options.PrintNEW = true;
   size_t NumMerged = 0;
   for (auto &U : Corpus) {
+    CurrentUnit = U;
     if (RunOne(U)) {
       PrintStatusForNewUnit(U);
       NumMerged++;