Skip to content

Commit 9deb6cd

Browse files
FeTetraelad335
andauthored
Fix ppu_register_function_at with unaligned parameters (#17718)
This fixes some crashes in interpreter mode when calling functions like `sys_dbg_write_process_memory` to write data which may not be an instruction. --------- Co-authored-by: Elad <[email protected]>
1 parent e6d723c commit 9deb6cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rpcs3/Emu/Cell/PPUThread.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,9 @@ extern void ppu_register_function_at(u32 addr, u32 size, ppu_intrp_func_t ptr =
827827
return;
828828
}
829829

830+
size = utils::align<u32>(size + addr % 4, 4);
831+
addr &= -4;
832+
830833
if (g_cfg.core.ppu_decoder == ppu_decoder_type::llvm)
831834
{
832835
return;

0 commit comments

Comments
 (0)