LibX86: Don't choke on invalid LOCK prefixes for now

This might be interesting information later, but I'm not sure how to
encode it at the moment.
This commit is contained in:
Andreas Kling 2020-04-11 13:53:12 +02:00
parent f115416db3
commit 16455e91db
Notes: sideshowbarker 2024-07-19 07:43:35 +09:00

View file

@ -950,12 +950,6 @@ Instruction::Instruction(InstructionStream& stream, bool o32, bool a32)
return;
}
if (m_has_lock_prefix && !m_descriptor->lock_prefix_allowed) {
fprintf(stderr, "Instruction not allowed with LOCK prefix, this will raise #UD\n");
m_descriptor = nullptr;
return;
}
m_imm1_bytes = m_descriptor->imm1_bytes_for_address_size(m_a32);
m_imm2_bytes = m_descriptor->imm2_bytes_for_address_size(m_a32);
@ -964,6 +958,13 @@ Instruction::Instruction(InstructionStream& stream, bool o32, bool a32)
m_imm2 = stream.read(m_imm2_bytes);
if (m_imm1_bytes)
m_imm1 = stream.read(m_imm1_bytes);
#ifdef DISALLOW_INVALID_LOCK_PREFIX
if (m_has_lock_prefix && !m_descriptor->lock_prefix_allowed) {
fprintf(stderr, "Instruction not allowed with LOCK prefix, this will raise #UD\n");
m_descriptor = nullptr;
}
#endif
}
u32 InstructionStream::read(unsigned count)