summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Fuzzer/FuzzerInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/lib/Fuzzer/FuzzerInterface.cpp')
-rw-r--r--gnu/llvm/lib/Fuzzer/FuzzerInterface.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/gnu/llvm/lib/Fuzzer/FuzzerInterface.cpp b/gnu/llvm/lib/Fuzzer/FuzzerInterface.cpp
new file mode 100644
index 00000000000..bcd726fc08e
--- /dev/null
+++ b/gnu/llvm/lib/Fuzzer/FuzzerInterface.cpp
@@ -0,0 +1,30 @@
+//===- FuzzerInterface.cpp - Mutate a test input --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Parts of public interface for libFuzzer.
+//===----------------------------------------------------------------------===//
+
+
+#include "FuzzerInterface.h"
+#include "FuzzerInternal.h"
+
+namespace fuzzer {
+
+void FuzzerRandomLibc::ResetSeed(unsigned int seed) { srand(seed); }
+
+size_t FuzzerRandomLibc::Rand() { return rand(); }
+
+UserSuppliedFuzzer::UserSuppliedFuzzer(FuzzerRandomBase *Rand)
+ : Rand(Rand), MD(*Rand) {}
+
+UserSuppliedFuzzer::~UserSuppliedFuzzer() {
+ if (OwnRand)
+ delete Rand;
+}
+
+} // namespace fuzzer.