summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2009-09-16 17:18:29 +0000
committerKevin Enderby <enderby@apple.com>2009-09-16 17:18:29 +0000
commitc0edda3184afb681265c195a8b9e56a5bd45c8e4 (patch)
treede1afa84cc484d48b4bfdc09ed7325ebcf2f0c6c /llvm/lib
parentbd0050810c466ee5023e5409de3972373ec9ce5a (diff)
downloadbcm5719-llvm-c0edda3184afb681265c195a8b9e56a5bd45c8e4.tar.gz
bcm5719-llvm-c0edda3184afb681265c195a8b9e56a5bd45c8e4.zip
Fix incorrect assert that should be a user error for code like 'mov $0, %%eax'.
llvm-svn: 82054
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index aa04ba60d37..c357b4d0dee 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -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.
OpenPOWER on IntegriCloud