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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45827 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-01-10 07:01:53 +00:00
parent 36fe6d2f80
commit 811281e788

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;