diff options
author | Subv <subv2112@gmail.com> | 2017-10-04 18:49:29 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2017-10-04 19:30:33 +0200 |
commit | 0cfb231e002629172337c048e8cabc8c653e34e3 (patch) | |
tree | 217133327f9817305d592cd4eee1d8bed53c8784 /src/core/hle/svc.cpp | |
parent | SVC: Replace GetPointer usage with Read32 in WaitSynchronizationN. (diff) | |
download | yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.tar yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.tar.gz yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.tar.bz2 yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.tar.lz yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.tar.xz yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.tar.zst yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/svc.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 9edce7ab7..61360bede 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -452,10 +452,9 @@ static ResultCode WaitSynchronizationN(s32* out, VAddr handles_address, s32 hand } /// In a single operation, sends a IPC reply and waits for a new request. -static ResultCode ReplyAndReceive(s32* index, Kernel::Handle* handles, s32 handle_count, +static ResultCode ReplyAndReceive(s32* index, VAddr handles_address, s32 handle_count, Kernel::Handle reply_target) { - // 'handles' has to be a valid pointer even if 'handle_count' is 0. - if (handles == nullptr) + if (!Memory::IsValidVirtualAddress(handles_address)) return Kernel::ERR_INVALID_POINTER; // Check if 'handle_count' is invalid @@ -466,7 +465,8 @@ static ResultCode ReplyAndReceive(s32* index, Kernel::Handle* handles, s32 handl std::vector<ObjectPtr> objects(handle_count); for (int i = 0; i < handle_count; ++i) { - auto object = Kernel::g_handle_table.Get<Kernel::WaitObject>(handles[i]); + Kernel::Handle handle = Memory::Read32(handles_address + i * sizeof(Kernel::Handle)); + auto object = Kernel::g_handle_table.Get<Kernel::WaitObject>(handle); if (object == nullptr) return ERR_INVALID_HANDLE; objects[i] = object; |