projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d59418
)
Fix some undefined beahvior in FileMapping.
author
Zachary Turner
<zturner@google.com>
Thu, 16 Nov 2017 22:39:55 +0000
(22:39 +0000)
committer
Zachary Turner
<zturner@google.com>
Thu, 16 Nov 2017 22:39:55 +0000
(22:39 +0000)
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
llvm/lib/Support/Windows/Path.inc
patch
|
blob
|
history
diff --git
a/llvm/lib/Support/Windows/Path.inc
b/llvm/lib/Support/Windows/Path.inc
index
f65ed5c
..
dd42055
100644
(file)
--- a/
llvm/lib/Support/Windows/Path.inc
+++ b/
llvm/lib/Support/Windows/Path.inc
@@
-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());