summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-11-14 22:07:50 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-11-14 22:07:50 +0000
commit60c72a339beb7b6a31586afa7501257af98dd0fb (patch)
tree696c8052222d98cc7a3bfac57a86d9a15af3f869 /llvm/lib/System
parent8b89b8333e98930e6ed317f79ed3f06958d580cf (diff)
downloadbcm5719-llvm-60c72a339beb7b6a31586afa7501257af98dd0fb.tar.gz
bcm5719-llvm-60c72a339beb7b6a31586afa7501257af98dd0fb.zip
Fix bugs in class invariant
llvm-svn: 17779
Diffstat (limited to 'llvm/lib/System')
-rw-r--r--llvm/lib/System/Unix/MappedFile.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/MappedFile.cpp b/llvm/lib/System/Unix/MappedFile.cpp
index 7e03cd15a81..0e03a04c6fe 100644
--- a/llvm/lib/System/Unix/MappedFile.cpp
+++ b/llvm/lib/System/Unix/MappedFile.cpp
@@ -53,6 +53,8 @@ void MappedFile::initialize() {
info_ = 0;
ThrowErrno(std::string("Can't stat file: ") + path_.get());
}
+ } else {
+ throw std::string("Can't open file: ") + path_.get();
}
}
@@ -74,6 +76,7 @@ void MappedFile::unmap() {
}
void* MappedFile::map() {
+ assert(info_ && "MappedFile not initialized");
if (!isMapped()) {
int prot = PROT_NONE;
int flags = 0;
OpenPOWER on IntegriCloud