MatchRegisterName() returns 0 if it can't match the register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2010-11-06 10:45:34 +00:00
parent 1d6a26507b
commit d68fd9c79e

View File

@ -387,8 +387,8 @@ int ARMAsmParser::TryParseRegister() {
// FIXME: Validate register for the current architecture; we have to do
// validation later, so maybe there is no need for this here.
int RegNum = MatchRegisterName(Tok.getString());
if (RegNum == -1)
unsigned RegNum = MatchRegisterName(Tok.getString());
if (RegNum == 0)
return -1;
Parser.Lex(); // Eat identifier token.
return RegNum;