Skip to content

Commit bcd7849

Browse files
committed
[libFuzzer] minor refactoring, NFC
llvm-svn: 313406
1 parent eed0973 commit bcd7849

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

compiler-rt/lib/fuzzer/FuzzerDriver.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,8 @@ int AnalyzeDictionary(Fuzzer *F, const Vector<Unit>& Dict,
471471
// Get coverage for the testcase without modifications.
472472
F->ExecuteCallback(C.data(), C.size());
473473
InitialFeatures.clear();
474-
TPC.CollectFeatures([&](size_t Feature) -> bool {
474+
TPC.CollectFeatures([&](size_t Feature) {
475475
InitialFeatures.push_back(Feature);
476-
return true;
477476
});
478477

479478
for (size_t i = 0; i < Dict.size(); ++i) {
@@ -498,9 +497,8 @@ int AnalyzeDictionary(Fuzzer *F, const Vector<Unit>& Dict,
498497
// Get coverage for testcase with masked occurrences of dictionary unit.
499498
F->ExecuteCallback(Data.data(), Data.size());
500499
ModifiedFeatures.clear();
501-
TPC.CollectFeatures([&](size_t Feature) -> bool {
500+
TPC.CollectFeatures([&](size_t Feature) {
502501
ModifiedFeatures.push_back(Feature);
503-
return true;
504502
});
505503

506504
if (InitialFeatures == ModifiedFeatures)

compiler-rt/lib/fuzzer/FuzzerMerge.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,9 @@ void Fuzzer::CrashResistantMergeInternalStep(const std::string &CFPath) {
241241
// So it makes no sense to record all features for all files, instead we
242242
// only record features that were not seen before.
243243
Set<size_t> UniqFeatures;
244-
TPC.CollectFeatures([&](size_t Feature) -> bool {
244+
TPC.CollectFeatures([&](size_t Feature) {
245245
if (AllFeatures.insert(Feature).second)
246246
UniqFeatures.insert(Feature);
247-
return true;
248247
});
249248
// Show stats.
250249
if (!(TotalNumberOfRuns & (TotalNumberOfRuns - 1)))

compiler-rt/lib/fuzzer/FuzzerTracePC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ unsigned CounterToFeature(T Counter) {
208208
return Bit;
209209
}
210210

211-
template <class Callback> // bool Callback(size_t Feature)
211+
template <class Callback> // void Callback(size_t Feature)
212212
ATTRIBUTE_NO_SANITIZE_ADDRESS
213213
__attribute__((noinline))
214214
void TracePC::CollectFeatures(Callback HandleFeature) const {

0 commit comments

Comments
 (0)