diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp index 1d31feb714e..49e66f46ab3 100644 --- a/lib/Object/Archive.cpp +++ b/lib/Object/Archive.cpp @@ -511,7 +511,7 @@ Expected Archive::Child::getMemoryBufferRef() const { StringRef Name = NameOrErr.get(); Expected Buf = getBuffer(); if (!Buf) - return Buf.takeError(); + return createFileError(Name, Buf.takeError()); return MemoryBufferRef(*Buf, Name); }