From f1c2a6b512c5e210c8571923663fe19c713ea45d Mon Sep 17 00:00:00 2001 From: Matt Beaumont-Gay Date: Wed, 14 Nov 2012 00:21:27 +0000 Subject: [PATCH] Fix broken asserts. Also, spell 'indices' correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167894 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Object/Archive.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp index 28d052e12da..12ec3ce929a 100644 --- a/lib/Object/Archive.cpp +++ b/lib/Object/Archive.cpp @@ -272,7 +272,7 @@ error_code Archive::Symbol::getMember(child_iterator &Result) const { Offset = *(reinterpret_cast(Offsets) + SymbolIndex); } else if (Parent->kind() == K_BSD) { - assert("BSD format is not supported"); + assert(0 && "BSD format is not supported"); } else { uint32_t MemberCount = *reinterpret_cast(Buf); @@ -285,13 +285,13 @@ error_code Archive::Symbol::getMember(child_iterator &Result) const { if (SymbolIndex >= SymbolCount) return object_error::parse_failed; - // Skip SymbolCount to get to the indicies table. - const char *Indicies = Buf + sizeof(support::ulittle32_t); + // Skip SymbolCount to get to the indices table. + const char *Indices = Buf + sizeof(support::ulittle32_t); // Get the index of the offset in the file member offset table for this // symbol. uint16_t OffsetIndex = - *(reinterpret_cast(Indicies) + *(reinterpret_cast(Indices) + SymbolIndex); // Subtract 1 since OffsetIndex is 1 based. --OffsetIndex; @@ -327,7 +327,7 @@ Archive::symbol_iterator Archive::begin_symbols() const { symbol_count = *reinterpret_cast(buf); buf += sizeof(uint32_t) + (symbol_count * (sizeof(uint32_t))); } else if (kind() == K_BSD) { - assert("BSD archive format is not supported"); + assert(0 && "BSD archive format is not supported"); } else { uint32_t member_count = 0; uint32_t symbol_count = 0; @@ -348,7 +348,7 @@ Archive::symbol_iterator Archive::end_symbols() const { symbol_count = *reinterpret_cast(buf); buf += sizeof(uint32_t) + (symbol_count * (sizeof(uint32_t))); } else if (kind() == K_BSD) { - assert("BSD archive format is not supported"); + assert(0 && "BSD archive format is not supported"); } else { uint32_t member_count = 0; member_count = *reinterpret_cast(buf); -- 2.34.1