added asserts for index out-of-bounds accesses with wmbullet -flop cpm22 (nw)

This commit is contained in:
Oliver Stöneberg 2014-07-28 07:51:15 +00:00
parent dd71fc9777
commit 34dd10fbdd

View File

@ -595,8 +595,10 @@ UINT8 z80dma_device::read()
if(m_read_num_follow == 0) // special case: Legend of Kage on X1 Turbo
res = m_status;
else
else {
assert(m_read_cur_follow < ARRAY_LENGTH(m_read_regs_follow));
res = m_read_regs_follow[m_read_cur_follow];
}
m_read_cur_follow++;
@ -686,6 +688,7 @@ void z80dma_device::write(UINT8 data)
case COMMAND_READ_STATUS_BYTE:
if (LOG) logerror("Z80DMA '%s' CMD Read status Byte\n", tag());
READ_MASK = 1;
assert(m_read_num_follow < ARRAY_LENGTH(m_read_regs_follow));
m_read_regs_follow[m_read_num_follow++] = m_status;
break;
case COMMAND_RESET_AND_DISABLE_INTERRUPTS: