Fix fix fix

Should prevent infinite loops, haven't tested properly yet though.
This commit is contained in:
Stephen Miller 2025-05-09 09:57:30 -05:00 committed by GitHub
parent a8b865e783
commit 409e5248e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;