mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
X86 MC: Reject invalid segment registers before a memory operand colon
Previously we would execute unreachable during object emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214456 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e120a76944
commit
7895ae3135
@ -1632,6 +1632,9 @@ std::unique_ptr<X86Operand> X86AsmParser::ParseATTOperand() {
|
||||
if (getLexer().isNot(AsmToken::Colon))
|
||||
return X86Operand::CreateReg(RegNo, Start, End);
|
||||
|
||||
if (!X86MCRegisterClasses[X86::SEGMENT_REGRegClassID].contains(RegNo))
|
||||
return ErrorOperand(Start, "invalid segment register");
|
||||
|
||||
getParser().Lex(); // Eat the colon.
|
||||
return ParseMemOperand(RegNo, Start);
|
||||
}
|
||||
|
@ -46,3 +46,7 @@ movl %eax,(,%bx)
|
||||
|
||||
// 32: error: invalid operand for instruction
|
||||
outb al, 4
|
||||
|
||||
// 32: error: invalid segment register
|
||||
// 64: error: invalid segment register
|
||||
movl %eax:0x00, %ebx
|
||||
|
Loading…
x
Reference in New Issue
Block a user