summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2023-12-23 15:41:09 -0800
committeriximeow <me@iximeow.net>2023-12-23 15:41:18 -0800
commit6668e8f87a3d2cf814c1ddd77a0eb6fec668c3eb (patch)
tree1f3e0c132196e6ab04a05c19ccc2742f902b14d4 /src
parent92260064e2073a6b3e18c0d2c042002740711c7b (diff)
more fuzz targets
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 67272b0..68f0819 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -22,6 +22,25 @@ pub struct Instruction {
length: u8,
}
+impl PartialEq for Instruction {
+ fn eq(&self, other: &Self) -> bool {
+ let Instruction {
+ opcode: left_opcode,
+ operands: _, // we won't use this `operands`, but `.operands()` to not use stale extra operands
+ length: left_length,
+ } = self;
+ let Instruction {
+ opcode: right_opcode,
+ operands: _, // we won't use this `operands`, but `.operands()` to not use stale extra operands
+ length: right_length,
+ } = other;
+
+ left_opcode == right_opcode &&
+ left_length == right_length &&
+ self.operands() == other.operands()
+ }
+}
+
impl Instruction {
pub fn opcode(&self) -> Opcode {
self.opcode