[llvm-commits] [llvm] r167894 - /llvm/trunk/lib/Object/Archive.cpp
Matt Beaumont-Gay
matthewbg at google.com
Tue Nov 13 16:21:27 PST 2012
Author: matthewbg
Date: Tue Nov 13 18:21:27 2012
New Revision: 167894
URL: http://llvm.org/viewvc/llvm-project?rev=167894&view=rev
Log:
Fix broken asserts. Also, spell 'indices' correctly.
Modified:
llvm/trunk/lib/Object/Archive.cpp
Modified: llvm/trunk/lib/Object/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=167894&r1=167893&r2=167894&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Archive.cpp (original)
+++ llvm/trunk/lib/Object/Archive.cpp Tue Nov 13 18:21:27 2012
@@ -272,7 +272,7 @@
Offset = *(reinterpret_cast<const support::ubig32_t*>(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<const support::ulittle32_t*>(Buf);
@@ -285,13 +285,13 @@
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<const support::ulittle16_t*>(Indicies)
+ *(reinterpret_cast<const support::ulittle16_t*>(Indices)
+ SymbolIndex);
// Subtract 1 since OffsetIndex is 1 based.
--OffsetIndex;
@@ -327,7 +327,7 @@
symbol_count = *reinterpret_cast<const support::ubig32_t*>(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 @@
symbol_count = *reinterpret_cast<const support::ubig32_t*>(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<const support::ulittle32_t*>(buf);
More information about the llvm-commits
mailing list