summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Support/Windows/Path.inc4
-rw-r--r--unittests/Support/MemoryBufferTest.cpp5
2 files changed, 2 insertions, 7 deletions
diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc
index 95caaa58d7..645d5238db 100644
--- a/lib/Support/Windows/Path.inc
+++ b/lib/Support/Windows/Path.inc
@@ -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());
diff --git a/unittests/Support/MemoryBufferTest.cpp b/unittests/Support/MemoryBufferTest.cpp
index 252d2b555f..d9102e07e8 100644
--- a/unittests/Support/MemoryBufferTest.cpp
+++ b/unittests/Support/MemoryBufferTest.cpp
@@ -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
-
}