COFF: Add back an assertion that is superseded by r222124
[oota-llvm.git] / lib / Object / COFFObjectFile.cpp
index c5d7c4095196c93161bfdff63fb66f30789fd9ae..04cd61698c600ce500d7e08488cfad5bac31c305 100644 (file)
@@ -1060,7 +1060,7 @@ symbol_iterator COFFObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
   else if (SymbolTable32)
     Ref.p = reinterpret_cast<uintptr_t>(SymbolTable32 + R->SymbolTableIndex);
   else
-    return symbol_end();
+    llvm_unreachable("no symbol table pointer!");
   return symbol_iterator(SymbolRef(Ref, this));
 }
 
@@ -1491,7 +1491,7 @@ void BaseRelocRef::moveNext() {
   // Header->BlockSize is the size of the current block, including the
   // size of the header itself.
   uint32_t Size = sizeof(*Header) +
-      sizeof(coff_base_reloc_block_entry) * Index;
+      sizeof(coff_base_reloc_block_entry) * (Index + 1);
   if (Size == Header->BlockSize) {
     // .reloc contains a list of base relocation blocks. Each block
     // consists of the header followed by entries. The header contains