aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon/vm_x86_64.c
diff options
context:
space:
mode:
authorludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-01-06 19:11:05 +0000
committerludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-01-06 19:11:05 +0000
commitf9b41461c03b30c9e4fe8d20606a7c22bfed0ec1 (patch)
tree2681e7825421db8b0dc242d983ca7f5aadad692b /code/qcommon/vm_x86_64.c
parenta70247b144224d6b9e0a8c8e2cda15dd628c3ef7 (diff)
downloadioquake3-aero-f9b41461c03b30c9e4fe8d20606a7c22bfed0ec1.tar.gz
ioquake3-aero-f9b41461c03b30c9e4fe8d20606a7c22bfed0ec1.zip
make memory for generated opcodes executable so the program works with
enabled NX feature. git-svn-id: svn://svn.icculus.org/quake3/trunk@466 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon/vm_x86_64.c')
-rw-r--r--code/qcommon/vm_x86_64.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/code/qcommon/vm_x86_64.c b/code/qcommon/vm_x86_64.c
index f90b7ff..2111f4e 100644
--- a/code/qcommon/vm_x86_64.c
+++ b/code/qcommon/vm_x86_64.c
@@ -385,12 +385,11 @@ static int doas(char* in, char* out, unsigned char** compiledcode)
if((*compiledcode = (unsigned char*)buf))
{
-#ifdef VM_X86_64_STANDALONE // no idea why
- if(mprotect(buf, allocsize, PROT_READ|PROT_EXEC) == -1)
+ // need to be able to exec code
+ if(mprotect(buf, allocsize, PROT_READ|PROT_WRITE|PROT_EXEC) == -1)
{
Com_Error(ERR_FATAL, "mprotect failed on %p+%x: %s\n", buf, allocsize, strerror(errno));
}
-#endif
return size;
}