mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-16 08:08:01 +00:00
[Win32] mapped_file_region: Fix a bug in CreateFileMapping() that Size must contain Offset when Offset >= 65536.
llvm-svn: 189021
This commit is contained in:
parent
5915576b5b
commit
6c13dfe866
@ -726,8 +726,8 @@ error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) {
|
||||
FileMappingHandle = ::CreateFileMapping(FileHandle,
|
||||
0,
|
||||
flprotect,
|
||||
Size >> 32,
|
||||
Size & 0xffffffff,
|
||||
(Offset + Size) >> 32,
|
||||
(Offset + Size) & 0xffffffff,
|
||||
0);
|
||||
if (FileMappingHandle == NULL) {
|
||||
error_code ec = windows_error(GetLastError());
|
||||
|
@ -138,9 +138,6 @@ void MemoryBufferTest::testGetOpenFileSlice(bool Reopen) {
|
||||
EXPECT_EQ(BufData[9], '9');
|
||||
}
|
||||
|
||||
#if !defined(_WIN32)
|
||||
// FIXME: Investigating since r188998.
|
||||
|
||||
TEST_F(MemoryBufferTest, getOpenFileNoReopen) {
|
||||
testGetOpenFileSlice(false);
|
||||
}
|
||||
@ -149,6 +146,4 @@ TEST_F(MemoryBufferTest, getOpenFileReopened) {
|
||||
testGetOpenFileSlice(true);
|
||||
}
|
||||
|
||||
#endif // _WIN32
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user