[PATCH] D39850: [libFuzzer] Don't add leaking inputs to corpus.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 10:06:26 PST 2017


morehouse created this revision.

https://reviews.llvm.org/D39850

Files:
  compiler-rt/lib/fuzzer/FuzzerLoop.cpp


Index: compiler-rt/lib/fuzzer/FuzzerLoop.cpp
===================================================================
--- compiler-rt/lib/fuzzer/FuzzerLoop.cpp
+++ compiler-rt/lib/fuzzer/FuzzerLoop.cpp
@@ -627,11 +627,12 @@
     assert(NewSize <= CurrentMaxMutationLen && "Mutator return oversized unit");
     Size = NewSize;
     II.NumExecutedMutations++;
-    if (RunOne(CurrentUnitData, Size, /*MayDeleteFile=*/true, &II))
-      ReportNewCoverage(&II, {CurrentUnitData, CurrentUnitData + Size});
 
+    bool NewCov = RunOne(CurrentUnitData, Size, /*MayDeleteFile=*/true, &II);
     TryDetectingAMemoryLeak(CurrentUnitData, Size,
                             /*DuringInitialCorpusExecution*/ false);
+    if (NewCov)
+      ReportNewCoverage(&II, {CurrentUnitData, CurrentUnitData + Size});
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39850.122264.patch
Type: text/x-patch
Size: 801 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171109/6677a0fd/attachment.bin>


More information about the llvm-commits mailing list