From 7bf8917c08bce385427ad23ab189cabff9cb0c25 Mon Sep 17 00:00:00 2001 From: Eladash <18193363+elad335@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:44:42 +0300 Subject: [PATCH] PPU LLVM: Fix crash in Unity games --- rpcs3/Emu/Cell/PPUThread.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 8c10b59928..a9d61cca58 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -5055,12 +5055,19 @@ bool ppu_initialize(const ppu_module& info, bool check_only, u64 file_size) // Try to patch all single and unregistered BLRs with the same function (TODO: Maybe generalize it into PIC code detection and patching) ppu_intrp_func_t BLR_func = nullptr; - const bool is_first = jit && !jit_mod.init; - const bool showing_only_apply_stage = !g_progr.load() && !g_progr_ptotal && !g_progr_ftotal && g_progr_ptotal.compare_and_swap_test(0, 1); progr = "Applying PPU Code..."; + if (!jit) + { + // No functions - nothing to do + ensure(info.funcs.empty()); + return compiled_new; + } + + const bool is_first = !jit_mod.init; + if (is_first) { jit->fin();