macos - Fix crash executing resolver

This commit is contained in:
kd-11 2024-08-24 04:55:51 +03:00 committed by kd-11
parent 470f8674df
commit be0ef0cc28
1 changed files with 10 additions and 0 deletions

View File

@ -5170,8 +5170,18 @@ bool ppu_initialize(const ppu_module& info, bool check_only, u64 file_size)
ensure(jit_mod.symbol_resolver);
}
#ifdef __APPLE__
// Symbol resolver is in JIT mem, so we must enable execution
pthread_jit_write_protect_np(true);
#endif
jit_mod.symbol_resolver(vm::g_exec_addr, info.segs[0].addr);
#ifdef __APPLE__
// Symbol resolver is in JIT mem, so we must enable execution
pthread_jit_write_protect_np(false);
#endif
// Find a BLR-only function in order to copy it to all BLRs (some games need it)
for (const auto& func : info.funcs)
{