From 788409adea53a4e7711d26405aab95fd8655d1ce Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 12 Jun 2019 19:22:17 -0400 Subject: [PATCH] Fix fatal error when attempting to set watchpoint covering unaligned portions of two adjacent native words --- src/emu/debug/debugcpu.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 73739a44411..7bb39bc112f 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -2846,10 +2846,13 @@ device_debug::watchpoint::watchpoint(device_debug* debugInterface, } else { - m_start_address[idx] = rstart; - m_end_address[idx] = rend - subamask - 1; - m_masks[idx] = mmask; - idx++; + if (rstart < rend - subamask) + { + m_start_address[idx] = rstart; + m_end_address[idx] = rend - subamask - 1; + m_masks[idx] = mmask; + idx++; + } m_start_address[idx] = rend - subamask; m_end_address[idx] = rend; m_masks[idx] = emask;