diff options
| author | Kostya Serebryany <kcc@google.com> | 2019-01-30 06:21:20 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2019-01-30 06:21:20 +0000 |
| commit | 3ba2b09f35cfb78b54ff1753c613023e84845d96 (patch) | |
| tree | 0c34ebbc17987edc1928dc50d37c7509f47e8fb3 /lib/fuzzer/FuzzerLoop.cpp | |
| parent | 42ff6f1cd36ecd3217c5b53d83b8f404738b2601 (diff) | |
| download | compiler-rt-3ba2b09f35cfb78b54ff1753c613023e84845d96.tar.gz | |
[libFuzzer] remove stale code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@352604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/FuzzerLoop.cpp')
| -rw-r--r-- | lib/fuzzer/FuzzerLoop.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/fuzzer/FuzzerLoop.cpp b/lib/fuzzer/FuzzerLoop.cpp index affd6a417..0247b574d 100644 --- a/lib/fuzzer/FuzzerLoop.cpp +++ b/lib/fuzzer/FuzzerLoop.cpp @@ -13,7 +13,6 @@ #include "FuzzerInternal.h" #include "FuzzerMutate.h" #include "FuzzerRandom.h" -#include "FuzzerShmem.h" #include "FuzzerTracePC.h" #include <algorithm> #include <cstring> @@ -40,8 +39,6 @@ static const size_t kMaxUnitSizeToPrint = 256; thread_local bool Fuzzer::IsMyThread; -SharedMemoryRegion SMR; - bool RunningUserCallback = false; // Only one Fuzzer per process. @@ -510,8 +507,6 @@ void Fuzzer::ExecuteCallback(const uint8_t *Data, size_t Size) { TPC.RecordInitialStack(); TotalNumberOfRuns++; assert(InFuzzingThread()); - if (SMR.IsClient()) - SMR.WriteByteArray(Data, Size); // We copy the contents of Unit into a separate heap buffer // so that we reliably find buffer overflows in it. uint8_t *DataCopy = new uint8_t[Size]; @@ -821,30 +816,6 @@ void Fuzzer::MinimizeCrashLoop(const Unit &U) { } } -void Fuzzer::AnnounceOutput(const uint8_t *Data, size_t Size) { - if (SMR.IsServer()) { - SMR.WriteByteArray(Data, Size); - } else if (SMR.IsClient()) { - SMR.PostClient(); - SMR.WaitServer(); - size_t OtherSize = SMR.ReadByteArraySize(); - uint8_t *OtherData = SMR.GetByteArray(); - if (Size != OtherSize || memcmp(Data, OtherData, Size) != 0) { - size_t i = 0; - for (i = 0; i < Min(Size, OtherSize); i++) - if (Data[i] != OtherData[i]) - break; - Printf("==%lu== ERROR: libFuzzer: equivalence-mismatch. Sizes: %zd %zd; " - "offset %zd\n", - GetPid(), Size, OtherSize, i); - DumpCurrentUnit("mismatch-"); - Printf("SUMMARY: libFuzzer: equivalence-mismatch\n"); - PrintFinalStats(); - _Exit(Options.ErrorExitCode); - } - } -} - } // namespace fuzzer extern "C" { @@ -855,10 +826,4 @@ LLVMFuzzerMutate(uint8_t *Data, size_t Size, size_t MaxSize) { return fuzzer::F->GetMD().DefaultMutate(Data, Size, MaxSize); } -// Experimental -ATTRIBUTE_INTERFACE void -LLVMFuzzerAnnounceOutput(const uint8_t *Data, size_t Size) { - assert(fuzzer::F); - fuzzer::F->AnnounceOutput(Data, Size); -} } // extern "C" |
