summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLofty <dan.ravensloft@gmail.com>2021-08-12 16:01:48 +0100
committeriximeow <me@iximeow.net>2021-08-22 15:24:18 -0700
commit9578910d7ee5d149ec9a9c46d86f484dc9868bf1 (patch)
tree294da350fa8740b72b5d52f9a6dbe1522b8a1c39 /src
parent6322b555e8e5bc9212dd501f09902b3840a20554 (diff)
B8 instructions cannot be predicated
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs16
1 files changed, 16 insertions, 0 deletions
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;
}