From: Peter Collingbourne Date: Tue, 17 Apr 2018 21:44:17 +0000 (+0000) Subject: llvm-pdbutil: Fix an off-by-one error. X-Git-Tag: android-x86-7.1-r4~2233 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d1f8152166b62eeb3ae521c4a9be539de25607a0;p=android-x86%2Fexternal-llvm.git llvm-pdbutil: Fix an off-by-one error. Differential Revision: https://reviews.llvm.org/D45740 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330222 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-pdbutil/DumpOutputStyle.cpp b/tools/llvm-pdbutil/DumpOutputStyle.cpp index eb171887817..5ecb9be62ff 100644 --- a/tools/llvm-pdbutil/DumpOutputStyle.cpp +++ b/tools/llvm-pdbutil/DumpOutputStyle.cpp @@ -491,7 +491,7 @@ static void dumpSectionContrib(LinePrinter &P, const SectionContrib &SC, ArrayRef 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