[compiler-rt] r244077 - Try to fix sanitizer_win.cc compile error on 64-bit after r243895

Hans Wennborg hans at hanshq.net
Wed Aug 5 10:55:26 PDT 2015


Author: hans
Date: Wed Aug  5 12:55:26 2015
New Revision: 244077

URL: http://llvm.org/viewvc/llvm-project?rev=244077&view=rev
Log:
Try to fix sanitizer_win.cc compile error on 64-bit after r243895

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc?rev=244077&r1=244076&r2=244077&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc Wed Aug  5 12:55:26 2015
@@ -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;
 }
 




More information about the llvm-commits mailing list