LibX86: Tolerate invalid segment register indices when disassembling

While #6 and #7 are not valid segment register, they can still be
encoded in otherwise-valid instructions, so let's tolerate it.
This commit is contained in:
Andreas Kling 2020-04-11 14:00:20 +02:00
parent d7d7a32d47
commit 1924112d7d
Notes: sideshowbarker 2024-07-19 07:43:27 +09:00
2 changed files with 6 additions and 0 deletions

View File

@ -1760,6 +1760,10 @@ const char* register_name(SegmentRegister index)
return "fs";
case SegmentRegister::GS:
return "gs";
case SegmentRegister::SegR6:
return "segr6";
case SegmentRegister::SegR7:
return "segr7";
default:
ASSERT_NOT_REACHED();
return nullptr;

View File

@ -88,6 +88,8 @@ enum class SegmentRegister {
DS,
FS,
GS,
SegR6,
SegR7,
None = 0xFF,
};