diff options
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 124047a53..6279a4bf8 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -174,6 +174,10 @@ ResultCode Process::HeapFree(VAddr target, u32 size) { | |||
| 174 | return ERR_INVALID_ADDRESS; | 174 | return ERR_INVALID_ADDRESS; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | if (size == 0) { | ||
| 178 | return RESULT_SUCCESS; | ||
| 179 | } | ||
| 180 | |||
| 177 | ResultCode result = vm_manager.UnmapRange(target, size); | 181 | ResultCode result = vm_manager.UnmapRange(target, size); |
| 178 | if (result.IsError()) return result; | 182 | if (result.IsError()) return result; |
| 179 | 183 | ||
| @@ -226,6 +230,10 @@ ResultCode Process::LinearFree(VAddr target, u32 size) { | |||
| 226 | return ERR_INVALID_ADDRESS; | 230 | return ERR_INVALID_ADDRESS; |
| 227 | } | 231 | } |
| 228 | 232 | ||
| 233 | if (size == 0) { | ||
| 234 | return RESULT_SUCCESS; | ||
| 235 | } | ||
| 236 | |||
| 229 | VAddr heap_end = GetLinearHeapBase() + (u32)linheap_memory->size(); | 237 | VAddr heap_end = GetLinearHeapBase() + (u32)linheap_memory->size(); |
| 230 | if (target + size > heap_end) { | 238 | if (target + size > heap_end) { |
| 231 | return ERR_INVALID_ADDRESS_STATE; | 239 | return ERR_INVALID_ADDRESS_STATE; |