From a981c65d2ff8bf30e82c4fa786a22196e3b269dd Mon Sep 17 00:00:00 2001 From: Eladash Date: Sat, 17 Jul 2021 19:21:17 +0300 Subject: [PATCH] Minor fixup of vm::ptr const pointers shouldn't disable reading, they should disable writing. --- rpcs3/Emu/Memory/vm_ptr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/Memory/vm_ptr.h b/rpcs3/Emu/Memory/vm_ptr.h index 8fadef5841..40060e0336 100644 --- a/rpcs3/Emu/Memory/vm_ptr.h +++ b/rpcs3/Emu/Memory/vm_ptr.h @@ -204,13 +204,13 @@ namespace vm return *this; } - template requires (!std::is_void_v && !std::is_const_v) - bool try_read(std::conditional_t, char, T>& out) const + template requires (!std::is_void_v) + bool try_read(std::conditional_t, char, std::remove_const_t>& out) const { return vm::try_access(vm::cast(m_addr), &out, sizeof(T), false); } - template requires (!std::is_void_v) + template requires (!std::is_void_v && !std::is_const_v) bool try_write(const std::conditional_t, char, T>& _in) const { return vm::try_access(vm::cast(m_addr), const_cast(&_in), sizeof(T), true);