From af6ba72b0ba1f2ac1316337a6c67f5f39996182a Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Sun, 24 Feb 2013 01:03:54 -0600 Subject: [PATCH] Align address of asm_runJIT down to nearest page boundary instead of up for mprotect on Linux and OS X (bug 5601, r=dvander). --- amxmodx/amx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amxmodx/amx.cpp b/amxmodx/amx.cpp index 91c1e59c..bebe8e6b 100755 --- a/amxmodx/amx.cpp +++ b/amxmodx/amx.cpp @@ -936,7 +936,7 @@ int AMXAPI amx_Init(AMX *amx, void *program) /* Linux already has mprotect() */ /* But wants the address aligned! */ - #define ALIGN(addr) (char *)(((long)addr + sysconf(_SC_PAGESIZE)-1) & ~(sysconf(_SC_PAGESIZE)-1)) + #define ALIGN(addr) ((void *)((intptr_t)addr & ~(sysconf(_SC_PAGESIZE)-1))) #else