From 7f24621bec0b0a5b3cab9ec2dfc68929a2d49d25 Mon Sep 17 00:00:00 2001 From: comex Date: Sun, 1 Mar 2015 23:07:15 -0500 Subject: A number of critical fixes painstakingly discovered in the slowest way possible. --- lib/arm/assemble.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/arm/assemble.h') diff --git a/lib/arm/assemble.h b/lib/arm/assemble.h index c0af020..2303a7a 100644 --- a/lib/arm/assemble.h +++ b/lib/arm/assemble.h @@ -3,6 +3,7 @@ struct assemble_ctx { void **codep; + uint_tptr pc; bool thumb; int cond; }; @@ -100,6 +101,8 @@ static inline void Bccrel(struct assemble_ctx ctx, int offset) { } static inline void LDR_PC(struct assemble_ctx ctx, uint32_t dpc) { + if (ctx.pc & 2) + op16(ctx.codep, 0xbf00); if (ctx.thumb) op32(ctx.codep, 0xf000f8df); else -- cgit v1.2.3