pdbdump: Fix crash bug.
authorRui Ueyama <ruiu@google.com>
Wed, 3 Aug 2016 23:43:23 +0000 (23:43 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 3 Aug 2016 23:43:23 +0000 (23:43 +0000)
commitd1d8c8312a41f10f294978decc57c3f5dcfef205
tree04296daf3e14251ce573762d15d9792afedeeefe
parent965827d6742b5296cfbb247f88b2904dd75b9703
pdbdump: Fix crash bug.

pdbdump calls DbiStreamBuilder::commit through PDBFileBuilder::commit
without calling DbiStreamBuilder::finalize. Because `finalize` initializes
`Header` member, `Header` remained nullptr which caused a crash bug.

Differential Revision: https://reviews.llvm.org/D23143

llvm-svn: 277681
llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
llvm/test/DebugInfo/PDB/pdbdump-readwrite.test [new file with mode: 0644]