aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-07-03 13:42:30 -0700
committeriximeow <me@iximeow.net>2021-07-03 13:43:39 -0700
commite02b7c2c5cfc5ff55f725b00039c8f81be8229f0 (patch)
tree4eb37ddab0ebd6ef59b5cb9adb6c2023065068ef
parentb20147079dec8cdfcd70d23edccf1e1d08ecb962 (diff)
defer checking invalid lengths for multi-prefix instructions
this profiles slightly better? not entirely sure why...
-rw-r--r--src/long_mode/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs
index b75f354..8ed68fb 100644
--- a/src/long_mode/mod.rs
+++ b/src/long_mode/mod.rs
@@ -7024,9 +7024,6 @@ fn read_instr<T: Reader<<Arch as yaxpeax_arch::Arch>::Address, <Arch as yaxpeax_
break record;
} else {
let b = nextb;
- if words.offset() >= 15 {
- return Err(DecodeError::TooLong);
- }
if b == 0x0f {
let b = words.next().ok().ok_or(DecodeError::ExhaustedInput)?;
if b == 0x38 {
@@ -7088,6 +7085,9 @@ fn read_instr<T: Reader<<Arch as yaxpeax_arch::Arch>::Address, <Arch as yaxpeax_
next_rec = unsafe {
core::ptr::read_volatile(&OPCODES[nextb as usize])
};
+ if words.offset() >= 15 {
+ return Err(DecodeError::TooLong);
+ }
prefixes.rex_from(0);
match b {
0x26 |