[llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Sep 24 23:15:01 PDT 2003
Changes in directory llvm/lib/Bytecode/Reader:
ReaderWrappers.cpp updated: 1.8 -> 1.9
---
Log message:
Define the instance variable Buffer, not the automatic variable Buffer.
This was causing us to munmap random stuff, which is obviously bad.
---
Diffs of the changes:
Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.8 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.9
--- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.8 Wed Sep 24 17:34:17 2003
+++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Wed Sep 24 23:13:53 2003
@@ -38,7 +38,6 @@
public:
BytecodeFileReader(const std::string &Filename);
~BytecodeFileReader();
-
};
}
@@ -54,8 +53,8 @@
// mmap in the file all at once...
Length = StatBuf.st_size;
- unsigned char *Buffer = (unsigned char*)mmap(0, Length, PROT_READ,
- MAP_PRIVATE, FD, 0);
+ Buffer = (unsigned char*)mmap(0, Length, PROT_READ, MAP_PRIVATE, FD, 0);
+
if (Buffer == (unsigned char*)MAP_FAILED)
throw std::string("Error mmapping file!");
More information about the llvm-commits
mailing list