Cherry-pick upstream patch for internal_mmap() in GCC sanitizers

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.

http://llvm.org/viewvc/llvm-project?view=revision&revision=333075

PR kern/53261 by Martin Husemann
This commit is contained in:
kamil 2018-05-23 11:14:49 +00:00
parent 69b7af1811
commit 245d8e2368

View File

@ -113,7 +113,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,