From cc371201c3e1d1d76093b5894de202ec6fa1880f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 24 Jun 2016 13:47:29 +0000 Subject: Make sure Format is always initialized. Should fix the msan bots. llvm-svn: 273679 --- llvm/lib/Object/Archive.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Object/Archive.cpp') 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; -- cgit v1.2.3