From 282645e18ac920b2c1051a0bdf3e3236ee5839d6 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 3 Jul 2021 16:13:48 -0700 Subject: add tests for MemoryAccessSize, consistentify style on docs --- src/long_mode/display.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/long_mode/display.rs') diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index b1fb7f8..d042119 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -3308,17 +3308,6 @@ impl Instruction { } } -const MEM_SIZE_STRINGS: [&'static str; 64] = [ - "byte", "word", "BUG", "dword", "BUG", "BUG", "BUG", "qword", - "far", "mword", "BUG", "BUG", "BUG", "BUG", "BUG", "xmmword", - "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", - "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "ymmword", - "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", - "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", - "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", - "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "ptr", "zmmword", -]; - fn contextualize_intel(instr: &Instruction, colors: &Y, _address: u64, _context: Option<&NoContext>, out: &mut T) -> fmt::Result { if instr.prefixes.lock() { write!(out, "lock ")?; @@ -3345,7 +3334,7 @@ fn contextualize_intel(instr: &Instruction, colors: let x = Operand::from_spec(instr, instr.operands[0]); if x.is_memory() { - out.write_str(MEM_SIZE_STRINGS[instr.mem_size as usize - 1])?; + out.write_str(super::MEM_SIZE_STRINGS[instr.mem_size as usize - 1])?; out.write_str(" ")?; } @@ -3365,7 +3354,7 @@ fn contextualize_intel(instr: &Instruction, colors: out.write_str(", ")?; let x = Operand::from_spec(instr, instr.operands[i as usize]); if x.is_memory() { - out.write_str(MEM_SIZE_STRINGS[instr.mem_size as usize - 1])?; + out.write_str(super::MEM_SIZE_STRINGS[instr.mem_size as usize - 1])?; out.write_str(" ")?; } if let Some(prefix) = instr.segment_override_for_op(i) { -- cgit v1.1