summaryrefslogtreecommitdiff
path: root/utils/TableGen/TGParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/TGParser.cpp')
-rw-r--r--utils/TableGen/TGParser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/TableGen/TGParser.cpp b/utils/TableGen/TGParser.cpp
index 65b6b81849..68a1cba3da 100644
--- a/utils/TableGen/TGParser.cpp
+++ b/utils/TableGen/TGParser.cpp
@@ -616,6 +616,11 @@ Init *TGParser::ParseSimpleValue(Record *CurRec) {
}
case tgtok::l_paren: { // Value ::= '(' IDValue DagArgList ')'
Lex.Lex(); // eat the '('
+ if (Lex.getCode() != tgtok::Id) {
+ TokError("expected identifier in dag init");
+ return 0;
+ }
+
Init *Operator = ParseIDValue(CurRec);
if (Operator == 0) return 0;