mirror of
https://github.com/TomHarte/CLK.git
synced 2025-10-27 08:16:22 +00:00
Limit LSL types.
This commit is contained in:
@@ -72,7 +72,17 @@ public:
|
|||||||
std::optional<uint16_t> load_limit(const uint16_t source) {
|
std::optional<uint16_t> load_limit(const uint16_t source) {
|
||||||
try {
|
try {
|
||||||
const auto incoming = descriptor(source);
|
const auto incoming = descriptor(source);
|
||||||
|
const auto description = incoming.description();
|
||||||
|
using DescriptorType = InstructionSet::x86::DescriptorType;
|
||||||
|
if(
|
||||||
|
InstructionSet::x86::is_data_or_code(description.type) ||
|
||||||
|
description.type == DescriptorType::AvailableTaskStateSegment ||
|
||||||
|
description.type == DescriptorType::BusyTaskStateSegment ||
|
||||||
|
description.type == DescriptorType::LDT) {
|
||||||
return incoming.offset();
|
return incoming.offset();
|
||||||
|
} else {
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
} catch (const InstructionSet::x86::Exception &e) {
|
} catch (const InstructionSet::x86::Exception &e) {
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user