Fix a bug where the bcreader could crash on .bc files that were an exact
authorChris Lattner <sabre@nondot.org>
Fri, 11 May 2007 00:00:27 +0000 (00:00 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 11 May 2007 00:00:27 +0000 (00:00 +0000)
multiple of the page size, due to a bug in MappedFile

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36980 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Unix/MappedFile.inc

index 5e76e2bc26aa24485f5bc03f4e09e1b4e83dd3b6..91b92ece5a5a227e96b69a06f3f79a5091d63762 100644 (file)
@@ -78,6 +78,7 @@ void MappedFile::unmap() {
     if (options_ & WRITE_ACCESS)
       ::msync(base_, info_->Size, MS_SYNC);
     ::munmap(base_, info_->Size);
+    base_ = 0;  // Mark this as non-mapped.
   }
 }