aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Fuzzer/FuzzerMutate.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-02-13 03:25:16 +0000
committerKostya Serebryany <kcc@google.com>2016-02-13 03:25:16 +0000
commit7ec0c56e07eb9fa7b571274214e2452c33adaabc (patch)
treea4f8770aa2c4dae850330479505b22ce12af7c63 /llvm/lib/Fuzzer/FuzzerMutate.cpp
parenta399221c32a4143f922005278914525014962fec (diff)
downloadllvm-7ec0c56e07eb9fa7b571274214e2452c33adaabc.zip
llvm-7ec0c56e07eb9fa7b571274214e2452c33adaabc.tar.gz
llvm-7ec0c56e07eb9fa7b571274214e2452c33adaabc.tar.bz2
[libFuzzer] get rid of UserSuppliedFuzzer; NFC
llvm-svn: 260798
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerMutate.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerMutate.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerMutate.cpp b/llvm/lib/Fuzzer/FuzzerMutate.cpp
index eed2881..d5eece6 100644
--- a/llvm/lib/Fuzzer/FuzzerMutate.cpp
+++ b/llvm/lib/Fuzzer/FuzzerMutate.cpp
@@ -76,6 +76,7 @@ private:
const size_t Dictionary::kMaxDictSize;
+
struct MutationDispatcher::Impl {
// Dictionary provided by the user via -dict=DICT_FILE.
Dictionary ManualDictionary;
@@ -113,6 +114,12 @@ struct MutationDispatcher::Impl {
size_t MaxSize);
};
+size_t Mutate(uint8_t *Data, size_t Size, size_t MaxSize, unsigned int Seed) {
+ Random R(Seed);
+ MutationDispatcher MD(R);
+ return MD.Mutate(Data, Size, MaxSize);
+}
+
static char FlipRandomBit(char X, Random &Rand) {
int Bit = Rand(8);
char Mask = 1 << Bit;