[PATCH] D23143: pdbdump: Fix crash bug.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 3 16:40:39 PDT 2016
ruiu updated this revision to Diff 66734.
ruiu added a comment.
- Updated the correct patch.
https://reviews.llvm.org/D23143
Files:
include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
test/DebugInfo/PDB/pdbdump-readwrite.test
Index: test/DebugInfo/PDB/pdbdump-readwrite.test
===================================================================
--- /dev/null
+++ 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: lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
===================================================================
--- lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
+++ 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);
Index: include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
===================================================================
--- include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
+++ 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();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23143.66734.patch
Type: text/x-patch
Size: 1593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160803/89a81002/attachment.bin>
More information about the llvm-commits
mailing list