[llvm-commits] CVS: llvm/lib/System/Unix/MappedFile.cpp

Reid Spencer reid at x10sys.com
Sun Nov 14 14:08:28 PST 2004



Changes in directory llvm/lib/System/Unix:

MappedFile.cpp updated: 1.5 -> 1.6
---
Log message:

Fix bugs in class invariant

---
Diffs of the changes:  (+3 -0)

Index: llvm/lib/System/Unix/MappedFile.cpp
diff -u llvm/lib/System/Unix/MappedFile.cpp:1.5 llvm/lib/System/Unix/MappedFile.cpp:1.6
--- llvm/lib/System/Unix/MappedFile.cpp:1.5	Wed Oct 27 18:18:44 2004
+++ llvm/lib/System/Unix/MappedFile.cpp	Sun Nov 14 16:07:50 2004
@@ -53,6 +53,8 @@
       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::map() {
+  assert(info_ && "MappedFile not initialized");
   if (!isMapped()) {
     int prot = PROT_NONE;
     int flags = 0;






More information about the llvm-commits mailing list