llvm.org GIT mirror llvm / 4d3c482
llvm-pdbdump-fuzzer: fix the build git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271352 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Serebryany 4 years ago
1 changed file(s) with 9 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
2222
2323 using namespace llvm;
2424
25 extern "C" void LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
25 extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
2626 std::unique_ptr Buff = MemoryBuffer::getMemBuffer(
2727 StringRef((const char *)data, size), "", false);
2828
3232 std::unique_ptr File(new pdb::PDBFile(std::move(Buff)));
3333 if (auto E = File->parseFileHeaders()) {
3434 consumeError(std::move(E));
35 return;
35 return 0;
3636 }
3737 if (auto E = File->parseStreamData()) {
3838 consumeError(std::move(E));
39 return;
39 return 0;
4040 }
4141
4242 auto DbiS = File->getPDBDbiStream();
4343 if (auto E = DbiS.takeError()) {
4444 consumeError(std::move(E));
45 return;
45 return 0;
4646 }
4747 auto TpiS = File->getPDBTpiStream();
4848 if (auto E = TpiS.takeError()) {
4949 consumeError(std::move(E));
50 return;
50 return 0;
5151 }
5252 auto IpiS = File->getPDBIpiStream();
5353 if (auto E = IpiS.takeError()) {
5454 consumeError(std::move(E));
55 return;
55 return 0;
5656 }
5757 auto InfoS = File->getPDBInfoStream();
5858 if (auto E = InfoS.takeError()) {
5959 consumeError(std::move(E));
60 return;
60 return 0;
6161 }
6262 pdb::DbiStream &DS = DbiS.get();
6363
6565 pdb::ModStream ModS(*File, Modi.Info);
6666 if (auto E = ModS.reload()) {
6767 consumeError(std::move(E));
68 return;
68 return 0;
6969 }
7070 codeview::CVSymbolDumper SD(P, TD, nullptr, false);
7171 bool HadError = false;
7373 SD.dump(S);
7474 }
7575 }
76 return 0;
7677 }