mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-25 16:31:42 +00:00
Resolve sizing types.
This commit is contained in:
parent
cbd4f7965b
commit
795529ef97
@ -26,8 +26,8 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::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.
|
||||
|
||||
|
@ -172,7 +172,7 @@ template <Model model> 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;
|
||||
|
Loading…
Reference in New Issue
Block a user