diff options
-rw-r--r-- | utils/TableGen/TGParser.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/TableGen/TGParser.cpp b/utils/TableGen/TGParser.cpp index fdc162b4a4..65b6b81849 100644 --- a/utils/TableGen/TGParser.cpp +++ b/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; |