[llvm] r310298 - [llvm-pdbutil] Don't crash when a section contrib's isect is invalid.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 7 13:24:01 PDT 2017
Author: zturner
Date: Mon Aug 7 13:24:01 2017
New Revision: 310298
URL: http://llvm.org/viewvc/llvm-project?rev=310298&view=rev
Log:
[llvm-pdbutil] Don't crash when a section contrib's isect is invalid.
Modified:
llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp
Modified: llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp?rev=310298&r1=310297&r2=310298&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp (original)
+++ llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp Mon Aug 7 13:24:01 2017
@@ -1180,8 +1180,12 @@ Error DumpOutputStyle::dumpSectionContri
}
void visit(const SectionContrib &SC) override {
assert(SC.ISect > 0);
- StringRef SectionName = Names[SC.ISect - 1];
- std::string NameInsert = formatv("[{0}]", SectionName).str();
+ std::string NameInsert;
+ if (SC.ISect < Names.size()) {
+ StringRef SectionName = Names[SC.ISect - 1];
+ NameInsert = formatv("[{0}]", SectionName).str();
+ } else
+ NameInsert = "[???]";
P.formatLine("SC{5} | mod = {2}, {0}, size = {1}, data crc = {3}, reloc "
"crc = {4}",
formatSegmentOffset(SC.ISect, SC.Off), fmtle(SC.Size),
More information about the llvm-commits
mailing list