From 733b46d51ab583ddadbe7b07805fa2041edd96ca Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 8 Nov 2020 19:03:41 +0300 Subject: [PATCH] sys_semaphore: add state check to sys_semaphore_get_value Also to sys_semaphore_create, although we don't do it. --- rpcs3/Emu/Cell/lv2/sys_semaphore.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp b/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp index 42fab90f1b..be1c4790f1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp @@ -46,6 +46,11 @@ error_code sys_semaphore_create(ppu_thread& ppu, vm::ptr sem_id, vm::ptr cou return CELL_EFAULT; } + if (ppu.test_stopped()) + { + return {}; + } + *count = sema.ret; return CELL_OK; }