[compiler-rt] r243744 - Re-commit r243686 - [Sanitizers] [Bug 24151] Generalize type of offset in internal_mmap
Daniel Sanders
daniel.sanders at imgtec.com
Fri Jul 31 04:29:25 PDT 2015
Author: dsanders
Date: Fri Jul 31 06:29:25 2015
New Revision: 243744
URL: http://llvm.org/viewvc/llvm-project?rev=243744&view=rev
Log:
Re-commit r243686 - [Sanitizers] [Bug 24151] Generalize type of offset in internal_mmap
The builder remains broken in the same way without this patch so this patch is
innocent.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=243744&r1=243743&r2=243744&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Fri Jul 31 06:29:25 2015
@@ -238,7 +238,7 @@ bool ReadFileToBuffer(const char *file_n
// (or NULL if mapping fails). Stores the size of mmaped region
// in '*buff_size'.
void *MapFileToMemory(const char *file_name, uptr *buff_size);
-void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, uptr offset);
+void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, OFF_T offset);
bool IsAccessibleMemoryRange(uptr beg, uptr size);
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=243744&r1=243743&r2=243744&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Fri Jul 31 06:29:25 2015
@@ -104,7 +104,7 @@ namespace __sanitizer {
// --------------- sanitizer_libc.h
uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
- u64 offset) {
+ OFF_T offset) {
#if SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd,
offset);
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc?rev=243744&r1=243743&r2=243744&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc Fri Jul 31 06:29:25 2015
@@ -240,14 +240,14 @@ void *MapFileToMemory(const char *file_n
return internal_iserror(map) ? 0 : (void *)map;
}
-void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, uptr offset) {
+void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, OFF_T offset) {
uptr flags = MAP_SHARED;
if (addr) flags |= MAP_FIXED;
uptr p = internal_mmap(addr, size, PROT_READ | PROT_WRITE, flags, fd, offset);
int mmap_errno = 0;
if (internal_iserror(p, &mmap_errno)) {
- Printf("could not map writable file (%d, %zu, %zu): %zd, errno: %d\n",
- fd, offset, size, p, mmap_errno);
+ Printf("could not map writable file (%d, %lld, %zu): %zd, errno: %d\n",
+ fd, (long long)offset, size, p, mmap_errno);
return 0;
}
return (void *)p;
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h?rev=243744&r1=243743&r2=243744&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h Fri Jul 31 06:29:25 2015
@@ -35,7 +35,7 @@ uptr internal_write(fd_t fd, const void
// Memory
uptr internal_mmap(void *addr, uptr length, int prot, int flags,
- int fd, u64 offset);
+ int fd, OFF_T offset);
uptr internal_munmap(void *addr, uptr length);
int internal_mprotect(void *addr, uptr length, int prot);
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=243744&r1=243743&r2=243744&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc Fri Jul 31 06:29:25 2015
@@ -170,7 +170,7 @@ void *MapFileToMemory(const char *file_n
UNIMPLEMENTED();
}
-void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, uptr offset) {
+void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, OFF_T offset) {
UNIMPLEMENTED();
}
More information about the llvm-commits
mailing list