From 409e5248e56742ab7d5775161523e194b6c5ebe5 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Fri, 9 May 2025 09:57:30 -0500 Subject: [PATCH] Fix fix fix Should prevent infinite loops, haven't tested properly yet though. --- src/core/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 217f476b2..9861e813a 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -352,7 +352,7 @@ int MemoryManager::MapMemory(void** out_addr, VAddr virtual_addr, size_t size, M // To account for this, unmap any reserved areas within this mapping range first. auto unmap_addr = mapped_addr; auto unmap_size = size; - while (!vma.IsMapped() && vma.base < mapped_addr + size && remaining_size < size) { + while (!vma.IsMapped() && unmap_addr < mapped_addr + size && remaining_size < size) { auto unmapped = UnmapBytesFromEntry(unmap_addr, vma, unmap_size); unmap_addr += unmapped; unmap_size -= unmapped;