[lldb] [llvm] [AArch64][llvm] Tighten SYSP parsing; don't disassemble invalid encodings (PR #182410)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 12 05:09:15 PDT 2026
================
@@ -1387,21 +1387,28 @@ DecodeXSeqPairsClassRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Addr,
Inst, AArch64::XSeqPairsClassRegClassID, RegNo, Addr, Decoder);
}
-static DecodeStatus DecodeSyspXzrInstruction(MCInst &Inst, uint32_t insn,
- uint64_t Addr,
- const MCDisassembler *Decoder) {
+static DecodeStatus DecodeSyspInstruction(MCInst &Inst, uint32_t insn,
+ uint64_t Addr,
+ const MCDisassembler *Decoder) {
unsigned op1 = fieldFromInstruction(insn, 16, 3);
unsigned CRn = fieldFromInstruction(insn, 12, 4);
unsigned CRm = fieldFromInstruction(insn, 8, 4);
unsigned op2 = fieldFromInstruction(insn, 5, 3);
unsigned Rt = fieldFromInstruction(insn, 0, 5);
- if (Rt != 0b11111)
+
+ if (op1 > 6 || (CRn != 8 && CRn != 9) || CRm > 7 || op2 > 7)
----------------
Lukacma wrote:
op2 cannot be ever greater than 7 so no need to check here
https://github.com/llvm/llvm-project/pull/182410
More information about the llvm-commits
mailing list