aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Windows/Path.inc
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-08-22 15:14:53 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-08-22 15:14:53 +0000
commit3f256c2e0b4417288e3191e67cb16177c8d8b2a7 (patch)
tree1953f3229b7eeab3891dea006a24fbda8e0684ea /lib/Support/Windows/Path.inc
parent37693da119853a4b2a31df4a6b7213043fe97e1a (diff)
downloadexternal_llvm-3f256c2e0b4417288e3191e67cb16177c8d8b2a7.zip
external_llvm-3f256c2e0b4417288e3191e67cb16177c8d8b2a7.tar.gz
external_llvm-3f256c2e0b4417288e3191e67cb16177c8d8b2a7.tar.bz2
[Win32] mapped_file_region: Fix a bug in CreateFileMapping() that Size must contain Offset when Offset >= 65536.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/Path.inc')
-rw-r--r--lib/Support/Windows/Path.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc
index 95caaa5..645d523 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());