[compiler-rt] r333075 - Fix internal_mmap() on 32-bit NetBSD platforms

Kamil Rytarowski via llvm-commits llvm-commits at lists.llvm.org
Wed May 23 03:37:00 PDT 2018


Author: kamil
Date: Wed May 23 03:37:00 2018
New Revision: 333075

URL: http://llvm.org/viewvc/llvm-project?rev=333075&view=rev
Log:
Fix internal_mmap() on 32-bit NetBSD platforms

There is need to use internal_syscall64() instead of internal_syscall_ptr().
The offset argument of type off_t is always 64-bit.

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

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=333075&r1=333074&r2=333075&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Wed May 23 03:37:00 2018
@@ -174,7 +174,7 @@ namespace __sanitizer {
 uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
                    OFF_T offset) {
 #if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(mmap), addr, length, prot, flags, fd,
+  return internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd,
                               (long)0, offset);
 #elif SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
   return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd,




More information about the llvm-commits mailing list