Align thumb BLX immediate by discarding low bits

This commit is contained in:
reyalpchdk 2016-01-16 21:32:09 -08:00
parent 3722c74f69
commit 8b12b71cf5

View File

@ -841,9 +841,7 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
imm += (int32_t)MI->address + 4;
if (ARM_blx_to_arm_mode(MI->csh, opc)) {
// here need to align down to the nearest 4-byte address
#define _ALIGN_DOWN(v, align_width) ((v/align_width)*align_width)
imm = _ALIGN_DOWN(imm, 4);
#undef _ALIGN_DOWN
imm &= ~3;
}
} else {
imm += (int32_t)MI->address + 8;