aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Fuzzer/FuzzerLoop.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-08-17 20:45:23 +0000
committerKostya Serebryany <kcc@google.com>2016-08-17 20:45:23 +0000
commita9a548049a29fb73b95bfdeea1a606b42a8d5c85 (patch)
tree3de0c00cd0f625a8e62ba87437339f7c2c217dfe /llvm/lib/Fuzzer/FuzzerLoop.cpp
parent10ae33a9063d5f18a171d16f7f73ed97e42ee3a9 (diff)
downloadllvm-a9a548049a29fb73b95bfdeea1a606b42a8d5c85.zip
llvm-a9a548049a29fb73b95bfdeea1a606b42a8d5c85.tar.gz
llvm-a9a548049a29fb73b95bfdeea1a606b42a8d5c85.tar.bz2
[libFuzzer] when printing the reproducer input, also print the base input and the mutation sequence
llvm-svn: 278975
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerLoop.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp
index 07de3c7..5d94483 100644
--- a/llvm/lib/Fuzzer/FuzzerLoop.cpp
+++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp
@@ -204,6 +204,8 @@ void Fuzzer::StaticDeathCallback() {
void Fuzzer::DumpCurrentUnit(const char *Prefix) {
if (!CurrentUnitData) return; // Happens when running individual inputs.
+ MD.PrintMutationSequence();
+ Printf("; base unit: %s\n", Sha1ToString(BaseSha1).c_str());
size_t UnitSize = CurrentUnitSize;
if (UnitSize <= kMaxUnitSizeToPrint) {
PrintHexArray(CurrentUnitData, UnitSize, "\n");
@@ -693,6 +695,7 @@ void Fuzzer::MutateAndTestOne() {
MD.StartMutationSequence();
auto &U = ChooseUnitToMutate();
+ ComputeSHA1(U.data(), U.size(), BaseSha1); // Remember where we started.
assert(CurrentUnitData);
size_t Size = U.size();
assert(Size <= Options.MaxLen && "Oversized Unit");