From a5268e0276e6f00f357c0b7c99a3b62ba202238f Mon Sep 17 00:00:00 2001 From: iximeow Date: Mon, 3 Aug 2020 21:13:00 -0700 Subject: invalid instruction fix --- src/long_mode/mod.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/long_mode/mod.rs') 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>(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 { -- cgit v1.1