From 811281e788432d3136de13f72d05790eced52d92 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 10 Jan 2008 07:01:53 +0000 Subject: [PATCH] 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 --- utils/TableGen/TGParser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/TableGen/TGParser.cpp b/utils/TableGen/TGParser.cpp index fdc162b4a44..65b6b818493 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 &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;