Fixed bug in memory operand decoding. (#981)

Fixed bug #979. Decoding a memory operand with a register offset from
the B file would return an incorrect register.
This commit is contained in:
Fotis Loukos 2017-07-31 15:56:29 +03:00 committed by Nguyen Anh Quynh
parent 6cd9313c70
commit 104832daed

View File

@ -289,7 +289,7 @@ static DecodeStatus DecodeMemOperandSc(MCInst *Inst, unsigned Val,
if((offset >= TMS320C64X_REG_A0) && (offset <= TMS320C64X_REG_A31))
offset = (offset - TMS320C64X_REG_A0 + TMS320C64X_REG_B0);
else if((offset >= TMS320C64X_REG_B0) && (offset <= TMS320C64X_REG_B31))
offset = (base - TMS320C64X_REG_B0 + TMS320C64X_REG_A0);
offset = (offset - TMS320C64X_REG_B0 + TMS320C64X_REG_A0);
offsetreg = getReg(GPRegsDecoderTable, offset);
MCOperand_CreateImm0(Inst, (scaled << 19) | (basereg << 12) | (offsetreg << 5) | (mode << 1) | unit);
break;