mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-04 16:47:41 +00:00
[libFuzzer] when adding a reduced input print REDUCED instead of NEW
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308336 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4ea9a7811e
commit
9c21c1e832
@ -34,6 +34,7 @@ struct InputInfo {
|
||||
size_t NumExecutedMutations = 0;
|
||||
size_t NumSuccessfullMutations = 0;
|
||||
bool MayDeleteFile = false;
|
||||
bool Reduced = false;
|
||||
std::vector<uint32_t> UniqFeatureSet;
|
||||
};
|
||||
|
||||
@ -126,12 +127,13 @@ class InputCorpus {
|
||||
}
|
||||
|
||||
void Replace(InputInfo *II, const Unit &U) {
|
||||
assert(II->U.size());
|
||||
assert(II->U.size() > U.size());
|
||||
Hashes.erase(Sha1ToString(II->Sha1));
|
||||
DeleteFile(*II);
|
||||
ComputeSHA1(U.data(), U.size(), II->Sha1);
|
||||
Hashes.insert(Sha1ToString(II->Sha1));
|
||||
II->U = U;
|
||||
II->Reduced = true;
|
||||
}
|
||||
|
||||
bool HasUnit(const Unit &U) { return Hashes.count(Hash(U)); }
|
||||
|
@ -99,7 +99,7 @@ private:
|
||||
void WriteToOutputCorpus(const Unit &U);
|
||||
void WriteUnitToFileWithPrefix(const Unit &U, const char *Prefix);
|
||||
void PrintStats(const char *Where, const char *End = "\n", size_t Units = 0);
|
||||
void PrintStatusForNewUnit(const Unit &U);
|
||||
void PrintStatusForNewUnit(const Unit &U, const char *Text);
|
||||
void ShuffleCorpus(UnitVector *V);
|
||||
void CheckExitOnSrcPosOrItem();
|
||||
|
||||
|
@ -507,10 +507,10 @@ void Fuzzer::WriteUnitToFileWithPrefix(const Unit &U, const char *Prefix) {
|
||||
Printf("Base64: %s\n", Base64(U).c_str());
|
||||
}
|
||||
|
||||
void Fuzzer::PrintStatusForNewUnit(const Unit &U) {
|
||||
void Fuzzer::PrintStatusForNewUnit(const Unit &U, const char *Text) {
|
||||
if (!Options.PrintNEW)
|
||||
return;
|
||||
PrintStats("NEW ", "");
|
||||
PrintStats(Text, "");
|
||||
if (Options.Verbosity) {
|
||||
Printf(" L: %zd ", U.size());
|
||||
MD.PrintMutationSequence();
|
||||
@ -521,7 +521,8 @@ void Fuzzer::PrintStatusForNewUnit(const Unit &U) {
|
||||
void Fuzzer::ReportNewCoverage(InputInfo *II, const Unit &U) {
|
||||
II->NumSuccessfullMutations++;
|
||||
MD.RecordSuccessfulMutationSequence();
|
||||
PrintStatusForNewUnit(U);
|
||||
PrintStatusForNewUnit(U, II->Reduced ? "REDUCE" :
|
||||
"NEW ");
|
||||
WriteToOutputCorpus(U);
|
||||
NumberOfNewUnitsAdded++;
|
||||
TPC.PrintNewPCs();
|
||||
|
Loading…
x
Reference in New Issue
Block a user