Skip to content

Commit

Permalink
Merge pull request capstone-engine#608 from PerMildner/next
Browse files Browse the repository at this point in the history
Do not truncate branch target address to 32 bit
  • Loading branch information
aquynh committed Mar 26, 2016
2 parents 9119e15 + 5441d5c commit bde4bfa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/PowerPC/PPCInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,20 +564,20 @@ static void printBranchOperand(MCInst *MI, unsigned OpNo, SStream *O)

static void printAbsBranchOperand(MCInst *MI, unsigned OpNo, SStream *O)
{
int imm;
int64_t imm;

if (!MCOperand_isImm(MCInst_getOperand(MI, OpNo))) {
printOperand(MI, OpNo, O);
return;
}

imm = ((int)MCOperand_getImm(MCInst_getOperand(MI, OpNo)) << 2);
imm = MCOperand_getImm(MCInst_getOperand(MI, OpNo)) << 2;

if (!PPC_abs_branch(MI->csh, MCInst_getOpcode(MI))) {
imm = (int)MI->address + imm;
imm = MI->address + imm;
}

SStream_concat(O, "0x%x", imm);
SStream_concat(O, "0x%"PRIx64, imm);

if (MI->csh->detail) {
MI->flat_insn->detail->ppc.operands[MI->flat_insn->detail->ppc.op_count].type = PPC_OP_IMM;
Expand Down

0 comments on commit bde4bfa

Please sign in to comment.