From 92e6412f2901c42599af8f91702f78a1701d70fb Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 5 Aug 2015 17:55:26 +0000 Subject: [PATCH] Try to fix sanitizer_win.cc compile error on 64-bit after r243895 llvm-svn: 244077 --- compiler-rt/lib/sanitizer_common/sanitizer_win.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc index 75c4c36..39a4259 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc @@ -493,9 +493,16 @@ void CloseFile(fd_t fd) { bool ReadFromFile(fd_t fd, void *buff, uptr buff_size, uptr *bytes_read, error_t *error_p) { CHECK(fd != kInvalidFd); - bool success = ::ReadFile(fd, buff, buff_size, bytes_read, nullptr); + + // bytes_read can't be passed directly to ReadFile: + // uptr is unsigned long long on 64-bit Windows. + unsigned long num_read_long; + + bool success = ::ReadFile(fd, buff, buff_size, &num_read_long, nullptr); if (!success && error_p) *error_p = GetLastError(); + if (bytes_read) + *bytes_read = num_read_long; return success; } -- 2.7.4