mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Define the instance variable Buffer, not the automatic variable Buffer.
This was causing us to munmap random stuff, which is obviously bad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8709 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -38,7 +38,6 @@ namespace {
|
|||||||
public:
|
public:
|
||||||
BytecodeFileReader(const std::string &Filename);
|
BytecodeFileReader(const std::string &Filename);
|
||||||
~BytecodeFileReader();
|
~BytecodeFileReader();
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,8 +53,8 @@ BytecodeFileReader::BytecodeFileReader(const std::string &Filename) {
|
|||||||
|
|
||||||
// mmap in the file all at once...
|
// mmap in the file all at once...
|
||||||
Length = StatBuf.st_size;
|
Length = StatBuf.st_size;
|
||||||
unsigned char *Buffer = (unsigned char*)mmap(0, Length, PROT_READ,
|
Buffer = (unsigned char*)mmap(0, Length, PROT_READ, MAP_PRIVATE, FD, 0);
|
||||||
MAP_PRIVATE, FD, 0);
|
|
||||||
if (Buffer == (unsigned char*)MAP_FAILED)
|
if (Buffer == (unsigned char*)MAP_FAILED)
|
||||||
throw std::string("Error mmapping file!");
|
throw std::string("Error mmapping file!");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user