forked from OSchip/llvm-project
Handle offsets larger than 32 bits.
David Majnemer noticed that it was not obvious what the behavior would be if B.Offset - A.Offset could not fit in an int. llvm-svn: 257803
This commit is contained in:
parent
83aa97941f
commit
c897cdde70
|
@ -332,8 +332,10 @@ static void setMatch(MipsRelocationEntry &Hi, MipsRelocationEntry &Lo) {
|
|||
static int cmpRel(const ELFRelocationEntry *AP, const ELFRelocationEntry *BP) {
|
||||
const ELFRelocationEntry &A = *AP;
|
||||
const ELFRelocationEntry &B = *BP;
|
||||
if (A.Offset != B.Offset)
|
||||
return B.Offset - A.Offset;
|
||||
if (A.Offset < B.Offset)
|
||||
return 1;
|
||||
if (A.Offset > B.Offset)
|
||||
return -1;
|
||||
assert(B.Type != A.Type && "We don't have a total order");
|
||||
return A.Type - B.Type;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue