aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System/Unix/MappedFile.inc
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
commit083507cd3fceea8c65d28f03f26bfc8d26d6cc26 (patch)
treefdebd1fb6ed0fd04671caeab965814945a53c62b /lib/System/Unix/MappedFile.inc
parentfb9aac85cd42d893b79efe29fc3a01af7bad178a (diff)
downloadexternal_llvm-083507cd3fceea8c65d28f03f26bfc8d26d6cc26.zip
external_llvm-083507cd3fceea8c65d28f03f26bfc8d26d6cc26.tar.gz
external_llvm-083507cd3fceea8c65d28f03f26bfc8d26d6cc26.tar.bz2
Fix bugs in class invariant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix/MappedFile.inc')
-rw-r--r--lib/System/Unix/MappedFile.inc3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/System/Unix/MappedFile.inc b/lib/System/Unix/MappedFile.inc
index 7e03cd1..0e03a04 100644
--- a/lib/System/Unix/MappedFile.inc
+++ b/lib/System/Unix/MappedFile.inc
@@ -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;