summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-02 20:06:05 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-02 20:13:44 +0100
commitde149dc7fa5654f52aaa86cdbfbb0b7f508af933 (patch)
tree2d45229c149043c258537c546f1586c57134ef1b
parentdf7ddfb8035ed133e01edb3ed3aba0cf2088e8b0 (diff)
downloadserenity-de149dc7fa5654f52aaa86cdbfbb0b7f508af933.zip
LibX86: Don't assert just because insn has no immediate bytes
It's perfectly fine to not have immediate bytes. Many insns don't :^)
-rw-r--r--Userland/Libraries/LibX86/Instruction.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibX86/Instruction.h b/Userland/Libraries/LibX86/Instruction.h
index 2631cf2030..64505856ff 100644
--- a/Userland/Libraries/LibX86/Instruction.h
+++ b/Userland/Libraries/LibX86/Instruction.h
@@ -864,7 +864,8 @@ ALWAYS_INLINE Instruction::Instruction(InstructionStreamType& stream, bool o32,
m_imm2 = stream.read32();
break;
default:
- ASSERT_NOT_REACHED();
+ ASSERT(imm2_bytes == 0);
+ break;
}
switch (imm1_bytes) {
@@ -878,7 +879,8 @@ ALWAYS_INLINE Instruction::Instruction(InstructionStreamType& stream, bool o32,
m_imm1 = stream.read32();
break;
default:
- ASSERT_NOT_REACHED();
+ ASSERT(imm1_bytes == 0);
+ break;
}
m_extra_bytes = prefix_bytes + imm1_bytes + imm2_bytes;