about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-07-02 15:03:43 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-07-02 15:03:43 +0200
commitcb75b670b6353724982212d74a894f014c927667 (patch)
treea012dda7f3b6493fb8599e79bd14cff475cc76fa /src
parent7bb9dd18da19f7acaf32927c720403385065175d (diff)
downloadbox64-cb75b670b6353724982212d74a894f014c927667.tar.gz
box64-cb75b670b6353724982212d74a894f014c927667.zip
Fixed nextFree memory search function (fixing regression with RaceTheSun and probably a few other)
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 0794353c..8cd15f21 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -937,7 +937,7 @@ static uintptr_t nextFree(uintptr_t addr)
         uint8_t *block = kh_value(memprot, k);
         for (uintptr_t i=(addr&0xffffffffLL)>>MEMPROT_SHIFT; i<MEMPROT_SIZE; ++i)
             if(!block[i]) {
-                return addr+(i<<MEMPROT_SHIFT);
+                return (addr&~0xffffffffLL)+(i<<MEMPROT_SHIFT);
             }
         addr += 0x100000000LL;
         addr &= ~0xffffffffLL;