Disallow Archive::child_iterator that don't point to an archive.

NFC, just less error prone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-07-08 22:15:07 +00:00
parent 5ebb47fa90
commit bf4296f2c0
5 changed files with 6 additions and 7 deletions
+2 -1
View File
@@ -207,7 +207,8 @@ ErrorOr<std::unique_ptr<Archive>> Archive::create(MemoryBufferRef Source) {
}
Archive::Archive(MemoryBufferRef Source, std::error_code &ec)
: Binary(Binary::ID_Archive, Source), SymbolTable(child_end()) {
: Binary(Binary::ID_Archive, Source), SymbolTable(child_end()),
StringTable(child_end()), FirstRegular(child_end()) {
StringRef Buffer = Data.getBuffer();
// Check for sufficient magic.
if (Buffer.startswith(ThinMagic)) {
-2
View File
@@ -34,8 +34,6 @@
using namespace llvm;
NewArchiveIterator::NewArchiveIterator() {}
NewArchiveIterator::NewArchiveIterator(object::Archive::child_iterator I,
StringRef Name)
: IsNewMember(false), Name(Name), OldI(I) {}