Fix a crash on code like: let x = 1 {x

llvm-svn: 45827
This commit is contained in:
Chris Lattner 2008-01-10 07:01:53 +00:00
parent 2e38f2458c
commit 70ddafaf45
1 changed files with 4 additions and 1 deletions

View File

@ -290,7 +290,10 @@ ParseSubClassReference(Record *CurRec, bool isDefm) {
/// RangePiece ::= INTVAL '-' INTVAL
/// RangePiece ::= INTVAL INTVAL
bool TGParser::ParseRangePiece(std::vector<unsigned> &Ranges) {
assert(Lex.getCode() == tgtok::IntVal && "Invalid range");
if (Lex.getCode() != tgtok::IntVal) {
TokError("expected integer or bitrange");
return true;
}
int Start = Lex.getCurIntVal();
int End;