1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:17:46 +00:00

LibX86: Only pass ProcessorMode to Instruction constructor

We previously passed both OperandSize and AddressSize to the
constructor.

Both values were only ever 32-bit at construction.
We used AddressSize::Size64 to signify Long mode which was needlessly
complicated.
This commit is contained in:
Itamar 2022-12-10 20:00:09 +02:00 committed by Andreas Kling
parent 9a136e354d
commit 108a8e4c88
3 changed files with 14 additions and 19 deletions

View file

@ -23,10 +23,10 @@ public:
if (!m_stream.can_read())
return {};
#if ARCH(I386)
return Instruction::from_stream(m_stream, OperandSize::Size32, AddressSize::Size32);
return Instruction::from_stream(m_stream, ProcessorMode::Protected);
#else
# if ARCH(X86_64)
return Instruction::from_stream(m_stream, OperandSize::Size32, AddressSize::Size64);
return Instruction::from_stream(m_stream, ProcessorMode::Long);
# else
dbgln("Unsupported platform");
return {};