diff --git a/src/common/memory_ref.h b/src/common/memory_ref.h index 0a50c7be9..77a118ade 100644 --- a/src/common/memory_ref.h +++ b/src/common/memory_ref.h @@ -77,7 +77,7 @@ public: } MemoryRef(std::shared_ptr backing_mem_, u64 offset_) : backing_mem(std::move(backing_mem_)), offset(offset_) { - ASSERT(offset < backing_mem->GetSize()); + ASSERT(offset <= backing_mem->GetSize()); Init(); } explicit operator bool() const { diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 9f78242fc..178e5383a 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -496,7 +496,7 @@ MemoryRef MemorySystem::GetPhysicalRef(PAddr address) const { default: UNREACHABLE(); } - if (offset_into_region >= target_mem->GetSize()) { + if (offset_into_region > target_mem->GetSize()) { return {nullptr}; }