llvm-readobj: relocAddressLess could potentially lie

On error conditions, relocAddressLess might claim that a value is less
than itself.  Instead, abort llvm-readobj.  No functionality change
intended.

llvm-svn: 221872
This commit is contained in:
David Majnemer
2014-11-13 07:54:05 +00:00
parent 1e783024d3
commit e0eb086dd4

View File

@@ -168,8 +168,8 @@ bool error(std::error_code EC) {
bool relocAddressLess(RelocationRef a, RelocationRef b) {
uint64_t a_addr, b_addr;
if (error(a.getOffset(a_addr))) return false;
if (error(b.getOffset(b_addr))) return false;
if (error(a.getOffset(a_addr))) exit(ReturnValue);
if (error(b.getOffset(b_addr))) exit(ReturnValue);
return a_addr < b_addr;
}