Fix divtlb crash, nw

This commit is contained in:
mooglyguy 2018-07-05 13:13:00 +02:00
parent ba4f99c559
commit 9d509bd29c

View File

@ -179,10 +179,16 @@ bool device_vtlb_interface::vtlb_fill(offs_t address, int intention)
{
int liveindex = m_dynindex++ % m_dynamic;
// if an entry already exists at this index, free it
if (m_live[liveindex] != 0 && m_refcnt[m_live[liveindex] - 1] <= 1)
if (m_live[liveindex] != 0)
{
if (m_refcnt[m_live[liveindex] - 1] <= 1)
m_table[m_live[liveindex] - 1] = 0;
else
m_refcnt[m_live[liveindex] - 1]--;
}
// claim this new entry
m_live[liveindex] = tableindex + 1;