diff options
-rw-r--r-- | src/long_mode/mod.rs | 3 |
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 { |