diff options
| -rw-r--r-- | llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 12 | 
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index c35ef57c9cc..9454fb717f4 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -433,10 +433,11 @@ void ARMAsmPrinter::printAddrMode2OffsetOperand(const MachineInstr *MI, int Op){    const MachineOperand &MO2 = MI->getOperand(Op+1);    if (!MO1.getReg()) { -    if (ARM_AM::getAM2Offset(MO2.getImm()))  // Don't print +0. -      O << "#" -        << (char)ARM_AM::getAM2Op(MO2.getImm()) -        << ARM_AM::getAM2Offset(MO2.getImm()); +    unsigned ImmOffs = ARM_AM::getAM2Offset(MO2.getImm()); +    assert(ImmOffs && "Malformed indexed load / store!"); +    O << "#" +      << (char)ARM_AM::getAM2Op(MO2.getImm()) +      << ImmOffs;      return;    } @@ -483,8 +484,9 @@ void ARMAsmPrinter::printAddrMode3OffsetOperand(const MachineInstr *MI, int Op){    }    unsigned ImmOffs = ARM_AM::getAM3Offset(MO2.getImm()); +  assert(ImmOffs && "Malformed indexed load / store!");    O << "#" -  << (char)ARM_AM::getAM3Op(MO2.getImm()) +    << (char)ARM_AM::getAM3Op(MO2.getImm())      << ImmOffs;  }  | 

