diff options
author | iximeow <me@iximeow.net> | 2020-08-03 21:13:00 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-08-09 01:38:57 -0700 |
commit | a5268e0276e6f00f357c0b7c99a3b62ba202238f (patch) | |
tree | f3215dec3e487f0e884ddcfcceea889863c1dfe7 /src | |
parent | 5d3cd4bf6a03333235bc2cfc2194cb5a95a2a8ec (diff) |
invalid instruction fix
Diffstat (limited to 'src')
-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 { |