diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-04-10 18:50:33 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-04-10 18:51:16 +0200 |
| commit | 8c98c7b67580b2807d37fa03f59416f4526df770 (patch) | |
| tree | 2e727c95597a5cbcf959349393e6a248c9e7a370 | |
| parent | 5eb54321e8010cbb1991c9f583e63e0e8f4699cd (diff) | |
| download | box64-8c98c7b67580b2807d37fa03f59416f4526df770.tar.gz box64-8c98c7b67580b2807d37fa03f59416f4526df770.zip | |
[DYNAREC] Improved/Fixed PROT_NOPROT handling from bridge
| -rw-r--r-- | src/custommem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/custommem.c b/src/custommem.c index 2872aa7d..3ce943d8 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -798,7 +798,7 @@ void protectDB(uintptr_t addr, uintptr_t size) prot&=~PROT_CUSTOM; if(!prot) prot = PROT_READ | PROT_WRITE | PROT_EXEC; // comes from malloc & co, so should not be able to execute - if((prot&PROT_WRITE) && !(prot&PROT_NOPROT)) { + if((prot&PROT_WRITE) && !(dyn&PROT_NOPROT)) { if(!dyn) mprotect((void*)(i<<MEMPROT_SHIFT), 1<<MEMPROT_SHIFT, prot&~PROT_WRITE); memprot[i>>16].prot[i&0xffff] = prot|mapped|PROT_DYNAREC; // need to use atomic exchange? } else @@ -852,7 +852,7 @@ int isprotectedDB(uintptr_t addr, size_t size) } for (uintptr_t i=idx; i<=end; ++i) { uint32_t prot = memprot[i>>16].prot[i&0xffff]; - if(!(prot&PROT_DYN) && !(prot&PROT_NOPROT)) { + if(!(prot&PROT_DYN)) { dynarec_log(LOG_DEBUG, "0\n"); return 0; } |