From 795529ef97a24760d499f1c5784b6622b310d733 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 24 Dec 2023 14:26:15 -0500 Subject: [PATCH] Resolve sizing types. --- InstructionSets/x86/Decoder.cpp | 4 ++-- InstructionSets/x86/Decoder.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/InstructionSets/x86/Decoder.cpp b/InstructionSets/x86/Decoder.cpp index 6b8ccf718..50b5c0d6b 100644 --- a/InstructionSets/x86/Decoder.cpp +++ b/InstructionSets/x86/Decoder.cpp @@ -26,8 +26,8 @@ std::pair::InstructionT> Decoder::decode(con // be back to wherever it started, so it's safe to spit out a NOP and reset parsing // without any loss of context. This reduces the risk of the decoder tricking a caller into // an infinite loop. - static constexpr std::size_t max_instruction_length = model >= Model::i80386 ? 15 : (model == Model::i80286 ? 10 : 65536); - const uint8_t *const end = source + std::min(length, max_instruction_length - consumed_); + static constexpr int max_instruction_length = model >= Model::i80386 ? 15 : (model == Model::i80286 ? 10 : 65536); + const uint8_t *const end = source + std::min(length, size_t(max_instruction_length - consumed_)); // MARK: - Prefixes (if present) and the opcode. diff --git a/InstructionSets/x86/Decoder.hpp b/InstructionSets/x86/Decoder.hpp index 47ea4e6e2..7ca9bcc3e 100644 --- a/InstructionSets/x86/Decoder.hpp +++ b/InstructionSets/x86/Decoder.hpp @@ -172,7 +172,7 @@ template class Decoder { // Ephemeral decoding state. Operation operation_ = Operation::Invalid; - uint32_t consumed_ = 0, operand_bytes_ = 0; + int consumed_ = 0, operand_bytes_ = 0; // Source and destination locations. Source source_ = Source::None;