From c1dc6838fae67ebf8a1f13abb50b38cdb5d03224 Mon Sep 17 00:00:00 2001 From: Eladash Date: Wed, 29 Apr 2020 07:57:12 +0300 Subject: [PATCH] Fix sys_ppu_thread_get_priority page faults --- rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp index 93a14d5daa..07b6c8594d 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp @@ -277,6 +277,8 @@ error_code sys_ppu_thread_get_priority(u32 thread_id, vm::ptr priop) // Clean some detached thread (hack) g_fxo->get()->clean(0); + u32 prio; + const auto thread = idm::check>(thread_id, [&](ppu_thread& thread) { if (thread.joiner == ppu_join_status::exited) @@ -284,7 +286,7 @@ error_code sys_ppu_thread_get_priority(u32 thread_id, vm::ptr priop) return false; } - *priop = thread.prio; + prio = thread.prio; return true; }); @@ -293,6 +295,7 @@ error_code sys_ppu_thread_get_priority(u32 thread_id, vm::ptr priop) return CELL_ESRCH; } + *priop = prio; return CELL_OK; }