diff --git a/arch/Mips/MipsDisassembler.c b/arch/Mips/MipsDisassembler.c index 683c1f06..d83fb0dd 100644 --- a/arch/Mips/MipsDisassembler.c +++ b/arch/Mips/MipsDisassembler.c @@ -1498,7 +1498,9 @@ static DecodeStatus getInstruction(MCInst *Instr, uint64_t *Size, const uint8_t Result = readInstruction16(Bytes, BytesLen, Address, Size, &Insn, IsBigEndian); if (Result != MCDisassembler_Fail) { - Result = decodeInstruction_2(DecoderTableNanoMips_Conflict_Space16, + // Calling the auto-generated decoder function for NanoMips + // 16-bit instructions. + Result = decodeInstruction_2(DecoderTableNanoMips16, Instr, Insn, Address, NULL); if (Result != MCDisassembler_Fail) { @@ -1506,9 +1508,7 @@ static DecodeStatus getInstruction(MCInst *Instr, uint64_t *Size, const uint8_t return Result; } - // Calling the auto-generated decoder function for NanoMips - // 16-bit instructions. - Result = decodeInstruction_2(DecoderTableNanoMips16, + Result = decodeInstruction_2(DecoderTableNanoMips_Conflict_Space16, Instr, Insn, Address, NULL); if (Result != MCDisassembler_Fail) { diff --git a/tests/issues/issues.yaml b/tests/issues/issues.yaml index 0aefd77d..aa60142f 100644 --- a/tests/issues/issues.yaml +++ b/tests/issues/issues.yaml @@ -6092,4 +6092,12 @@ test_cases: - asm_text: "bgezc $v1, 4" - asm_text: "bltzc $v1, 8" - + - input: + name: "Test nanomips jalrc rd rt is not beqc rd rt 0" + bytes: [ 0xd9, 0x90 ] + arch: "CS_ARCH_MIPS" + options: [ CS_MODE_NANOMIPS, CS_MODE_BIG_ENDIAN ] + address: 0x0 + expected: + insns: + - asm_text: "jalrc $ra, $t0"