aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/Archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r--llvm/lib/Object/Archive.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp
index 15db951..3267d24 100644
--- a/llvm/lib/Object/Archive.cpp
+++ b/llvm/lib/Object/Archive.cpp
@@ -295,6 +295,11 @@ Archive::Archive(MemoryBufferRef Source, std::error_code &ec)
return;
child_iterator E = child_end();
+ // This is at least a valid empty archive. Since an empty archive is the
+ // same in all formats, just claim it to be gnu to make sure Format is
+ // initialized.
+ Format = K_GNU;
+
if (I == E) {
ec = std::error_code();
return;