diff --git a/llvm/lib/Target/AVR/InstPrinter/AVRInstPrinter.cpp b/llvm/lib/Target/AVR/InstPrinter/AVRInstPrinter.cpp index 58cc9b9ec137..316b7836df0d 100644 --- a/llvm/lib/Target/AVR/InstPrinter/AVRInstPrinter.cpp +++ b/llvm/lib/Target/AVR/InstPrinter/AVRInstPrinter.cpp @@ -145,10 +145,9 @@ void AVRInstPrinter::printPCRelImm(const MCInst *MI, unsigned OpNo, void AVRInstPrinter::printMemri(const MCInst *MI, unsigned OpNo, raw_ostream &O) { - const MCOperand &RegOp = MI->getOperand(OpNo); - const MCOperand &OffsetOp = MI->getOperand(OpNo + 1); + assert(MI->getOperand(OpNo).isReg() && "Expected a register for the first operand"); - assert(RegOp.isReg() && "Expected a register"); + const MCOperand &OffsetOp = MI->getOperand(OpNo + 1); // Print the register. printOperand(MI, OpNo, O);