diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-02-11 22:58:39 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-02-11 22:58:39 +0100 |
| commit | 56701220e92b60bda8f920f2b9729a2e8ad41c65 (patch) | |
| tree | 69cb587f859db6b972f72721799b82ef5288ef39 /src | |
| parent | 6bf434a7abd75ad90d03a2fe070e0398f7421301 (diff) | |
| download | box64-56701220e92b60bda8f920f2b9729a2e8ad41c65.tar.gz box64-56701220e92b60bda8f920f2b9729a2e8ad41c65.zip | |
[DYNAREC] Fixed a typo in setProtection
Diffstat (limited to 'src')
| -rw-r--r-- | src/custommem.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/custommem.c b/src/custommem.c index bb4ead49..dafdc61f 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -1124,13 +1124,7 @@ void updateProtection(uintptr_t addr, size_t size, uint32_t prot) for (uintptr_t i=(idx>>16); i<=(end>>16); ++i) if(memprot[i].prot==memprot_default) { uint8_t* newblock = box_calloc(1<<16, sizeof(uint8_t)); -#if 0 //def ARM64 //disabled for now, not usefull with the mutex - if (native_lock_storeifref(&memprot[i], newblock, memprot_default) != newblock) { - box_free(newblock); - } -#else memprot[i].prot = newblock; -#endif } for (uintptr_t i=idx; i<=end; ++i) { uint32_t dyn=(memprot[i>>16].prot[i&0xffff]&(PROT_DYNAREC | PROT_DYNAREC_R)); @@ -1158,18 +1152,12 @@ void setProtection(uintptr_t addr, size_t size, uint32_t prot) for (uintptr_t i=(idx>>16); i<=(end>>16); ++i) { if(memprot[i].prot==memprot_default && prot) { uint8_t* newblock = box_calloc(MEMPROT_SIZE, sizeof(uint8_t)); -#if 0 //def ARM64 //disabled for now, not usefull with the mutex - if (native_lock_storeifref(&memprot[i], newblock, memprot_default) != newblock) { - box_free(newblock); - } -#else memprot[i].prot = newblock; -#endif } if(prot || memprot[i].prot!=memprot_default) { uintptr_t bstart = ((i<<16)<idx)?(idx&0xffff):0; uintptr_t bend = (((i<<16)+0xffff)>end)?(end&0xffff):0xffff; - for (uintptr_t j=bstart; i<=bend; ++i) + for (uintptr_t j=bstart; j<=bend; ++j) memprot[i].prot[j] = prot; } } @@ -1202,13 +1190,7 @@ void allocProtection(uintptr_t addr, size_t size, uint32_t prot) for (uintptr_t i=(idx>>16); i<=(end>>16); ++i) if(memprot[i].prot==memprot_default) { uint8_t* newblock = box_calloc(1<<16, sizeof(uint8_t)); -#if 0 //def ARM64 //disabled for now, not usefull with the mutex - if (native_lock_storeifref(&memprot[i], newblock, memprot_default) != newblock) { - box_free(newblock); - } -#else memprot[i].prot = newblock; -#endif } for (uintptr_t i=idx; i<=end; ++i) { const uintptr_t start = i&(MEMPROT_SIZE-1); |