diff options
Diffstat (limited to 'lib/Object/Archive.cpp')
-rw-r--r-- | lib/Object/Archive.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp index c6cf219..71efca2 100644 --- a/lib/Object/Archive.cpp +++ b/lib/Object/Archive.cpp @@ -385,7 +385,7 @@ Archive::Symbol Archive::Symbol::getNext() const { } Archive::symbol_iterator Archive::begin_symbols() const { - if (SymbolTable == end_children()) + if (!hasSymbolTable()) return symbol_iterator(Symbol(this, 0, 0)); const char *buf = SymbolTable->getBuffer().begin(); @@ -408,7 +408,7 @@ Archive::symbol_iterator Archive::begin_symbols() const { } Archive::symbol_iterator Archive::end_symbols() const { - if (SymbolTable == end_children()) + if (!hasSymbolTable()) return symbol_iterator(Symbol(this, 0, 0)); const char *buf = SymbolTable->getBuffer().begin(); @@ -444,3 +444,7 @@ Archive::child_iterator Archive::findSym(StringRef name) const { } return end_children(); } + +bool Archive::hasSymbolTable() const { + return SymbolTable != end_children(); +} |