aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-07-24 22:06:26 -0700
committeriximeow <me@iximeow.net>2020-01-12 16:10:13 -0800
commit31b979eba1f4f0c81e355769fa9e6253cb299bf6 (patch)
tree2b46848e0ec96077f422742e7306f5a4c90f0c1e
parent5d5feaa456204c3ac40034af9d74ce3d38182f32 (diff)
last tweaks
-rw-r--r--src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index cbc3c79..6689bba 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1971,7 +1971,8 @@ pub fn read_instr<T: Iterator<Item=u8>>(mut bytes_iter: T, instruction: &mut Ins
}
},
None => {
- return None;
+ unsafe { unreachable_unchecked(); }
+// return None;
}
}
};
@@ -3076,7 +3077,9 @@ fn read_modrm<T: Iterator<Item=u8>>(bytes_iter: &mut T, length: &mut u8) -> Resu
let modrm = match bytes_iter.next() {
Some(b) => b,
// TODO: ...
- None => return Err("Out of bytes".to_string()),
+ None => {
+ return Err("Out of bytes".to_string());
+ }
};
*length += 1;
Ok(modrm)