Fix integer undefined behavior due to signed left shift overflow in LLVM.

Reviewed offline by chandlerc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162623 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Richard Smith
2012-08-24 23:29:28 +00:00
parent cac59d8ae8
commit 1144af3c9b
19 changed files with 59 additions and 56 deletions

View File

@ -3170,7 +3170,7 @@ static DecodeStatus DecodeT2Imm8S4(MCInst &Inst, unsigned Val,
int imm = Val & 0xFF;
if (!(Val & 0x100)) imm *= -1;
Inst.addOperand(MCOperand::CreateImm(imm << 2));
Inst.addOperand(MCOperand::CreateImm(imm * 4));
}
return MCDisassembler::Success;