diff options
author | iximeow <me@iximeow.net> | 2020-01-10 22:04:45 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-01-12 16:10:14 -0800 |
commit | b7b781db7a2ba94c816ff5138a713114c39d4034 (patch) | |
tree | c974ffbdd16e70677f5ee215d9010f6034571064 /test | |
parent | 6f897e655a5f18b28b47542d76ac88d0aebcbc5d (diff) |
"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
Diffstat (limited to 'test')
-rw-r--r-- | test/test.rs | 7 |
1 files changed, 2 insertions, 5 deletions
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<Instruction> { let mut instr = Instruction::invalid(); match decode_one(&InstDecoder::default(), bytes.iter().map(|x| *x).take(16).collect::<Vec<u8>>(), &mut instr) { @@ -14,6 +15,7 @@ fn decode(bytes: &[u8]) -> Option<Instruction> { } } +#[allow(dead_code)] fn decode_as(decoder: &InstDecoder, bytes: &[u8]) -> Option<Instruction> { let mut instr = Instruction::invalid(); match decode_one(decoder, bytes.iter().map(|x| *x).take(16).collect::<Vec<u8>>(), &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"); |