Do not use assert to report broken input files.

llvm-svn: 298815
This commit is contained in:
Rui Ueyama 2017-03-26 18:23:22 +00:00
parent 8d462b2b5f
commit 09fd21f45c
1 changed files with 5 additions and 1 deletions

View File

@ -683,7 +683,11 @@ public:
++I;
if (I == Size)
return Off;
assert(P[I].InputOff <= Off && "Relocation not in any piece");
if (Off < P[I].InputOff) {
error("relocation not in any piece");
return -1;
}
// Offset -1 means that the piece is dead (i.e. garbage collected).
if (P[I].OutputOff == -1)