When disassembler meets compact jump instructions for r6 it crashes as the access to operands array is out of range. This patch adds dedicated decoder method that properly handles decoding of these instructions.
Details
Diff Detail
Event Timeline
Please include the full context as per the instructions at http://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface.
lib/Target/Mips/Disassembler/MipsDisassembler.cpp | ||
---|---|---|
415–416 ↗ | (On Diff #17743) | Nit: indentation |
1771–1773 ↗ | (On Diff #17743) | Nit: indentation |
lib/Target/Mips/Mips32r6InstrInfo.td | ||
381–382 | I'm not sure this one needs a DecoderMethod since there's nothing particularly special about the operands and the new DecodeCompactJump() isn't doing anything tricky. In particular, there aren't any ins/outs that have multiple corresponding MCOperands. It seems like the problem is just innappropriate use of DecodeSimm16. Could you try deleting this line and see if that fixes the problem too? | |
test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt | ||
168 | Nit: delete extra blank line |
Oops, I noticed something after clicking submit. LGTM with a whitespace nit. You gained some additional blank-lines at the end of some of the tests.
I'm not sure this one needs a DecoderMethod since there's nothing particularly special about the operands and the new DecodeCompactJump() isn't doing anything tricky. In particular, there aren't any ins/outs that have multiple corresponding MCOperands. It seems like the problem is just innappropriate use of DecodeSimm16.
Could you try deleting this line and see if that fixes the problem too?