mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-09 16:45:03 +00:00
[mips] Fix some UB by shifting before sign-extending
Avoid shifting a negative value by sign-extending after the shift. Fixes a couple of tests that were failing under ubsan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a915f41453
commit
46a8f93144
@ -1855,6 +1855,6 @@ static DecodeStatus DecodeMovePRegPair(MCInst &Inst, unsigned Insn,
|
||||
|
||||
static DecodeStatus DecodeSimm23Lsl2(MCInst &Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder) {
|
||||
Inst.addOperand(MCOperand::createImm(SignExtend32<23>(Insn) << 2));
|
||||
Inst.addOperand(MCOperand::createImm(SignExtend32<25>(Insn << 2)));
|
||||
return MCDisassembler::Success;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user