Summary:
zturner suggested that mapped_file_region::init() on Windows seems to
create mappings that are larger than they need to be: Offset+Size
instead of Size. Indeed, that appears to be the case. I confirmed that
tests pass with mappings of just Size bytes, and fail with Size-1
bytes, suggesting that Size is indeed the correct value.
Reviewers: amccarth, zturner
Reviewed By: zturner
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D39876
llvm-svn: 317850
HANDLE FileMappingHandle =
::CreateFileMappingW(FileHandle, 0, flprotect,
- (Offset + Size) >> 32,
- (Offset + Size) & 0xffffffff,
+ Size >> 32,
+ Size & 0xffffffff,
0);
if (FileMappingHandle == NULL) {
std::error_code ec = mapWindowsError(GetLastError());