diff options
| author | Kostya Serebryany <kcc@google.com> | 2016-08-17 20:45:23 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2016-08-17 20:45:23 +0000 |
| commit | a9a548049a29fb73b95bfdeea1a606b42a8d5c85 (patch) | |
| tree | 3de0c00cd0f625a8e62ba87437339f7c2c217dfe /llvm/lib/Fuzzer/FuzzerUtil.cpp | |
| parent | 10ae33a9063d5f18a171d16f7f73ed97e42ee3a9 (diff) | |
| download | bcm5719-llvm-a9a548049a29fb73b95bfdeea1a606b42a8d5c85.tar.gz bcm5719-llvm-a9a548049a29fb73b95bfdeea1a606b42a8d5c85.zip | |
[libFuzzer] when printing the reproducer input, also print the base input and the mutation sequence
llvm-svn: 278975
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerUtil.cpp')
| -rw-r--r-- | llvm/lib/Fuzzer/FuzzerUtil.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerUtil.cpp b/llvm/lib/Fuzzer/FuzzerUtil.cpp index a5218d422da..6764a46e7d6 100644 --- a/llvm/lib/Fuzzer/FuzzerUtil.cpp +++ b/llvm/lib/Fuzzer/FuzzerUtil.cpp @@ -63,15 +63,19 @@ void PrintASCII(const Unit &U, const char *PrintAfter) { PrintASCII(U.data(), U.size(), PrintAfter); } -std::string Hash(const Unit &U) { - uint8_t Hash[kSHA1NumBytes]; - ComputeSHA1(U.data(), U.size(), Hash); +std::string Sha1ToString(uint8_t Sha1[kSHA1NumBytes]) { std::stringstream SS; for (int i = 0; i < kSHA1NumBytes; i++) - SS << std::hex << std::setfill('0') << std::setw(2) << (unsigned)Hash[i]; + SS << std::hex << std::setfill('0') << std::setw(2) << (unsigned)Sha1[i]; return SS.str(); } +std::string Hash(const Unit &U) { + uint8_t Hash[kSHA1NumBytes]; + ComputeSHA1(U.data(), U.size(), Hash); + return Sha1ToString(Hash); +} + static void AlarmHandler(int, siginfo_t *, void *) { Fuzzer::StaticAlarmCallback(); } |

