diff options
author | Chris Lattner <sabre@nondot.org> | 2004-12-15 07:44:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-12-15 07:44:15 +0000 |
commit | 67c3821ea002aea0c3be9286d1779cf67fc03451 (patch) | |
tree | daeb2f1517a3863e3e244893dc75348d4fdbcbf6 /tools/llvm-ar | |
parent | 68a9d3eb38d78e851cce532ffa307a89373036c6 (diff) | |
download | external_llvm-67c3821ea002aea0c3be9286d1779cf67fc03451.zip external_llvm-67c3821ea002aea0c3be9286d1779cf67fc03451.tar.gz external_llvm-67c3821ea002aea0c3be9286d1779cf67fc03451.tar.bz2 |
Do not fail an assertion on a broken archive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18959 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar')
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index 8f90de7..586639b 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -677,7 +677,12 @@ int main(int argc, char **argv) { std::cerr << argv[0] << ": creating " << ArchivePath.toString() << "\n"; TheArchive = Archive::CreateEmpty(ArchivePath); } else { - TheArchive = Archive::OpenAndLoad(ArchivePath); + std::string Error; + TheArchive = Archive::OpenAndLoad(ArchivePath, &Error); + if (TheArchive == 0) + std::cerr << argv[0] << ": error loading '" << ArchivePath << "': " + << Error << "!\n"; + return 1; } // Make sure we're not fooling ourselves. |