[llvm] r358809 - [llvm-objdump] Fix End in disassemblyObject after rL358806
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 20 00:48:42 PDT 2019
Author: maskray
Date: Sat Apr 20 00:48:41 2019
New Revision: 358809
URL: http://llvm.org/viewvc/llvm-project?rev=358809&view=rev
Log:
[llvm-objdump] Fix End in disassemblyObject after rL358806
Modified:
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=358809&r1=358808&r2=358809&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Sat Apr 20 00:48:41 2019
@@ -1153,9 +1153,9 @@ static void disassembleObject(const Targ
// The end is the section end, the beginning of the next symbol, or
// --stop-address.
- uint64_t End = std::min<uint64_t>(
- SI + 1 < SE ? std::get<0>(Symbols[SI + 1]) : SectionAddr + SectSize,
- StopAddress);
+ uint64_t End = std::min<uint64_t>(SectionAddr + SectSize, StopAddress);
+ if (SI + 1 < SE)
+ End = std::min(End, std::get<0>(Symbols[SI + 1]));
if (Start >= End || End <= StartAddress)
continue;
Start -= SectionAddr;
More information about the llvm-commits
mailing list