Skip to content

Commit 290cd07

Browse files
committed
Fix Xtensa reachable assert.
The immediate given to decodeImm8_sh8Operand has been already shifted. Checking if it is an 8bit value fails therefore.
1 parent 396ba32 commit 290cd07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/Xtensa/Disassembler/XtensaDisassembler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ static DecodeStatus decodeImm8Operand(MCInst &Inst, uint64_t Imm,
157157
static DecodeStatus decodeImm8_sh8Operand(MCInst &Inst, uint64_t Imm,
158158
int64_t Address,
159159
const void *Decoder) {
160-
assert(isUInt<8>(Imm) && "Invalid immediate");
161-
Inst.addOperand(MCOperand::createImm(SignExtend64<16>(Imm << 8)));
160+
assert(isUInt<16>(Imm) && "Invalid immediate");
161+
Inst.addOperand(MCOperand::createImm(SignExtend64<16>(Imm)));
162162
return MCDisassembler::Success;
163163
}
164164

0 commit comments

Comments
 (0)