summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-04 23:16:47 +0100
committerLioncash <mathew1800@gmail.com>2019-03-04 23:16:52 +0100
commit40de7f6fe86358e76244ed14c33752b4b9cd0cf0 (patch)
treedf12fb963298cb4f7be7f38305b1a07ed847ff1e
parentvm_manager: Provide address range checking functions for other memory regions (diff)
downloadyuzu-40de7f6fe86358e76244ed14c33752b4b9cd0cf0.tar
yuzu-40de7f6fe86358e76244ed14c33752b4b9cd0cf0.tar.gz
yuzu-40de7f6fe86358e76244ed14c33752b4b9cd0cf0.tar.bz2
yuzu-40de7f6fe86358e76244ed14c33752b4b9cd0cf0.tar.lz
yuzu-40de7f6fe86358e76244ed14c33752b4b9cd0cf0.tar.xz
yuzu-40de7f6fe86358e76244ed14c33752b4b9cd0cf0.tar.zst
yuzu-40de7f6fe86358e76244ed14c33752b4b9cd0cf0.zip
-rw-r--r--src/core/hle/kernel/vm_manager.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp
index e81856bdc..05c59af34 100644
--- a/src/core/hle/kernel/vm_manager.cpp
+++ b/src/core/hle/kernel/vm_manager.cpp
@@ -257,8 +257,7 @@ ResultCode VMManager::ReprotectRange(VAddr target, u64 size, VMAPermission new_p
}
ResultVal<VAddr> VMManager::HeapAllocate(VAddr target, u64 size, VMAPermission perms) {
- if (target < GetHeapRegionBaseAddress() || target + size > GetHeapRegionEndAddress() ||
- target + size < target) {
+ if (!IsWithinHeapRegion(target, size)) {
return ERR_INVALID_ADDRESS;
}
@@ -293,8 +292,7 @@ ResultVal<VAddr> VMManager::HeapAllocate(VAddr target, u64 size, VMAPermission p
}
ResultCode VMManager::HeapFree(VAddr target, u64 size) {
- if (target < GetHeapRegionBaseAddress() || target + size > GetHeapRegionEndAddress() ||
- target + size < target) {
+ if (!IsWithinHeapRegion(target, size)) {
return ERR_INVALID_ADDRESS;
}