aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-01-13 19:58:05 -0800
committeriximeow <me@iximeow.net>2020-01-13 20:07:28 -0800
commit9835359ed86e3cb570418bc15234fbb7aca4cee8 (patch)
tree9366a4bdefa83aa39591b4acbad9215e73e09833 /src
parentbda346a0caac6896fbc90a61d5d3d15dbc4fb79f (diff)
add Default impl for Instruction to track yaxpeax-arch
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index a2c27d0..9409ca9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2485,6 +2485,12 @@ impl Opcode {
}
}
+impl Default for Instruction {
+ fn default() -> Self {
+ Instruction::invalid()
+ }
+}
+
impl Instruction {
pub fn operand(&self, i: u8) -> Operand {
assert!(i < 4);
@@ -2528,12 +2534,14 @@ impl Instruction {
operands: [OperandSpec::Nothing; 4],
}
}
+
pub fn is_invalid(&self) -> bool {
match self.opcode {
Opcode::Invalid => true,
_ => false
}
}
+
pub fn segment_override_for_op(&self, op: u8) -> Option<Segment> {
match self.opcode {
Opcode::STOS => {