mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-12-06 07:12:28 +01:00
Minor fixup of vm::ptr
const pointers shouldn't disable reading, they should disable writing.
This commit is contained in:
parent
81805945ce
commit
a981c65d2f
|
|
@ -204,13 +204,13 @@ namespace vm
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool = false> requires (!std::is_void_v<T> && !std::is_const_v<T>)
|
template <bool = false> requires (!std::is_void_v<T>)
|
||||||
bool try_read(std::conditional_t<std::is_void_v<T>, char, T>& out) const
|
bool try_read(std::conditional_t<std::is_void_v<T>, char, std::remove_const_t<T>>& out) const
|
||||||
{
|
{
|
||||||
return vm::try_access(vm::cast(m_addr), &out, sizeof(T), false);
|
return vm::try_access(vm::cast(m_addr), &out, sizeof(T), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool = false> requires (!std::is_void_v<T>)
|
template <bool = false> requires (!std::is_void_v<T> && !std::is_const_v<T>)
|
||||||
bool try_write(const std::conditional_t<std::is_void_v<T>, char, T>& _in) const
|
bool try_write(const std::conditional_t<std::is_void_v<T>, char, T>& _in) const
|
||||||
{
|
{
|
||||||
return vm::try_access(vm::cast(m_addr), const_cast<T*>(&_in), sizeof(T), true);
|
return vm::try_access(vm::cast(m_addr), const_cast<T*>(&_in), sizeof(T), true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue