]> granicus.if.org Git - llvm/commitdiff
[llvm-symbolizer] Fix section index at the end of a section
authorFangrui Song <maskray@google.com>
Sat, 20 Apr 2019 13:00:09 +0000 (13:00 +0000)
committerFangrui Song <maskray@google.com>
Sat, 20 Apr 2019 13:00:09 +0000 (13:00 +0000)
This is very minor issue. The returned section index is only used by
DWARFDebugLine as an llvm::upper_bound input and the use case shouldn't
cause any behavioral change.

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

lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp

index e6e0de05f5de719acf1871ba545ebbde060fc282..5d453def7b43090d79646d047b8ac9fc8070d71b 100644 (file)
@@ -313,9 +313,8 @@ uint64_t SymbolizableObjectFile::getModuleSectionIndexForAddress(
       continue;
 
     if (Address >= Sec.getAddress() &&
-        Address <= Sec.getAddress() + Sec.getSize()) {
+        Address < Sec.getAddress() + Sec.getSize())
       return Sec.getIndex();
-    }
   }
 
   return object::SectionedAddress::UndefSection;