Fix some undefined beahvior in FileMapping.

This was broken when building a 32-bit native toolchain, as
shifting a size_t right by 32 is UB when sizeof(size_t) == 8.

llvm-svn: 318462
This commit is contained in:
Zachary Turner 2017-11-16 22:39:55 +00:00
parent 9d59418f6b
commit ab1ade496c
1 changed files with 2 additions and 2 deletions

View File

@ -734,8 +734,8 @@ std::error_code mapped_file_region::init(int FD, uint64_t Offset,
HANDLE FileMappingHandle =
::CreateFileMappingW(FileHandle, 0, flprotect,
Size >> 32,
Size & 0xffffffff,
Hi_32(Size),
Lo_32(Size),
0);
if (FileMappingHandle == NULL) {
std::error_code ec = mapWindowsError(GetLastError());