diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-15 19:44:51 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-15 19:44:51 +0000 |
commit | 1c6cb06ff573a410dfe0c256868b23ba502efbab (patch) | |
tree | 765021524051b1348b153abf3c2ae684ec6cf6c7 /llvm/lib/Bytecode/Archive/Archive.cpp | |
parent | ffca910d4509f00b7d9eced6404f8c888306b4ec (diff) | |
download | bcm5719-llvm-1c6cb06ff573a410dfe0c256868b23ba502efbab.tar.gz bcm5719-llvm-1c6cb06ff573a410dfe0c256868b23ba502efbab.zip |
For PR1050:
Convert asserts into error messages.
llvm-svn: 32607
Diffstat (limited to 'llvm/lib/Bytecode/Archive/Archive.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Archive/Archive.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Archive/Archive.cpp b/llvm/lib/Bytecode/Archive/Archive.cpp index a661a4e992a..3bbc49dbe2a 100644 --- a/llvm/lib/Bytecode/Archive/Archive.cpp +++ b/llvm/lib/Bytecode/Archive/Archive.cpp @@ -62,7 +62,12 @@ ArchiveMember::ArchiveMember(Archive* PAR) // different file, presumably as an update to the member. It also makes sure // the flags are reset correctly. bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) { - assert(newFile.exists() && "Can't replace with a non-existent file"); + if (!newFile.exists()) { + if (ErrMsg) + *ErrMsg = "Can not replace an archive member with a non-existent file"; + return true; + } + data = 0; path = newFile; |