aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Archive/Archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bytecode/Archive/Archive.cpp')
-rw-r--r--lib/Bytecode/Archive/Archive.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Bytecode/Archive/Archive.cpp b/lib/Bytecode/Archive/Archive.cpp
index a661a4e992..3bbc49dbe2 100644
--- a/lib/Bytecode/Archive/Archive.cpp
+++ b/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;