Fix signed integer overflow in PPCInstPrinter.

This bug was reported by UBSan.

llvm-svn: 216917
This commit is contained in:
Alexey Samsonov 2014-09-02 17:38:34 +00:00
parent 14f7301392
commit 9ca4870b49
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ void PPCInstPrinter::printAbsBranchOperand(const MCInst *MI, unsigned OpNo,
if (!MI->getOperand(OpNo).isImm())
return printOperand(MI, OpNo, O);
O << (int)MI->getOperand(OpNo).getImm()*4;
O << SignExtend32<32>((unsigned)MI->getOperand(OpNo).getImm() << 2);
}