diff options
author | Lofty <dan.ravensloft@gmail.com> | 2021-08-12 16:01:48 +0100 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2021-08-22 15:24:18 -0700 |
commit | 9578910d7ee5d149ec9a9c46d86f484dc9868bf1 (patch) | |
tree | 294da350fa8740b72b5d52f9a6dbe1522b8a1c39 /src | |
parent | 6322b555e8e5bc9212dd501f09902b3840a20554 (diff) |
B8 instructions cannot be predicated
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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; } |