aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-08-03 21:13:00 -0700
committeriximeow <me@iximeow.net>2020-08-09 01:38:57 -0700
commita5268e0276e6f00f357c0b7c99a3b62ba202238f (patch)
treef3215dec3e487f0e884ddcfcceea889863c1dfe7
parent5d3cd4bf6a03333235bc2cfc2194cb5a95a2a8ec (diff)
invalid instruction fix
-rw-r--r--src/long_mode/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs
index e8ccb30..6d42496 100644
--- a/src/long_mode/mod.rs
+++ b/src/long_mode/mod.rs
@@ -5592,6 +5592,9 @@ fn read_instr<T: Iterator<Item=u8>>(decoder: &InstDecoder, mut bytes_iter: T, in
}
}
};
+ if record == OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing) {
+ return Err(DecodeError::InvalidOpcode);
+ }
if let Interpretation::Instruction(opcode) = record.0 {
instruction.opcode = opcode;
} else {