mirror of
https://github.com/PabloMK7/citra.git
synced 2024-12-29 19:16:13 +00:00
Allow GetPhysicalRef to hold a past-the-end offset (#6141)
Games will sometimes use these when representing open right bounds and so disallowing it caused regressions, with a notable example being when MemoryFill is called to the end of vram, causing an "invalid end address" error. This had been noted on a comment in GetPhysicalRef prior to the regression.
This commit is contained in:
parent
030ecaa83c
commit
6a9d36608f
|
@ -77,7 +77,7 @@ public:
|
||||||
}
|
}
|
||||||
MemoryRef(std::shared_ptr<BackingMem> backing_mem_, u64 offset_)
|
MemoryRef(std::shared_ptr<BackingMem> backing_mem_, u64 offset_)
|
||||||
: backing_mem(std::move(backing_mem_)), offset(offset_) {
|
: backing_mem(std::move(backing_mem_)), offset(offset_) {
|
||||||
ASSERT(offset < backing_mem->GetSize());
|
ASSERT(offset <= backing_mem->GetSize());
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
explicit operator bool() const {
|
explicit operator bool() const {
|
||||||
|
|
|
@ -496,7 +496,7 @@ MemoryRef MemorySystem::GetPhysicalRef(PAddr address) const {
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
if (offset_into_region >= target_mem->GetSize()) {
|
if (offset_into_region > target_mem->GetSize()) {
|
||||||
return {nullptr};
|
return {nullptr};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue