From c5baec42a7c2137fe46101d4d550e0ffb929a01e Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 22 Aug 2006 17:58:50 +0000 Subject: Inverse the error check logic for the MappedFile::map() call. It returns a null pointer when there is an error. llvm-svn: 29827 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Bytecode/Archive/ArchiveWriter.cpp') diff --git a/llvm/lib/Bytecode/Archive/ArchiveWriter.cpp b/llvm/lib/Bytecode/Archive/ArchiveWriter.cpp index a5b52f465a9..c99d8510c51 100644 --- a/llvm/lib/Bytecode/Archive/ArchiveWriter.cpp +++ b/llvm/lib/Bytecode/Archive/ArchiveWriter.cpp @@ -209,7 +209,7 @@ Archive::writeMember( mFile = new sys::MappedFile(); if (mFile->open(member.getPath(), sys::MappedFile::READ_ACCESS, &ErrMsg)) throw ErrMsg; - if (data = (const char*) mFile->map(&ErrMsg)) + if (!(data = (const char*) mFile->map(&ErrMsg))) throw ErrMsg; fSize = mFile->size(); } -- cgit v1.2.3