[llvm] r283824 - Fix a bug in DbiStreamBuilder::addDbgStream.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 10 16:44:05 PDT 2016
Author: ruiu
Date: Mon Oct 10 18:44:04 2016
New Revision: 283824
URL: http://llvm.org/viewvc/llvm-project?rev=283824&view=rev
Log:
Fix a bug in DbiStreamBuilder::addDbgStream.
This feature will be tested in LLD unit tests.
Modified:
llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h?rev=283824&r1=283823&r2=283824&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h Mon Oct 10 18:44:04 2016
@@ -101,7 +101,8 @@ private:
msf::WritableStreamRef NamesBuffer;
msf::MutableByteStream ModInfoBuffer;
msf::MutableByteStream FileInfoBuffer;
- llvm::SmallVector<DebugStream, (int)DbgHeaderType::Max> DbgStreams;
+ llvm::SmallVector<DebugStream, (int)DbgHeaderType::Max> DbgStreams{
+ (int)DbgHeaderType::Max};
};
}
}
Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp?rev=283824&r1=283823&r2=283824&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp Mon Oct 10 18:44:04 2016
@@ -46,7 +46,7 @@ void DbiStreamBuilder::setMachineType(PD
Error DbiStreamBuilder::addDbgStream(pdb::DbgHeaderType Type,
ArrayRef<uint8_t> Data) {
- if (DbgStreams[(int)Type].StreamNumber == kInvalidStreamIndex)
+ if (DbgStreams[(int)Type].StreamNumber != kInvalidStreamIndex)
return make_error<RawError>(raw_error_code::duplicate_entry,
"The specified stream type already exists");
auto ExpectedIndex = Msf.addStream(Data.size());
More information about the llvm-commits
mailing list