From 04b103164de94e2bf4c34b691ec73347660eb8a6 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Tue, 1 Nov 2016 20:30:55 +0800 Subject: [PATCH] fix Brew installation in issue #663 --- uc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/uc.c b/uc.c index 23f672da..5e7c4022 100644 --- a/uc.c +++ b/uc.c @@ -1162,12 +1162,24 @@ static size_t cpu_context_size(uc_arch arch, uc_mode mode) // tbl_table is the first entry in the CPU_COMMON macro, so it marks the end // of the interesting CPU registers switch (arch) { +#ifdef UNICORN_HAS_M68K case UC_ARCH_M68K: return M68K_REGS_STORAGE_SIZE; +#endif +#ifdef UNICORN_HAS_X86 case UC_ARCH_X86: return X86_REGS_STORAGE_SIZE; +#endif +#ifdef UNICORN_HAS_ARM case UC_ARCH_ARM: return ARM_REGS_STORAGE_SIZE; +#endif +#ifdef UNICORN_HAS_ARM64 case UC_ARCH_ARM64: return ARM64_REGS_STORAGE_SIZE; +#endif +#ifdef UNICORN_HAS_MIPS case UC_ARCH_MIPS: return mode & UC_MODE_MIPS64 ? MIPS64_REGS_STORAGE_SIZE : MIPS_REGS_STORAGE_SIZE; +#endif +#ifdef UNICORN_HAS_SPARC case UC_ARCH_SPARC: return mode & UC_MODE_SPARC64 ? SPARC64_REGS_STORAGE_SIZE : SPARC_REGS_STORAGE_SIZE; +#endif default: return 0; } }