[mips][microMIPS] Fix an issue with disassembling lwm32 instruction
authorZoran Jovanovic <zoran.jovanovic@imgtec.com>
Tue, 15 Sep 2015 15:21:27 +0000 (15:21 +0000)
committerZoran Jovanovic <zoran.jovanovic@imgtec.com>
Tue, 15 Sep 2015 15:21:27 +0000 (15:21 +0000)
Fixed microMIPS disassembler crash on test case generated by llvm-mc-fuzzer.
Differential Revision: http://reviews.llvm.org/D12881

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247698 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/Disassembler/MipsDisassembler.cpp
test/MC/Disassembler/Mips/micromips.txt
test/MC/Disassembler/Mips/micromips_le.txt

index 6333d47771689add2f887a4ae60d9f8b512687e0..4aa0afd7e031176f9fae979b70a031996783ad20 100644 (file)
@@ -1915,7 +1915,7 @@ static DecodeStatus DecodeRegListOperand(MCInst &Inst,
                                          uint64_t Address,
                                          const void *Decoder) {
   unsigned Regs[] = {Mips::S0, Mips::S1, Mips::S2, Mips::S3, Mips::S4, Mips::S5,
-                     Mips::S6, Mips::FP};
+                     Mips::S6, Mips::S7, Mips::FP};
   unsigned RegNum;
 
   unsigned RegLst = fieldFromInstruction(Insn, 21, 5);
index 71768307879f63edd8ca2ff63c77c7fd88792e5c..238d786a2b6834f67b5ff0ad1448c5d1db8a797d 100644 (file)
 
 0x20 0x44 0x50 0x08 # CHECK: lwm32 $16, $17, 8($4)
 
+0x21 0x3b 0x59 0x84 # CHECK: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, -1660($27)
+
 0x20 0x44 0xd0 0x08 # CHECK: swm32 $16, $17, 8($4)
 
 0x22 0x04 0x90 0x08 # CHECK: swp $16, 8($4)
index 48046f8d1d45ef24c4bf5e73af6afdc364377fe0..c3b23741bd0d7e1746cde2c90220aafad5bdcac3 100644 (file)
 
 0x44 0x20 0x08 0x50 # CHECK: lwm32 $16, $17, 8($4)
 
+0x3b 0x21 0x84 0x59 # CHECK: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, -1660($27)
+
 0x44 0x20 0x08 0xd0 # CHECK: swm32 $16, $17, 8($4)
 
 0x04 0x22 0x08 0x90 # CHECK: swp $16, 8($4)