Abort in invalid memory instead of SEGVing
Jeffrey Pfau jeffrey@endrift.com
Mon, 20 Jan 2014 17:46:17 -0800
1 files changed,
3 insertions(+),
0 deletions(-)
jump to
M
src/gba/gba-memory.c
→
src/gba/gba-memory.c
@@ -7,6 +7,7 @@ #include "hle-bios.h"
#include "memory.h" #include <limits.h> +#include <stdlib.h> #include <string.h> static void GBASetActiveRegion(struct ARMMemory* memory, uint32_t region);@@ -117,8 +118,10 @@ memory->activeRegion = gbaMemory->rom;
memory->activeMask = SIZE_CART0 - 1; break; default: + GBALog(gbaMemory->p, GBA_LOG_ERROR, "Jumped to invalid address"); memory->activeRegion = 0; memory->activeMask = 0; + abort(); break; } }