Kostya Serebryany | f342459 | 2015-05-22 22:35:31 +0000 | [diff] [blame] | 1 | //===- FuzzerInterface.cpp - Mutate a test input --------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // Parts of public interface for libFuzzer. |
| 10 | //===----------------------------------------------------------------------===// |
| 11 | |
| 12 | |
| 13 | #include "FuzzerInterface.h" |
| 14 | #include "FuzzerInternal.h" |
| 15 | |
| 16 | namespace fuzzer { |
Kostya Serebryany | 404c69f | 2015-07-24 01:06:40 +0000 | [diff] [blame] | 17 | |
| 18 | void FuzzerRandomLibc::ResetSeed(int seed) { srand(seed); } |
| 19 | |
| 20 | size_t FuzzerRandomLibc::Rand() { return rand(); } |
| 21 | |
Kostya Serebryany | ec2dcb1 | 2015-09-03 21:24:19 +0000 | [diff] [blame] | 22 | UserSuppliedFuzzer::UserSuppliedFuzzer(FuzzerRandomBase *Rand) |
| 23 | : Rand(Rand), MD(*Rand) {} |
Kostya Serebryany | 404c69f | 2015-07-24 01:06:40 +0000 | [diff] [blame] | 24 | |
| 25 | UserSuppliedFuzzer::~UserSuppliedFuzzer() { |
| 26 | if (OwnRand) |
| 27 | delete Rand; |
| 28 | } |
| 29 | |
Kostya Serebryany | f342459 | 2015-05-22 22:35:31 +0000 | [diff] [blame] | 30 | } // namespace fuzzer. |