diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-06-21 23:27:03 +0200 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-06-21 23:27:03 +0200 |
commit | f64d0b3f263c077bc18920f47fe63524fdc6cd94 (patch) | |
tree | 0a05fac06caecd1c9a310da6a386fb5f84d86099 /src/core/hle | |
parent | Merge pull request #2789 from yuriks/misc-kernel (diff) | |
download | yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.gz yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.bz2 yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.lz yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.xz yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.zst yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 1cac1d0c9..5ebe2eca4 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -67,10 +67,13 @@ ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(const u32_le* sr ASSERT(i + num_handles <= command_size); // TODO(yuriks): Return error for (u32 j = 0; j < num_handles; ++j) { Handle handle = src_cmdbuf[i]; - SharedPtr<Object> object = src_table.GetGeneric(handle); - ASSERT(object != nullptr); // TODO(yuriks): Return error - if (descriptor == IPC::DescriptorType::MoveHandle) { - src_table.Close(handle); + SharedPtr<Object> object = nullptr; + if (handle != 0) { + object = src_table.GetGeneric(handle); + ASSERT(object != nullptr); // TODO(yuriks): Return error + if (descriptor == IPC::DescriptorType::MoveHandle) { + src_table.Close(handle); + } } cmd_buf[i++] = AddOutgoingHandle(std::move(object)); @@ -112,9 +115,11 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf, P ASSERT(i + num_handles <= command_size); for (u32 j = 0; j < num_handles; ++j) { SharedPtr<Object> object = GetIncomingHandle(cmd_buf[i]); - - // TODO(yuriks): Figure out the proper error handling for if this fails - Handle handle = dst_table.Create(object).Unwrap(); + Handle handle = 0; + if (object != nullptr) { + // TODO(yuriks): Figure out the proper error handling for if this fails + handle = dst_table.Create(object).Unwrap(); + } dst_cmdbuf[i++] = handle; } break; |