diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-12-09 02:18:38 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-12-09 02:18:38 +0000 |
commit | bfc35c7cf6b91b576a6e70a9b17c1b895cfc7899 (patch) | |
tree | 1b39d3684eb70a83284713b73e9d6964718bb7fc | |
parent | 16452bae79daa00364c82783084c5ab935d47d63 (diff) | |
download | llvm-bfc35c7cf6b91b576a6e70a9b17c1b895cfc7899.tar.gz |
Merging r216917:
------------------------------------------------------------------------
r216917 | samsonov | 2014-09-02 17:38:34 +0000 (Tue, 02 Sep 2014) | 4 lines
Fix signed integer overflow in PPCInstPrinter.
This bug was reported by UBSan.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223738 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp b/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp index 771b6f5ec487..628819de407e 100644 --- a/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp +++ b/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp @@ -261,7 +261,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); } |