mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-18 11:55:38 +00:00
CPU/NewRec: Fix OOB reads on InstructionInfo
This commit is contained in:
parent
4f9cdb37d9
commit
2071addce0
|
@ -111,7 +111,7 @@ const void* CPU::NewRec::Compiler::CompileBlock(CodeCache::Block* block, u32* ho
|
||||||
{
|
{
|
||||||
CompileInstruction();
|
CompileInstruction();
|
||||||
|
|
||||||
if (iinfo->is_last_instruction || m_block_ended)
|
if (m_block_ended || iinfo->is_last_instruction)
|
||||||
{
|
{
|
||||||
if (!m_block_ended)
|
if (!m_block_ended)
|
||||||
{
|
{
|
||||||
|
@ -1111,6 +1111,7 @@ void CPU::NewRec::Compiler::BackupHostState()
|
||||||
bu.dirty_gte_done_cycle = m_dirty_gte_done_cycle;
|
bu.dirty_gte_done_cycle = m_dirty_gte_done_cycle;
|
||||||
bu.block_ended = m_block_ended;
|
bu.block_ended = m_block_ended;
|
||||||
bu.inst = inst;
|
bu.inst = inst;
|
||||||
|
bu.iinfo = iinfo;
|
||||||
bu.current_instruction_pc = m_current_instruction_pc;
|
bu.current_instruction_pc = m_current_instruction_pc;
|
||||||
bu.current_instruction_delay_slot = m_current_instruction_branch_delay_slot;
|
bu.current_instruction_delay_slot = m_current_instruction_branch_delay_slot;
|
||||||
bu.const_regs_valid = m_constant_regs_valid;
|
bu.const_regs_valid = m_constant_regs_valid;
|
||||||
|
@ -1139,6 +1140,7 @@ void CPU::NewRec::Compiler::RestoreHostState()
|
||||||
m_current_instruction_branch_delay_slot = bu.current_instruction_delay_slot;
|
m_current_instruction_branch_delay_slot = bu.current_instruction_delay_slot;
|
||||||
m_current_instruction_pc = bu.current_instruction_pc;
|
m_current_instruction_pc = bu.current_instruction_pc;
|
||||||
inst = bu.inst;
|
inst = bu.inst;
|
||||||
|
iinfo = bu.iinfo;
|
||||||
m_block_ended = bu.block_ended;
|
m_block_ended = bu.block_ended;
|
||||||
m_dirty_gte_done_cycle = bu.dirty_gte_done_cycle;
|
m_dirty_gte_done_cycle = bu.dirty_gte_done_cycle;
|
||||||
m_dirty_instruction_bits = bu.dirty_instruction_bits;
|
m_dirty_instruction_bits = bu.dirty_instruction_bits;
|
||||||
|
|
|
@ -436,7 +436,7 @@ protected:
|
||||||
bool dirty_gte_done_cycle;
|
bool dirty_gte_done_cycle;
|
||||||
bool block_ended;
|
bool block_ended;
|
||||||
const Instruction* inst;
|
const Instruction* inst;
|
||||||
const CodeCache::InstructionInfo* iinfo;
|
CodeCache::InstructionInfo* iinfo;
|
||||||
u32 current_instruction_pc;
|
u32 current_instruction_pc;
|
||||||
bool current_instruction_delay_slot;
|
bool current_instruction_delay_slot;
|
||||||
std::bitset<static_cast<size_t>(Reg::count)> const_regs_valid;
|
std::bitset<static_cast<size_t>(Reg::count)> const_regs_valid;
|
||||||
|
|
Loading…
Reference in a new issue