[llvm] r311968 - fix llvm-dwarfdump-fuzzer.cpp to use the current libFuzzer API
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 28 18:14:05 PDT 2017
Author: kcc
Date: Mon Aug 28 18:14:05 2017
New Revision: 311968
URL: http://llvm.org/viewvc/llvm-project?rev=311968&view=rev
Log:
fix llvm-dwarfdump-fuzzer.cpp to use the current libFuzzer API
Modified:
llvm/trunk/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp
Modified: llvm/trunk/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp?rev=311968&r1=311967&r2=311968&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp (original)
+++ llvm/trunk/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp Mon Aug 28 18:14:05 2017
@@ -20,7 +20,7 @@
using namespace llvm;
using namespace object;
-extern "C" void LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
+extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
std::unique_ptr<MemoryBuffer> Buff = MemoryBuffer::getMemBuffer(
StringRef((const char *)data, size), "", false);
@@ -28,7 +28,7 @@ extern "C" void LLVMFuzzerTestOneInput(u
ObjectFile::createObjectFile(Buff->getMemBufferRef());
if (auto E = ObjOrErr.takeError()) {
consumeError(std::move(E));
- return;
+ return 0;
}
ObjectFile &Obj = *ObjOrErr.get();
std::unique_ptr<DIContext> DICtx = DWARFContext::create(Obj);
@@ -37,4 +37,5 @@ extern "C" void LLVMFuzzerTestOneInput(u
DIDumpOptions opts;
opts.DumpType = DIDT_All;
DICtx->dump(nulls(), opts);
+ return 0;
}
More information about the llvm-commits
mailing list