Fix incorrect assert that should be a user error for code like 'mov $0, %%eax'.

llvm-svn: 82054
This commit is contained in:
Kevin Enderby 2009-09-16 17:18:29 +00:00
parent bd0050810c
commit c0edda3184
1 changed files with 2 additions and 1 deletions

View File

@ -241,7 +241,8 @@ bool X86ATTAsmParser::ParseRegister(X86Operand &Op) {
getLexer().Lex(); // Eat percent token.
const AsmToken &Tok = getLexer().getTok();
assert(TokPercent.is(AsmToken::Identifier) && "Invalid token kind!");
if (Tok.isNot(AsmToken::Identifier))
return Error(Tok.getLoc(), "invalid register name");
// FIXME: Validate register for the current architecture; we have to do
// validation later, so maybe there is no need for this here.