Abort in invalid memory instead of SEGVing

This commit is contained in:
Jeffrey Pfau 2014-01-20 17:46:17 -08:00
parent aa99196700
commit 728f6481d6
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#include "memory.h" #include "memory.h"
#include <limits.h> #include <limits.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
static void GBASetActiveRegion(struct ARMMemory* memory, uint32_t region); 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; memory->activeMask = SIZE_CART0 - 1;
break; break;
default: default:
GBALog(gbaMemory->p, GBA_LOG_ERROR, "Jumped to invalid address");
memory->activeRegion = 0; memory->activeRegion = 0;
memory->activeMask = 0; memory->activeMask = 0;
abort();
break; break;
} }
} }