From 7c6659f4ebb6b3c2fdf3705ce13638af619764e1 Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Thu, 3 Nov 2016 23:06:55 -0700 Subject: Fixed extraction for BL/BLX thumb2 --- lib/arm/dis-thumb2.inc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/arm/dis-thumb2.inc.h b/lib/arm/dis-thumb2.inc.h index d26e9a0..4203c01 100644 --- a/lib/arm/dis-thumb2.inc.h +++ b/lib/arm/dis-thumb2.inc.h @@ -171,19 +171,19 @@ static INLINE void P(unk_Rt_13_VMOVRRD)(tdis_ctx ctx, UNUSED struct bitslice Rt) return P(unidentified)(ctx); } static INLINE void P(t_bltarget_func_1_tBL)(tdis_ctx ctx, struct bitslice func) { - unsigned crap = bs_get(func, ctx->base.op) << 1; + unsigned crap = bs_get(func, ctx->base.op) << 1; // first bit zero unsigned S = crap >> 24 & 1; if (!S) crap ^= (3 << 22); - return P(branch)(ctx, ctx->base.pc + 4 + 2 * sext(crap, 25), CC_CALL); + return P(branch)(ctx, ctx->base.pc + 4 + sext(crap, 25), CC_CALL); } static INLINE void P(t_blxtarget_func_1_tBLXi)(tdis_ctx ctx, struct bitslice func) { - unsigned crap = bs_get(func, ctx->base.op); + unsigned crap = bs_get(func, ctx->base.op) << 1; // first two bits zero unsigned S = crap >> 24 & 1; if (!S) crap ^= (3 << 22); - return P(branch)(ctx, ctx->base.pc + 4 + 2 * sext(crap, 25), CC_CALL); + return P(branch)(ctx, ctx->base.pc + 4 + sext(crap, 25), CC_CALL); } static INLINE void P(rGPR_func_1_t2BXJ)(tdis_ctx ctx, UNUSED struct bitslice func) { return P(unidentified)(ctx); -- cgit v1.2.3