[llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveReader.cpp
Reid Spencer
reid at x10sys.com
Sun Nov 14 17:40:58 PST 2004
Changes in directory llvm/lib/Bytecode/Archive:
ArchiveReader.cpp updated: 1.23 -> 1.24
---
Log message:
* Make sure the string table gets read even if there isn't a foreign
symbol table.
* Make sure we update the file pointer for each member when rebuilding the
symbol table.
---
Diffs of the changes: (+20 -8)
Index: llvm/lib/Bytecode/Archive/ArchiveReader.cpp
diff -u llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.23 llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.24
--- llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.23 Sun Nov 14 19:20:11 2004
+++ llvm/lib/Bytecode/Archive/ArchiveReader.cpp Sun Nov 14 19:40:20 2004
@@ -309,18 +309,25 @@
if (mbr->isForeignSymbolTable()) {
// Skip the foreign symbol table, we don't do anything with it
At += mbr->getSize();
+ if (mbr->getSize() % 2 != 0)
+ At++;
delete mbr;
- // See if there's a string table too
+ // Read the next one
+ FirstFile = At;
+ mbr = parseMemberHeader(At,End);
+ }
+
+ if (mbr->isStringTable()) {
+ // Process the string table entry
+ strtab.assign((const char*)mbr->getData(),mbr->getSize());
+ At += mbr->getSize();
+ if (mbr->getSize() % 2 != 0)
+ At++;
+ delete mbr;
+ // Get the next one
FirstFile = At;
mbr = parseMemberHeader(At,End);
- if (mbr->isStringTable()) {
- strtab.assign((const char*)mbr->getData(),mbr->getSize());
- At += mbr->getSize();
- delete mbr;
- FirstFile = At;
- mbr = parseMemberHeader(At,End);
- }
}
// See if its the symbol table
@@ -432,6 +439,11 @@
mbr->getPath().get();
}
}
+
+ // Go to the next file location
+ At += mbr->getSize();
+ if (mbr->getSize() % 2 != 0)
+ At++;
}
}
More information about the llvm-commits
mailing list