Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

Fix address space allocator slow path to avoid OOB

Kelebek1ac49a29b851d
diff --git a/src/common/address_space.inc b/src/common/address_space.inc
index c97dc86516..1ee82df53b 100644
--- a/src/common/address_space.inc
+++ b/src/common/address_space.inc
@@ -336,7 +336,7 @@ ALLOC_MEMBER(VaType)::Allocate(VaType size) {
ASSERT_MSG(false, "Unexpected allocator state!");
}
- auto search_predecessor{this->blocks.begin()};
+ auto search_predecessor{std::next(this->blocks.begin())};
auto search_successor{std::next(search_predecessor)};
while (search_successor != this->blocks.end() &&