summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/fuzzer/FuzzerCorpus.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerCorpus.h')
-rw-r--r--compiler-rt/lib/fuzzer/FuzzerCorpus.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerCorpus.h b/compiler-rt/lib/fuzzer/FuzzerCorpus.h
index f844c07c757..8ad14656cff 100644
--- a/compiler-rt/lib/fuzzer/FuzzerCorpus.h
+++ b/compiler-rt/lib/fuzzer/FuzzerCorpus.h
@@ -238,6 +238,12 @@ class InputCorpus {
return false;
}
+ bool IsFeatureNew(size_t Idx, uint32_t NewSize, bool Shrink) {
+ assert(NewSize);
+ uint32_t OldSize = GetFeature(Idx % kFeatureSetSize);
+ return OldSize == 0 || (Shrink && OldSize > NewSize);
+ }
+
size_t NumFeatures() const { return NumAddedFeatures; }
size_t NumFeatureUpdates() const { return NumUpdatedFeatures; }
OpenPOWER on IntegriCloud