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 7ceba534ba
commit 64104d9b2f

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;