all repos — mgba @ 728f6481d62463360fd6f6841535733203b7dc8e

mGBA Game Boy Advance Emulator

Abort in invalid memory instead of SEGVing
Jeffrey Pfau jeffrey@endrift.com
Mon, 20 Jan 2014 17:46:17 -0800
commit

728f6481d62463360fd6f6841535733203b7dc8e

parent

aa99196700853006cdff9ad26a9c64cbc8e886f6

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M src/gba/gba-memory.csrc/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; } }