From cc52efc0958102124bfb965e5ba493153847f469 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 30 Jul 2019 14:53:16 +0200 Subject: fix MT 7382, 32bit overflow in some debug commands (nw) --- src/emu/debug/debugcmd.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index fdf08ca0ca4..9ef8b5bcbb3 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -1849,7 +1849,7 @@ void debugger_commands::execute_save(int ref, const std::vector &pa switch (space->addr_shift()) { case -3: - for (offs_t i = offset; i != endoffset; i++) + for (u64 i = offset; i != endoffset; i++) { offs_t curaddr = i; u64 data = space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr) ? @@ -1858,7 +1858,7 @@ void debugger_commands::execute_save(int ref, const std::vector &pa } break; case -2: - for (offs_t i = offset; i != endoffset; i++) + for (u64 i = offset; i != endoffset; i++) { offs_t curaddr = i; u32 data = space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr) ? @@ -1867,7 +1867,7 @@ void debugger_commands::execute_save(int ref, const std::vector &pa } break; case -1: - for (offs_t i = offset; i != endoffset; i++) + for (u64 i = offset; i != endoffset; i++) { offs_t curaddr = i; u16 data = space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr) ? @@ -1876,7 +1876,7 @@ void debugger_commands::execute_save(int ref, const std::vector &pa } break; case 0: - for (offs_t i = offset; i != endoffset; i++) + for (u64 i = offset; i != endoffset; i++) { offs_t curaddr = i; u8 data = space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr) ? @@ -1887,7 +1887,7 @@ void debugger_commands::execute_save(int ref, const std::vector &pa case 3: offset &= ~15; endoffset &= ~15; - for (offs_t i = offset; i != endoffset; i+=16) + for (u64 i = offset; i != endoffset; i+=16) { offs_t curaddr = i; u16 data = space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr) ? @@ -1944,7 +1944,7 @@ void debugger_commands::execute_load(int ref, const std::vector &pa // determine the addresses to read endoffset = (offset + length - 1) & space->addrmask(); offset = offset & space->addrmask(); - offs_t i = 0; + u64 i = 0; // now read the data in, ignore endoffset and load entire file if length has been set to zero (offset-1) switch (space->addr_shift()) { @@ -2089,7 +2089,7 @@ void debugger_commands::execute_dump(int ref, const std::vector &pa auto dis = space->device().machine().disable_side_effects(); bool be = space->endianness() == ENDIANNESS_BIG; - for (offs_t i = offset; i <= endoffset; i += rowsize) + for (u64 i = offset; i <= endoffset; i += rowsize) { output.clear(); output.rdbuf()->clear(); -- cgit v1.2.3