Add an error msg if it's an invalid `displ_size`

This commit is contained in:
wtfsck 2022-06-09 22:46:31 +02:00
parent 9f0cb87170
commit 7643bf4c08
1 changed files with 4 additions and 1 deletions

View File

@ -662,7 +662,10 @@ impl Encoder {
self.displ = addr as u32;
self.displ_hi = (addr >> 32) as u32;
}
_ => unreachable!(),
_ => self.set_error_message(format!(
"Operand {}: Instruction::memory_displ_size() must be initialized to 2 (16-bit), 4 (32-bit) or 8 (64-bit)",
operand
)),
}
} else {
if cfg!(debug_assertions) {