diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-10 07:01:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-10 07:01:53 +0000 |
commit | 70ddafaf4526ec7ce09a7d1764bab86286524b71 (patch) | |
tree | bcd36409fbfea93c26c7ae7fb1dd237e2e2d060c /llvm/utils/TableGen/TGParser.cpp | |
parent | 2e38f2458c68a2a919f0aada5e576b2d506712dc (diff) | |
download | bcm5719-llvm-70ddafaf4526ec7ce09a7d1764bab86286524b71.tar.gz bcm5719-llvm-70ddafaf4526ec7ce09a7d1764bab86286524b71.zip |
Fix a crash on code like: let x = 1 {x
llvm-svn: 45827
Diffstat (limited to 'llvm/utils/TableGen/TGParser.cpp')
-rw-r--r-- | llvm/utils/TableGen/TGParser.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/TGParser.cpp b/llvm/utils/TableGen/TGParser.cpp index fdc162b4a44..65b6b818493 100644 --- a/llvm/utils/TableGen/TGParser.cpp +++ b/llvm/utils/TableGen/TGParser.cpp @@ -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; |