aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Archive
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2008-02-28 22:24:48 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2008-02-28 22:24:48 +0000
commit63b8c1f6f118dfef44422283947bdc3388c0fcb4 (patch)
tree4bd44e33d6c8f9b572ffcc13ea78758c9caf82a4 /lib/Archive
parentf3c630e3fc2cec564325ae43c90f94b0c4a1662d (diff)
downloadexternal_llvm-63b8c1f6f118dfef44422283947bdc3388c0fcb4.zip
external_llvm-63b8c1f6f118dfef44422283947bdc3388c0fcb4.tar.gz
external_llvm-63b8c1f6f118dfef44422283947bdc3388c0fcb4.tar.bz2
Make llvm-ar behave like ar, if you create an empty archive, ar creates an empty archive. llvm-ar would not generate an output file in this case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive')
-rw-r--r--lib/Archive/ArchiveWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp
index 07f7d88..04cc981 100644
--- a/lib/Archive/ArchiveWriter.cpp
+++ b/lib/Archive/ArchiveWriter.cpp
@@ -348,7 +348,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
{
// Make sure they haven't opened up the file, not loaded it,
// but are now trying to write it which would wipe out the file.
- if (members.empty() && mapfile->size() > 8) {
+ if (members.empty() && mapfile && mapfile->size() > 8) {
if (ErrMsg)
*ErrMsg = "Can't write an archive not opened for writing";
return true;