about summary refs log tree commit diff stats
path: root/src/wrapped
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-02-25 15:20:12 +0100
committerptitSeb <sebastien.chev@gmail.com>2023-02-25 15:20:12 +0100
commiteb212cd27e104ce989e483536e8be6123c594255 (patch)
tree3bba4e09eb731719cea36cbfdd75669c7d5788be /src/wrapped
parentb604dd0bccce7cd56e3532bd083e33568f3ecf46 (diff)
downloadbox64-eb212cd27e104ce989e483536e8be6123c594255.tar.gz
box64-eb212cd27e104ce989e483536e8be6123c594255.zip
[DYNAREC] Small imrvment in managing memory protection
Diffstat (limited to 'src/wrapped')
-rwxr-xr-xsrc/wrapped/wrappedlibc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 1b84ab7b..7d24f736 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -2558,7 +2558,7 @@ EXPORT int my_mprotect(x64emu_t* emu, void *addr, unsigned long len, int prot)
         prot|=PROT_READ;    // PROT_READ is implicit with PROT_WRITE on x86_64
     int ret = mprotect(addr, len, prot);
     #ifdef DYNAREC
-    if(box64_dynarec) {
+    if(box64_dynarec && !ret) {
         if(prot& PROT_EXEC)
             addDBFromAddressRange((uintptr_t)addr, len);
         else