Fix UBSan bootstrap: replace shift of negative value with multiplication.
authorAlexey Samsonov <vonosmas@gmail.com>
Tue, 23 Dec 2014 04:15:53 +0000 (04:15 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Tue, 23 Dec 2014 04:15:53 +0000 (04:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224752 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/Disassembler/MipsDisassembler.cpp

index e5355ef433362e3fa9dc278802c41a3c5e8e5bcb..1b955f59dcf781df75e6af93b9f0055ec622f5b9 100644 (file)
@@ -1614,7 +1614,7 @@ static DecodeStatus DecodeSimm9SP(MCInst &Inst, unsigned Insn,
   case 511: DecodedValue = -257; break;
   default: DecodedValue = SignExtend32<9>(Insn); break;
   }
-  Inst.addOperand(MCOperand::CreateImm(DecodedValue << 2));
+  Inst.addOperand(MCOperand::CreateImm(DecodedValue * 4));
   return MCDisassembler::Success;
 }