Make sure unsupported/illegal instructions are caught

This commit is contained in:
2025-10-07 20:16:27 +02:00
parent dbd022f9c9
commit 361b36fbd1
2 changed files with 6 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ impl Instruction {
/// Returns the opcode of the instruction, with the last 2 bits stripped away, as they are always 0b11 in a non-compressed instruction
pub fn opcode_noncompressed(&self) -> u8 {
debug_assert_eq!(self.0 & 0b11, 0b11);
debug_assert_eq!(self.0 & 0b11, 0b11, "Compressed (or invalid) opcode");
(self.0 >> 2 & 0x1f) as u8
}