Inverse the error check logic for the MappedFile::map() call. It returns

a null pointer when there is an error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29827 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2006-08-22 17:58:50 +00:00
parent d8509c95b8
commit a5ec45d3c1
2 changed files with 2 additions and 2 deletions

View File

@ -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();
}

View File

@ -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();
}