mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
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:
parent
f115416db3
commit
16455e91db
Notes:
sideshowbarker
2024-07-19 07:43:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/16455e91dbf
1 changed files with 7 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue