From a629ad5a0a5f1325d528f335501922dc423acf03 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 17 May 2015 15:41:15 -0700 Subject: Don't overwrite an instruction offset mapping with an extension word value. I really need the ability for a word to be mapped to more than one instruction, but this will be more correct for now --- m68k_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'm68k_core.c') diff --git a/m68k_core.c b/m68k_core.c index 31f536b..1ac4ca2 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -643,7 +643,10 @@ void map_native_address(m68k_context * context, uint32_t address, code_ptr nativ native_code_map[chunk].offsets = malloc(sizeof(int32_t) * NATIVE_CHUNK_SIZE); memset(native_code_map[chunk].offsets, 0xFF, sizeof(int32_t) * NATIVE_CHUNK_SIZE); } - native_code_map[chunk].offsets[offset] = EXTENSION_WORD; + if (native_code_map[chunk].offsets[offset] == INVALID_OFFSET) { + //TODO: Better handling of overlapping instructions + native_code_map[chunk].offsets[offset] = EXTENSION_WORD; + } } } -- cgit v1.2.3