diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-24 13:47:29 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-24 13:47:29 +0000 |
commit | cc371201c3e1d1d76093b5894de202ec6fa1880f (patch) | |
tree | f19081efad68f9f9743744db8d5551df48accb24 /llvm/lib/Object/Archive.cpp | |
parent | fd342808e0b57e632c7a85c6bbd8bae06a4a2be9 (diff) | |
download | bcm5719-llvm-cc371201c3e1d1d76093b5894de202ec6fa1880f.tar.gz bcm5719-llvm-cc371201c3e1d1d76093b5894de202ec6fa1880f.zip |
Make sure Format is always initialized.
Should fix the msan bots.
llvm-svn: 273679
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index 15db95123ac..3267d24a61e 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; |