1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-10-25 09:27:01 +00:00

Limit LSL types.

This commit is contained in:
Thomas Harte
2025-08-13 13:53:02 -04:00
parent 78a2b27e65
commit b83c2615de

View File

@@ -72,7 +72,17 @@ public:
std::optional<uint16_t> load_limit(const uint16_t source) {
try {
const auto incoming = descriptor(source);
return incoming.offset();
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();
} else {
return std::nullopt;
}
} catch (const InstructionSet::x86::Exception &e) {
return std::nullopt;
}