From b7b781db7a2ba94c816ff5138a713114c39d4034 Mon Sep 17 00:00:00 2001 From: iximeow Date: Fri, 10 Jan 2020 22:04:45 -0800 Subject: "fix warnings" this assists many misdecodes from being totally wrong to only slightly wrong and more clear about it (rrr-selected opcodes or W-bit-selected opcodes were accidentally decoded as the first variant of their opcode) also fixes sillier warnings all over the place, and probably a few incorrectly counted lengths --- test/test.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/test.rs b/test/test.rs index 96f77be..7726bb7 100644 --- a/test/test.rs +++ b/test/test.rs @@ -6,6 +6,7 @@ use std::fmt::Write; use yaxpeax_arch::Decoder; use yaxpeax_x86::{Instruction, InstDecoder, decode_one}; +#[allow(dead_code)] fn decode(bytes: &[u8]) -> Option { let mut instr = Instruction::invalid(); match decode_one(&InstDecoder::default(), bytes.iter().map(|x| *x).take(16).collect::>(), &mut instr) { @@ -14,6 +15,7 @@ fn decode(bytes: &[u8]) -> Option { } } +#[allow(dead_code)] fn decode_as(decoder: &InstDecoder, bytes: &[u8]) -> Option { let mut instr = Instruction::invalid(); match decode_one(decoder, bytes.iter().map(|x| *x).take(16).collect::>(), &mut instr) { @@ -105,11 +107,6 @@ fn test_aesni() { test_invalid_under(&InstDecoder::minimal(), bytes); } - fn test_instr_invalid(bytes: &[u8]) { - test_invalid_under(&InstDecoder::minimal().with_aesni(), bytes); - test_invalid_under(&InstDecoder::default(), bytes); - } - test_instr(&[0x66, 0x0f, 0x38, 0xdb, 0x0f], "aesimc xmm1, [rdi]"); test_instr(&[0x66, 0x4f, 0x0f, 0x38, 0xdb, 0xcf], "aesimc xmm9, xmm15"); -- cgit v1.1