Skip to content

Commit

Permalink
llvm-readobj: relocAddressLess could potentially lie
Browse files Browse the repository at this point in the history
On error conditions, relocAddressLess might claim that a value is less
than itself.  Instead, abort llvm-readobj.  No functionality change
intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221872 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
majnemer committed Nov 13, 2014
1 parent f6a1958 commit aff22c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/llvm-readobj/llvm-readobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit aff22c9

Please sign in to comment.