forked from OSchip/llvm-project
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:
parent
66a473371f
commit
1e9402d93d
|
@ -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!");
|
||||
|
||||
|
|
Loading…
Reference in New Issue