mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
Fix aligned_size error and clang-format.
This commit is contained in:
parent
b929ecf44e
commit
f331b5e5d1
@ -554,12 +554,13 @@ s32 MemoryManager::Protect(VAddr addr, size_t size, MemoryProt prot) {
|
|||||||
s64 protected_bytes = 0;
|
s64 protected_bytes = 0;
|
||||||
|
|
||||||
auto aligned_addr = Common::AlignDown(addr, 16_KB);
|
auto aligned_addr = Common::AlignDown(addr, 16_KB);
|
||||||
auto aligned_size = Common::AlignUp(size, 16_KB);
|
auto aligned_size = Common::AlignUp(size + addr - aligned_addr, 16_KB);
|
||||||
do {
|
do {
|
||||||
auto it = FindVMA(aligned_addr + protected_bytes);
|
auto it = FindVMA(aligned_addr + protected_bytes);
|
||||||
auto& vma_base = it->second;
|
auto& vma_base = it->second;
|
||||||
auto result = 0;
|
auto result = 0;
|
||||||
result = ProtectBytes(aligned_addr + protected_bytes, vma_base, aligned_size - protected_bytes, prot);
|
result = ProtectBytes(aligned_addr + protected_bytes, vma_base,
|
||||||
|
aligned_size - protected_bytes, prot);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
// ProtectBytes returned an error, return it
|
// ProtectBytes returned an error, return it
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user