diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-09-02 17:38:34 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-09-02 17:38:34 +0000 |
commit | 9ca4870b495830b7aff87916119536eb0c056006 (patch) | |
tree | 93131fbbb1a8ab55719e1acdc1e5cfbd528b209c /llvm/lib | |
parent | 14f7301392ee2094581cb1339cf3f064b6397696 (diff) | |
download | bcm5719-llvm-9ca4870b495830b7aff87916119536eb0c056006.tar.gz bcm5719-llvm-9ca4870b495830b7aff87916119536eb0c056006.zip |
Fix signed integer overflow in PPCInstPrinter.
This bug was reported by UBSan.
llvm-svn: 216917
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp b/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp index 35ba3c008f2..670c40a2a3b 100644 --- a/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp +++ b/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp @@ -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); } |