about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-12-18 14:15:10 +0100
committerptitSeb <sebastien.chev@gmail.com>2023-12-18 14:15:10 +0100
commit837cc9dd93cd4be838f35645717124ace7361631 (patch)
treece6eaf4a7432775b65da1f11c6ed6146d01fa5ed /src
parent88a8d1c209ad9e5ef79311d1d5fa79fc6e59680e (diff)
downloadbox64-837cc9dd93cd4be838f35645717124ace7361631.tar.gz
box64-837cc9dd93cd4be838f35645717124ace7361631.zip
[DYNAREC] This should avoid useless segfault on bridge creation
Diffstat (limited to 'src')
-rw-r--r--src/custommem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/custommem.c b/src/custommem.c
index 7e73a23d..6facc46d 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -1072,8 +1072,8 @@ void protectDB(uintptr_t addr, uintptr_t size)
         uint32_t dyn = prot&PROT_DYN;
         if(!prot)
             prot = PROT_READ | PROT_WRITE | PROT_EXEC;      // comes from malloc & co, so should not be able to execute
-        prot&=~PROT_CUSTOM;
         if(!(dyn&PROT_NOPROT)) {
+            prot&=~PROT_CUSTOM;
             if(prot&PROT_WRITE) {
                 if(!dyn) 
                     mprotect((void*)(i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, prot&~PROT_WRITE);