From 728f6481d62463360fd6f6841535733203b7dc8e Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 20 Jan 2014 17:46:17 -0800 Subject: [PATCH] Abort in invalid memory instead of SEGVing --- src/gba/gba-memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gba/gba-memory.c b/src/gba/gba-memory.c index 7c45a65ea..bdcfc0331 100644 --- a/src/gba/gba-memory.c +++ b/src/gba/gba-memory.c @@ -7,6 +7,7 @@ #include "memory.h" #include +#include #include static void GBASetActiveRegion(struct ARMMemory* memory, uint32_t region); @@ -117,8 +118,10 @@ static void GBASetActiveRegion(struct ARMMemory* memory, uint32_t address) { 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; } }