[llvm] r271242 - [llvm-dwarfdump-fuzzer] Get this compiling again
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Mon May 30 18:24:33 PDT 2016
Author: majnemer
Date: Mon May 30 20:24:33 2016
New Revision: 271242
URL: http://llvm.org/viewvc/llvm-project?rev=271242&view=rev
Log:
[llvm-dwarfdump-fuzzer] Get this compiling again
Looks like the dwarfdump fuzzer has bitrotted, update it to take into
account updates to the libobject 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=271242&r1=271241&r2=271242&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp (original)
+++ llvm/trunk/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp Mon May 30 20:24:33 2016
@@ -24,10 +24,12 @@ extern "C" void LLVMFuzzerTestOneInput(u
std::unique_ptr<MemoryBuffer> Buff = MemoryBuffer::getMemBuffer(
StringRef((const char *)data, size), "", false);
- ErrorOr<std::unique_ptr<ObjectFile>> ObjOrErr =
+ Expected<std::unique_ptr<ObjectFile>> ObjOrErr =
ObjectFile::createObjectFile(Buff->getMemBufferRef());
- if (!ObjOrErr)
+ if (auto E = ObjOrErr.takeError()) {
+ consumeError(std::move(E));
return;
+ }
ObjectFile &Obj = *ObjOrErr.get();
std::unique_ptr<DIContext> DICtx(new DWARFContextInMemory(Obj));
DICtx->dump(nulls(), DIDT_All);
More information about the llvm-commits
mailing list