From 9578910d7ee5d149ec9a9c46d86f484dc9868bf1 Mon Sep 17 00:00:00 2001 From: Lofty Date: Thu, 12 Aug 2021 16:01:48 +0100 Subject: B8 instructions cannot be predicated --- src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 79a5184..4ae7146 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1323,6 +1323,22 @@ impl yaxpeax_arch::Instruction for InstructionBundle { insn.predicate() == 0 }; + for insn in &self.instructions { + match insn.opcode { + // B8 family instructions cannot be predicated + Opcode::Cover | Opcode::Clrrb | Opcode::Clrrb_pr | Opcode::Rfi | Opcode::Bsw_0 | Opcode::Bsw_1 | Opcode::Epc => { + if insn.predicate() != 0 { + return false; + } + }, + // Undefined opcode regions + Opcode::Purple | Opcode::Cyan | Opcode::Brown | Opcode::White => { + return false; + }, + _ => {}, + } + } + if self.instructions[0].opcode() == Opcode::Alloc && !validate_alloc(&self.instructions[0]) { return false; } -- cgit v1.1