aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/Archive.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-07-08 22:15:07 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-07-08 22:15:07 +0000
commitc91177e41065013dd08316606a687aeceef22cc9 (patch)
tree61dcb9eaa4d08e3b43b7363c2379809e9efa48d3 /llvm/lib/Object/Archive.cpp
parentdbb40ab8b70065d9d6179d25c06869898b3a9b17 (diff)
downloadllvm-c91177e41065013dd08316606a687aeceef22cc9.zip
llvm-c91177e41065013dd08316606a687aeceef22cc9.tar.gz
llvm-c91177e41065013dd08316606a687aeceef22cc9.tar.bz2
Disallow Archive::child_iterator that don't point to an archive.
NFC, just less error prone. llvm-svn: 241747
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r--llvm/lib/Object/Archive.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp
index 54ed954..d03c328 100644
--- a/llvm/lib/Object/Archive.cpp
+++ b/llvm/lib/Object/Archive.cpp
@@ -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)) {