diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-08-05 17:55:26 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-08-05 17:55:26 +0000 |
commit | 92e6412f2901c42599af8f91702f78a1701d70fb (patch) | |
tree | ad455622d3c672b9637e7318b4e163d7463af5eb | |
parent | 09b9f0eb07118b34fbce9698abb376fd4a9d437e (diff) | |
download | bcm5719-llvm-92e6412f2901c42599af8f91702f78a1701d70fb.tar.gz bcm5719-llvm-92e6412f2901c42599af8f91702f78a1701d70fb.zip |
Try to fix sanitizer_win.cc compile error on 64-bit after r243895
llvm-svn: 244077
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_win.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc index 75c4c368edd..39a42598e60 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; } |