[llvm] r272230 - [pdbdump-fuzzer] Try to fix build errors in fuzzer.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 8 17:21:37 PDT 2016
Author: zturner
Date: Wed Jun 8 19:21:37 2016
New Revision: 272230
URL: http://llvm.org/viewvc/llvm-project?rev=272230&view=rev
Log:
[pdbdump-fuzzer] Try to fix build errors in fuzzer.
Modified:
llvm/trunk/tools/llvm-pdbdump/fuzzer/llvm-pdbdump-fuzzer.cpp
Modified: llvm/trunk/tools/llvm-pdbdump/fuzzer/llvm-pdbdump-fuzzer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/fuzzer/llvm-pdbdump-fuzzer.cpp?rev=272230&r1=272229&r2=272230&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/fuzzer/llvm-pdbdump-fuzzer.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/fuzzer/llvm-pdbdump-fuzzer.cpp Wed Jun 8 19:21:37 2016
@@ -15,6 +15,8 @@
#include "llvm/DebugInfo/CodeView/SymbolDumper.h"
#include "llvm/DebugInfo/CodeView/TypeDumper.h"
#include "llvm/DebugInfo/PDB/Raw/DbiStream.h"
+#include "llvm/DebugInfo/PDB/Raw/IPDBStreamData.h"
+#include "llvm/DebugInfo/PDB/Raw/MappedBlockStream.h"
#include "llvm/DebugInfo/PDB/Raw/ModStream.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
#include "llvm/DebugInfo/PDB/Raw/RawSession.h"
@@ -63,7 +65,13 @@ extern "C" int LLVMFuzzerTestOneInput(ui
pdb::DbiStream &DS = DbiS.get();
for (auto &Modi : DS.modules()) {
- pdb::ModStream ModS(*File, Modi.Info);
+ auto ModStreamData = pdb::MappedBlockStream::createIndexedStream(
+ Modi.Info.getModuleStreamIndex(), *File);
+ if (!ModStreamData) {
+ consumeError(ModStreamData.takeError());
+ return 0;
+ }
+ pdb::ModStream ModS(Modi.Info, std::move(*ModStreamData));
if (auto E = ModS.reload()) {
consumeError(std::move(E));
return 0;
More information about the llvm-commits
mailing list