[PATCH] D23143: pdbdump: Fix crash bug.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 16:51:18 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL277681: pdbdump: Fix crash bug. (authored by ruiu).

Changed prior to commit:
  https://reviews.llvm.org/D23143?vs=66734&id=66737#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23143

Files:
  llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
  llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
  llvm/trunk/test/DebugInfo/PDB/pdbdump-readwrite.test

Index: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
===================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
@@ -49,7 +49,7 @@
   Expected<std::unique_ptr<DbiStream>> build(PDBFile &File,
                                              const msf::WritableStream &Buffer);
   Error commit(const msf::MSFLayout &Layout,
-               const msf::WritableStream &Buffer) const;
+               const msf::WritableStream &Buffer);
 
 private:
   Error finalize();
Index: llvm/trunk/test/DebugInfo/PDB/pdbdump-readwrite.test
===================================================================
--- llvm/trunk/test/DebugInfo/PDB/pdbdump-readwrite.test
+++ llvm/trunk/test/DebugInfo/PDB/pdbdump-readwrite.test
@@ -0,0 +1,4 @@
+; RUN: llvm-pdbdump pdb2yaml -dbi-module-info -dbi-module-source-info \
+; RUN:   -dbi-stream -pdb-stream -stream-directory -stream-metadata \
+; RUN:   %p/Inputs/empty.pdb > %t.1
+; RUN: llvm-pdbdump yaml2pdb -pdb=%t.2 %t.1
Index: llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
+++ llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
@@ -249,7 +249,10 @@
 }
 
 Error DbiStreamBuilder::commit(const msf::MSFLayout &Layout,
-                               const msf::WritableStream &Buffer) const {
+                               const msf::WritableStream &Buffer) {
+  if (auto EC = finalize())
+    return EC;
+
   auto InfoS =
       WritableMappedBlockStream::createIndexedStream(Layout, Buffer, StreamDBI);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23143.66737.patch
Type: text/x-patch
Size: 1724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160803/3993f12d/attachment.bin>


More information about the llvm-commits mailing list