From 11d6f5764e35bdddae7a4aaf23fd859eecb48c8f Mon Sep 17 00:00:00 2001 From: comex Date: Tue, 24 Feb 2015 20:57:12 -0500 Subject: Add unaligned read/write functions. I thought I could get away without since I wasn't (presently) targeting systems without hardware support for unaligned accesses, but on armv7 clang insists on optimizing into the one ARM instruction that requires alignment anyway - LDM/STM. Oops. Damnit, clang. --- lib/arm/dis-main.inc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/arm/dis-main.inc.h') diff --git a/lib/arm/dis-main.inc.h b/lib/arm/dis-main.inc.h index c9fe983..0d87ba5 100644 --- a/lib/arm/dis-main.inc.h +++ b/lib/arm/dis-main.inc.h @@ -4,7 +4,7 @@ static INLINE void P(dis)(tdis_ctx ctx) { if (ctx->arch.pc_low_bit) { - uint16_t op = *(uint16_t *) ctx->base.ptr; + uint16_t op = unaligned_r16(ctx->base.ptr); bool is_32 = (op >> 13 & 7) == 7 && (op >> 11 & 3) != 0; if (is_32) return P(dis_thumb2)(ctx); -- cgit v1.2.3