Define the instance variable Buffer, not the automatic variable Buffer.

This was causing us to munmap random stuff, which is obviously bad.

llvm-svn: 8709
This commit is contained in:
Chris Lattner 2003-09-25 04:13:53 +00:00
parent 66a473371f
commit 1e9402d93d
1 changed files with 2 additions and 3 deletions

View File

@ -38,7 +38,6 @@ namespace {
public:
BytecodeFileReader(const std::string &Filename);
~BytecodeFileReader();
};
}
@ -54,8 +53,8 @@ BytecodeFileReader::BytecodeFileReader(const std::string &Filename) {
// 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!");