Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

Kernel/Memory: Make IsValidPhysicalAddress not go through the current process' virtual memory mapping.

Subv8932f435fc5b
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 4dcbf22748..4d16736f56 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -208,8 +208,7 @@ bool IsValidVirtualAddress(const VAddr vaddr) {
}
bool IsValidPhysicalAddress(const PAddr paddr) {
- boost::optional<VAddr> vaddr = PhysicalToVirtualAddress(paddr);
- return vaddr && IsValidVirtualAddress(*vaddr);
+ return GetPhysicalPointer(paddr) != nullptr;
}
u8* GetPointer(const VAddr vaddr) {