From 233e495c1411a813460ce71efb7be69ff73649ee Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 19 Nov 2018 09:05:04 -0500 Subject: kernel/shared_memory: Make Map() and Unmap() take the target process by reference rather than as a pointer Both member functions assume the passed in target process will not be null. Instead of making this assumption implicit, we can change the functions to be references and enforce this at the type-system level. --- src/core/hle/kernel/svc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle/kernel/svc.cpp') diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 75dbfc31d..487e5f0fb 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -796,7 +796,7 @@ static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 s return ERR_INVALID_MEMORY_RANGE; } - return shared_memory->Map(current_process, addr, permissions_type, MemoryPermission::DontCare); + return shared_memory->Map(*current_process, addr, permissions_type, MemoryPermission::DontCare); } static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size) { @@ -826,7 +826,7 @@ static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 return ERR_INVALID_MEMORY_RANGE; } - return shared_memory->Unmap(current_process, addr); + return shared_memory->Unmap(*current_process, addr); } /// Query process memory -- cgit v1.2.3