[PATCH] D11588: [Sanitizers] [Bug 24151] Generalize type of offset in internal_mmap
Daniel Sanders
daniel.sanders at imgtec.com
Thu Jul 30 14:01:15 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL243686: [Sanitizers] [Bug 24151] Generalize type of offset in internal_mmap (authored by dsanders).
Changed prior to commit:
http://reviews.llvm.org/D11588?vs=30892&id=31074#toc
Repository:
rL LLVM
http://reviews.llvm.org/D11588
Files:
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
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
@@ -104,7 +104,7 @@
// --------------- 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);
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
@@ -170,7 +170,7 @@
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();
}
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
@@ -238,7 +238,7 @@
// (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);
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h
@@ -35,7 +35,7 @@
// 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);
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
@@ -240,14 +240,14 @@
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11588.31074.patch
Type: text/x-patch
Size: 3295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150730/d1d6687f/attachment.bin>
More information about the llvm-commits
mailing list