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 | 160a8a9725bb49d273bc821bf15bb1d70e37ffb6 (patch) | |
tree | 7f2ddeb746ad8ea7e25d626d30cad7c01e6ca56a /llvm/tools/llvm-ar | |
parent | b17f3e13ec7add443fe637711e67d77bd910d190 (diff) | |
download | bcm5719-llvm-160a8a9725bb49d273bc821bf15bb1d70e37ffb6.tar.gz bcm5719-llvm-160a8a9725bb49d273bc821bf15bb1d70e37ffb6.zip |
Do not fail an assertion on a broken archive
llvm-svn: 18959
Diffstat (limited to 'llvm/tools/llvm-ar')
-rw-r--r-- | llvm/tools/llvm-ar/llvm-ar.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp index 8f90de7bdea..586639bd631 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/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. |