summaryrefslogtreecommitdiff
path: root/lib/Archive/Archive.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-15 19:44:51 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-15 19:44:51 +0000
commitcd5561a56e1521c7dc18744dcd371d255b580fdf (patch)
tree117b16301be70b3aff3ce54cf352c3028d48cf87 /lib/Archive/Archive.cpp
parentc2ff962bf97761a54c94d2dadb555060403d49c6 (diff)
downloadllvm-cd5561a56e1521c7dc18744dcd371d255b580fdf.tar.gz
llvm-cd5561a56e1521c7dc18744dcd371d255b580fdf.tar.bz2
llvm-cd5561a56e1521c7dc18744dcd371d255b580fdf.tar.xz
For PR1050:
Convert asserts into error messages. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive/Archive.cpp')
-rw-r--r--lib/Archive/Archive.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index a661a4e992..3bbc49dbe2 100644
--- a/lib/Archive/Archive.cpp
+++ b/lib/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;