diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-12-16 05:22:11 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-12-16 05:22:11 +0100 |
commit | b1d633532f25efedd8c89f2a18d47921d33d6088 (patch) | |
tree | 8b2797014bc239b61779fc26e4ca090a8d609b8a /src/core/hle/kernel | |
parent | Merge pull request #9431 from liamwhite/sixty-five-oh-two (diff) | |
download | yuzu-b1d633532f25efedd8c89f2a18d47921d33d6088.tar yuzu-b1d633532f25efedd8c89f2a18d47921d33d6088.tar.gz yuzu-b1d633532f25efedd8c89f2a18d47921d33d6088.tar.bz2 yuzu-b1d633532f25efedd8c89f2a18d47921d33d6088.tar.lz yuzu-b1d633532f25efedd8c89f2a18d47921d33d6088.tar.xz yuzu-b1d633532f25efedd8c89f2a18d47921d33d6088.tar.zst yuzu-b1d633532f25efedd8c89f2a18d47921d33d6088.zip |
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 06010b8d1..286e3f078 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -318,25 +318,23 @@ Result HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_threa } std::vector<u8> HLERequestContext::ReadBuffer(std::size_t buffer_index) const { - std::vector<u8> buffer{}; const bool is_buffer_a{BufferDescriptorA().size() > buffer_index && BufferDescriptorA()[buffer_index].Size()}; - if (is_buffer_a) { ASSERT_OR_EXECUTE_MSG( - BufferDescriptorA().size() > buffer_index, { return buffer; }, + BufferDescriptorA().size() > buffer_index, { return {}; }, "BufferDescriptorA invalid buffer_index {}", buffer_index); - buffer.resize(BufferDescriptorA()[buffer_index].Size()); + std::vector<u8> buffer(BufferDescriptorA()[buffer_index].Size()); memory.ReadBlock(BufferDescriptorA()[buffer_index].Address(), buffer.data(), buffer.size()); + return buffer; } else { ASSERT_OR_EXECUTE_MSG( - BufferDescriptorX().size() > buffer_index, { return buffer; }, + BufferDescriptorX().size() > buffer_index, { return {}; }, "BufferDescriptorX invalid buffer_index {}", buffer_index); - buffer.resize(BufferDescriptorX()[buffer_index].Size()); + std::vector<u8> buffer(BufferDescriptorX()[buffer_index].Size()); memory.ReadBlock(BufferDescriptorX()[buffer_index].Address(), buffer.data(), buffer.size()); + return buffer; } - - return buffer; } std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size, |