From 31ae988abea268b24a1792a5adce4a1b24d3fffb Mon Sep 17 00:00:00 2001 From: Stephen Miller Date: Sat, 3 May 2025 12:03:59 -0500 Subject: [PATCH] VirtualQuery fix Due to limitations of certain platforms, we initialize our vma_map with 3 separate free mappings. As such, we need to use a while loop here to accurately query mappings with high addresses --- 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 4c29942d7..7610efd7d 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -596,7 +596,7 @@ int MemoryManager::VirtualQuery(VAddr addr, int flags, } auto it = FindVMA(query_addr); - if (it->second.type == VMAType::Free && flags == 1) { + while (it->second.type == VMAType::Free && flags == 1 && it != vma_map.end()) { ++it; } if (it->second.type == VMAType::Free) {