From 99868904feeac944a0d482a2994f9d7b6828bff2 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 20 Dec 2013 18:17:34 -0800 Subject: [PATCH] Avoid sign extension in 32-bit mmap. Change-Id: I2a77925f62f381a0b34648c3db8154a55dd80c46 --- libc/bionic/mmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/bionic/mmap.cpp b/libc/bionic/mmap.cpp index 75bea588f..84a0f76e8 100644 --- a/libc/bionic/mmap.cpp +++ b/libc/bionic/mmap.cpp @@ -55,5 +55,5 @@ void* mmap64(void* addr, size_t size, int prot, int flags, int fd, off64_t offse } void* mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset) { - return mmap64(addr, size, prot, flags, fd, static_cast(offset)); + return mmap64(addr, size, prot, flags, fd, static_cast(offset) & 0xffffffff); }