Fix off-by-one error when printing relocations inline with disassembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142952 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2011-10-25 20:15:39 +00:00
parent 9d9c4ad186
commit 34749ce4df

View File

@ -306,7 +306,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
SmallString<32> val;
if (error(rel_cur->getAddress(addr))) goto skip_print_rel;
// Stop when rel_cur's address is past the current instruction.
if (addr > Index + Size) break;
if (addr >= Index + Size) break;
if (error(rel_cur->getTypeName(name))) goto skip_print_rel;
if (error(rel_cur->getValueString(val))) goto skip_print_rel;