mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-22 20:18:38 +00:00
[libFuzzer] cleaner implementation of -print_pcs=1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290739 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4f67d55a96
commit
f178652c93
@ -764,6 +764,7 @@ void Fuzzer::ResetCoverage() {
|
||||
}
|
||||
|
||||
void Fuzzer::Loop() {
|
||||
TPC.InitializePrintNewPCs();
|
||||
system_clock::time_point LastCorpusReload = system_clock::now();
|
||||
if (Options.DoCrossOver)
|
||||
MD.SetCorpus(&Corpus);
|
||||
|
@ -79,14 +79,19 @@ static bool IsInterestingCoverageFile(std::string &File) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void TracePC::InitializePrintNewPCs() {
|
||||
assert(!PrintedPCs);
|
||||
PrintedPCs = new std::set<uintptr_t>;
|
||||
for (size_t i = 1; i < GetNumPCs(); i++)
|
||||
if (PCs[i])
|
||||
PrintedPCs->insert(PCs[i]);
|
||||
}
|
||||
|
||||
void TracePC::PrintNewPCs() {
|
||||
if (DoPrintNewPCs) {
|
||||
if (!PrintedPCs)
|
||||
PrintedPCs = new std::set<uintptr_t>;
|
||||
for (size_t i = 1; i < GetNumPCs(); i++)
|
||||
if (PCs[i] && PrintedPCs->insert(PCs[i]).second)
|
||||
PrintPC("\tNEW_PC: %p %F %L\n", "\tNEW_PC: %p\n", PCs[i]);
|
||||
}
|
||||
assert(PrintedPCs);
|
||||
for (size_t i = 1; i < GetNumPCs(); i++)
|
||||
if (PCs[i] && PrintedPCs->insert(PCs[i]).second)
|
||||
PrintPC("\tNEW_PC: %p %F %L\n", "\tNEW_PC: %p\n", PCs[i]);
|
||||
}
|
||||
|
||||
void TracePC::PrintCoverage() {
|
||||
|
@ -85,6 +85,7 @@ class TracePC {
|
||||
TableOfRecentCompares<uint64_t, kTORCSize> TORC8;
|
||||
|
||||
void PrintNewPCs();
|
||||
void InitializePrintNewPCs();
|
||||
size_t GetNumPCs() const { return Min(kNumPCs, NumGuards + 1); }
|
||||
uintptr_t GetPC(size_t Idx) {
|
||||
assert(Idx < GetNumPCs());
|
||||
|
Loading…
Reference in New Issue
Block a user