OSDN Git Service

llvm-pdbutil: Fix an off-by-one error.
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 17 Apr 2018 21:44:17 +0000 (21:44 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 17 Apr 2018 21:44:17 +0000 (21:44 +0000)
Differential Revision: https://reviews.llvm.org/D45740

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330222 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-pdbutil/DumpOutputStyle.cpp

index eb17188..5ecb9be 100644 (file)
@@ -491,7 +491,7 @@ static void dumpSectionContrib(LinePrinter &P, const SectionContrib &SC,
                                ArrayRef<std::string> SectionNames,
                                uint32_t FieldWidth) {
   std::string NameInsert;
-  if (SC.ISect > 0 && SC.ISect < SectionNames.size()) {
+  if (SC.ISect > 0 && SC.ISect <= SectionNames.size()) {
     StringRef SectionName = SectionNames[SC.ISect - 1];
     NameInsert = formatv("[{0}]", SectionName).str();
   } else