diff options
| author | 2020-08-03 15:06:44 +0000 | |
|---|---|---|
| committer | 2020-08-03 15:06:44 +0000 | |
| commit | b64793999546ed8adebaeebd9d8345d18db8927d (patch) | |
| tree | 4357c27b561d73b0e089727c6ed659f2ceff5f47 /gnu/llvm/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp | |
| parent | Add support for UTF-8 DISPLAY-HINTs with octet length. For now only (diff) | |
| download | wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.tar.xz wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.zip | |
Remove LLVM 8.0.1 files.
Diffstat (limited to 'gnu/llvm/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp')
| -rw-r--r-- | gnu/llvm/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/gnu/llvm/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp b/gnu/llvm/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp deleted file mode 100644 index 2caccaa0fb6..00000000000 --- a/gnu/llvm/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//===-- llvm-dwarfdump-fuzzer.cpp - Fuzz the llvm-dwarfdump tool ----------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// This file implements a function that runs llvm-dwarfdump -/// on a single input. This function is then linked into the Fuzzer library. -/// -//===----------------------------------------------------------------------===// -#include "llvm/DebugInfo/DIContext.h" -#include "llvm/DebugInfo/DWARF/DWARFContext.h" -#include "llvm/Object/ObjectFile.h" -#include "llvm/Support/MemoryBuffer.h" - -using namespace llvm; -using namespace object; - -extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) { - std::unique_ptr<MemoryBuffer> Buff = MemoryBuffer::getMemBuffer( - StringRef((const char *)data, size), "", false); - - Expected<std::unique_ptr<ObjectFile>> ObjOrErr = - ObjectFile::createObjectFile(Buff->getMemBufferRef()); - if (auto E = ObjOrErr.takeError()) { - consumeError(std::move(E)); - return 0; - } - ObjectFile &Obj = *ObjOrErr.get(); - std::unique_ptr<DIContext> DICtx = DWARFContext::create(Obj); - - - DIDumpOptions opts; - opts.DumpType = DIDT_All; - DICtx->dump(nulls(), opts); - return 0; -} |
