1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 03:02:53 +01:00

Disasm: do not allow to access previous instructions in non-interpreter mode

This commit is contained in:
Eladash 2020-10-31 13:29:50 +02:00 committed by Ivan
parent 5e8419af0d
commit c2c559f8d9
3 changed files with 8 additions and 3 deletions

View File

@ -16,6 +16,11 @@ u32 SPUDisAsm::disasm(u32 pc)
std::pair<bool, v128> SPUDisAsm::try_get_const_value(u32 reg, u32 pc) const std::pair<bool, v128> SPUDisAsm::try_get_const_value(u32 reg, u32 pc) const
{ {
if (m_mode != CPUDisAsm_InterpreterMode)
{
return {};
}
if (pc == umax) if (pc == umax)
{ {
pc = dump_pc; pc = dump_pc;

View File

@ -3144,7 +3144,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point)
void spu_recompiler_base::dump(const spu_program& result, std::string& out) void spu_recompiler_base::dump(const spu_program& result, std::string& out)
{ {
SPUDisAsm dis_asm(CPUDisAsm_InterpreterMode); SPUDisAsm dis_asm(CPUDisAsm_DumpMode);
dis_asm.offset = reinterpret_cast<const u8*>(result.data.data()) - result.lower_bound; dis_asm.offset = reinterpret_cast<const u8*>(result.data.data()) - result.lower_bound;
std::string hash; std::string hash;

View File

@ -1764,8 +1764,8 @@ void Emulator::Resume()
// Print and reset debug data collected // Print and reset debug data collected
if (m_state == system_state::paused && g_cfg.core.ppu_debug) if (m_state == system_state::paused && g_cfg.core.ppu_debug)
{ {
PPUDisAsm dis_asm(CPUDisAsm_InterpreterMode); PPUDisAsm dis_asm(CPUDisAsm_DumpMode);
dis_asm.offset = vm::g_base_addr; dis_asm.offset = vm::g_sudo_addr;
std::string dump; std::string dump;