diff --git a/src/core/memory.cpp b/src/core/memory.cpp index d76cbb67e..afafb14b5 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -607,7 +607,7 @@ int MemoryManager::VirtualQuery(VAddr addr, int flags, } auto it = FindVMA(query_addr); - while (it->second.type == VMAType::Free && flags == 1 && it != vma_map.end()) { + if (it->second.type == VMAType::Free && flags == 1) { ++it; } if (it->second.type == VMAType::Free) {