From 4af752a76094e921a614fa4bec0bcf7fae3d8f6f Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 18 Jun 2024 13:42:10 -0700 Subject: a few more accurate hints --- src/long_mode/display.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index a49cbd0..b9c9f79 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -5358,7 +5358,8 @@ fn contextualize_intel(instr: &Instruction, colors: } } - out.write_str(instr.opcode.name())?; + // TODO: no x86 instruction longer than 32 bytes? + unsafe { out.write_lt_32(instr.opcode.name())? }; if instr.operand_count > 0 { out.write_fixed_size(" ")?; @@ -5940,7 +5941,8 @@ impl<'a, Y: YaxColors, F: DisplaySink> crate::long_mode::OperandVisitor for Rela core::mem::transmute::<&[core::mem::MaybeUninit], &str>(buf) }; - self.out.write_str(s)?; + // not actually fixed size, but this should optimize right i hope.. + self.out.write_fixed_size(s)?; // anguished_string_write(&mut self.out, s); Ok(true) } else { @@ -5983,7 +5985,8 @@ impl<'a, Y: YaxColors, F: DisplaySink> crate::long_mode::OperandVisitor for Rela // danger_anguished_string_write(&mut self.out, s); // danger_anguished_variable_length_bstring_write(unsafe { self.out.as_mut_vec() }, s.as_bytes()); - self.out.write_str(s)?; + // not actually fixed size, but this should optimize right i hope.. + self.out.write_fixed_size(s)?; Ok(true) } else { Ok(false) -- cgit v1.1