From ecb830e45c216209f4a8b95d687f1ef4e9185bee Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 13 Oct 2011 23:36:06 +0000 Subject: [PATCH] Fix undefined shift. Patch by Ahmed Charles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141914 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/Disassembler/ARMDisassembler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp index 702a794fad8..2c303530cd0 100644 --- a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp +++ b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp @@ -1011,7 +1011,7 @@ static DecodeStatus DecodeSOImmOperand(llvm::MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder) { uint32_t imm = Val & 0xFF; uint32_t rot = (Val & 0xF00) >> 7; - uint32_t rot_imm = (imm >> rot) | (imm << (32-rot)); + uint32_t rot_imm = (imm >> rot) | (imm << ((32-rot) & 0x1F)); Inst.addOperand(MCOperand::CreateImm(rot_imm)); return MCDisassembler::Success; }