diff options
author | Zachary Turner <zturner@google.com> | 2017-08-07 20:24:01 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-08-07 20:24:01 +0000 |
commit | 489a7a09ad0c1d762e117f82253f48f2a9010932 (patch) | |
tree | 3865d6595a016fb04887c5dc633675e0539cf18b | |
parent | 676386ff30e47de49df984cef30c3a932ca9e16e (diff) | |
download | bcm5719-llvm-489a7a09ad0c1d762e117f82253f48f2a9010932.tar.gz bcm5719-llvm-489a7a09ad0c1d762e117f82253f48f2a9010932.zip |
[llvm-pdbutil] Don't crash when a section contrib's isect is invalid.
llvm-svn: 310298
-rw-r--r-- | llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp index 60e0b75172e..99dd358fbf9 100644 --- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp +++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp @@ -1180,8 +1180,12 @@ Error DumpOutputStyle::dumpSectionContribs() { } 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), |