From e7dec7baa9c6649d71e1b349d93dce6b0cd588bf Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 19 Dec 2021 11:23:18 -0800 Subject: fix incorrect memory size for f30f1e-style nop not only did the instruction have wrong data, but if displayed, the formatter would panic. --- src/long_mode/mod.rs | 1 + src/protected_mode/mod.rs | 1 + src/real_mode/mod.rs | 1 + 3 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index 7e8dff7..44cf992 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -8854,6 +8854,7 @@ fn unlikely_operands< }; instruction.operands[1] = OperandSpec::RegRRR; instruction.operands[0] = read_E(words, instruction, modrm, sz, sink)?; + instruction.mem_size = sz; instruction.regs[0] = RegSpec::from_parts((modrm >> 3) & 7, instruction.prefixes.rex_unchecked().r(), bank); instruction.operand_count = 2; diff --git a/src/protected_mode/mod.rs b/src/protected_mode/mod.rs index 9c03faf..040a23e 100644 --- a/src/protected_mode/mod.rs +++ b/src/protected_mode/mod.rs @@ -8800,6 +8800,7 @@ fn unlikely_operands< }; instruction.operands[1] = OperandSpec::RegRRR; instruction.operands[0] = read_E(words, instruction, modrm, sz, sink)?; + instruction.mem_size = sz; instruction.regs[0] = RegSpec::from_parts((modrm >> 3) & 7, bank); instruction.operand_count = 2; diff --git a/src/real_mode/mod.rs b/src/real_mode/mod.rs index 74e1c37..0a66ab9 100644 --- a/src/real_mode/mod.rs +++ b/src/real_mode/mod.rs @@ -8804,6 +8804,7 @@ fn unlikely_operands< }; instruction.operands[1] = OperandSpec::RegRRR; instruction.operands[0] = read_E(words, instruction, modrm, sz, sink)?; + instruction.mem_size = sz; instruction.regs[0] = RegSpec::from_parts((modrm >> 3) & 7, bank); instruction.operand_count = 2; -- cgit v1.1